Skip to content

Not getting the __callback()  #100

@nurajc

Description

@nurajc

I have tried the code snippet provided in samples before and it worked. Also I tried my own contract with oraclized for GET and POST requests and it worked. But recently I noticed that the callback function is not being called in any of those previously worked samples.
I tried increasing the gas price upto 1000 GEWI for the callback and the result was the same.

I have been trying on Ropsten test network.

Following is a code snipped that is supposed to work, but does not receive a callback. I have imported the proper oraclized solidity file from a file and copied all the content from provable things github to that file.

`pragma solidity ^0.4.22;
import "./oracleService.sol";

contract ExampleContract is usingProvable {

string public ETHUSD;
event LogConstructorInitiated(string nextStep);
event LogPriceUpdated(string price);
event LogNewProvableQuery(string description);

function ExampleContract() payable {
provable_setCustomGasPrice(10000000000);
LogConstructorInitiated("Constructor was initiated. Call 'updatePrice()' to send the Provable Query.");
}

function __callback(bytes32 myid, string result) {
if (msg.sender != provable_cbAddress()) revert();
ETHUSD = result;
LogPriceUpdated(result);
}

function updatePrice() payable {
if (provable_getPrice("URL") > this.balance) {
LogNewProvableQuery("Provable query was NOT sent, please add some ETH to cover for the query fee");
} else {
LogNewProvableQuery("Provable query was sent, standing by for the answer..");
bytes32 queryId = provable_query("URL",
"json(https://www.therocktrading.com/api/ticker/BTCEUR).result.0.last");
}
}
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions