Skip to content

Instantly share code, notes, and snippets.

@christoph2806
Created January 24, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christoph2806/6b7c3fe6b160f7935d7497dfbea519a1 to your computer and use it in GitHub Desktop.
Save christoph2806/6b7c3fe6b160f7935d7497dfbea519a1 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.7;
import "./usingOraclize.sol";
contract TestOraclize is
usingOraclize
{
event LOG_Query(bytes32 _queryId, string _arg);
event LOG_Callback(bytes32 _queryId, string _result);
modifier onlyOraclize { if (msg.sender != oraclize_cbAddress()) throw; _; }
function TestOraclize () {
OAR = OraclizeAddrResolverI(0xd17e1233a03affb9092d5109179b43d6a8828607);
}
// discard this after testing.
function OAR_getAddress() returns (address _addr) {
_addr = OAR.getAddress();
}
function test_oraclize(string _datasource, string _arg)
returns (bytes32 _queryId) {
_queryId = oraclize_query(_datasource, _arg);
LOG_Query(_queryId, _arg);
}
function __callback(bytes32 _queryId, string _result, bytes _proof) onlyOraclize {
LOG_Callback(_queryId, _result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment