/* INCLUDE ORACLE LOGIC */
#include "../dappservices/oracle.hpp"
/* ADD DAPP NETWORK RELATED ORACLE ACTIONS */
#define DAPPSERVICES_ACTIONS() \
XSIGNAL_DAPPSERVICE_ACTION \
ORACLE_DAPPSERVICE_ACTIONS
#define DAPPSERVICE_ACTIONS_COMMANDS() \
#define CONTRACT_NAME() oracleconsumer
testget - provide a URI using the DAPP Network Oracle syntax and an expected result,
if the result does not match the expected field, the transaction fails
testrnd - fetch oracle request based on URI without expected field assertion
[[eosio::action]] void testget(std::vector<char> uri, std::vector<char> expectedfield) {
/* USE EOSIO'S ASSERTION TO CHECK FOR REQUIRED THREHSHOLD OF ORACLES IS MET */
eosio::check(getURI(uri, [&]( auto& results ) {
eosio::check(results.size() > 0, "require multiple results for consensus");
auto itr = results.begin();
auto first = itr->result;
/* SET CONSENSUS LOGIC FOR RESULTS */
while(itr != results.end()) {
eosio::check(itr->result == first, "consensus failed");
}) == expectedfield, "wrong data");
[[eosio::action]] void testrnd(std::vector<char> uri) {
getURI(uri, [&]( auto& results ) {
return results[0].result;
CONTRACT_END((testget)(testrnd))