provable-things / ethereum-api

Provable API for Ethereum smart contracts
https://docs.provable.xyz/#ethereum
MIT License
800 stars 428 forks source link

__callback function wasn't triggered in provable #122

Closed CrazyDream000 closed 1 year ago

CrazyDream000 commented 1 year ago

I'm using Provable.sol for getting data from api. here is api request https://us-central1-dust-51e6b.cloudfunctions.net/getBalanceApi?address=0x525eB3Cb3AbD89fd94a729694E6A049b3B277468&limitAmount=0

string public returnValue;
bytes32 public currentQueryID;
bytes32 public pendingQueryID;

constructor() public {
    getData();
}

function __callback(bytes32 _myid, string memory _result) public {
    require(msg.sender == provable_cbAddress());
    currentQueryID = _myid;
    returnValue = _result;
}

function getData() public payable {
    pendingQueryID = provable_query(
        "URL",
        "json(https://us-central1-dust-51e6b.cloudfunctions.net/getBalanceApi?address=0x525eB3Cb3AbD89fd94a729694E6A049b3B277468&limitAmount=0).ethereum.0.contract_address"
    );
}

but I couldn't receive the __callback function event.