You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I want to deploy locally a oracle contract that gives me the current timestamp but it works only one time, after this it does not call the query anymore.
The steps:
ethereum-bridge -H localhost:8545 --broadcast -a 1 --dev --loglevel verbose
I copy the line OAR = OracleAddrResolverI(0xX...X); in the ctor of the TimeMachine contract
truffle migrate --reset
After this, the ganache console prints a infinite number of eth_getFilterChanges and that's a good thing, the call to the exposed public method returns one valid timestamp and the bridge prints this
After this, ganache continue to print filter changes but the bridge does not give me another timestamp, it sticks with the current one for the rost of it's life.
For the full context, see the contract bellow:
pragma solidity ^0.5.10;
import "./usingOraclize.sol";
contract TimeMachine is usingProvable {
uint256 public timestamp;
event LogConstructorInitiated(string nextStep);
event LogPriceUpdated(string price);
event LogNewProvableQuery(string description);
constructor () public payable {
OAR = OracleAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
emit LogConstructorInitiated("Constructor was initiated. Call 'updateTime()' to send the Provable Query.");
updateTime();
}
function pay() public payable {}
function balance() public view returns(uint256) {
return address(this).balance;
}
function __callback(bytes32, string memory result) public {
if (msg.sender != provable_cbAddress()) revert();
timestamp = parseInt(result);
emit LogPriceUpdated(result);
updateTime();
}
function updateTime() public payable {
if (provable_getPrice("URL") > address(this).balance) {
emit LogNewProvableQuery("Provable query was NOT sent, please add some ETH to cover for the query fee");
} else {
emit LogNewProvableQuery("Provable query was sent, standing by for the answer..");
provable_query("URL", "json(http://worldtimeapi.org/api/timezone/Europe/Bucharest).unixtime");
}
}
}
I'm doing something wrong or this is a bug?
The text was updated successfully, but these errors were encountered:
Hello,
I want to deploy locally a oracle contract that gives me the current timestamp but it works only one time, after this it does not call the query anymore.
The steps:
ganache-cli -l 800000000 --allowUnlimitedContractSize
ethereum-bridge -H localhost:8545 --broadcast -a 1 --dev --loglevel verbose
OAR = OracleAddrResolverI(0xX...X);
in the ctor of the TimeMachine contracttruffle migrate --reset
After this, the ganache console prints a infinite number of
eth_getFilterChanges
and that's a good thing, the call to the exposed public method returns one valid timestamp and the bridge prints thisAfter this, ganache continue to print filter changes but the bridge does not give me another timestamp, it sticks with the current one for the rost of it's life.
For the full context, see the contract bellow:
I'm doing something wrong or this is a bug?
The text was updated successfully, but these errors were encountered: