Search code examples
reactjsethereumsoliditytruffleoraclize

I cant read the result from the Oraclize query but i can call it successfully


I create another function in solidity to return the result also there (getGameNumbers) but can I add it to oraclizeCall function enter image description here

  async WinningNumbers ()  {
  const {accounts, contract}=this.state;

  this.state.contract.methods.GenerateGameNumbers().send({from: accounts[0],gas:5000000, fromBlock: 'latest', toBlock: 'latest'+1},(err,results) =>{

    if(results !=null){
      this.setState({
        winNum: (results)

      })
    }
  })
}

I get the transaction hash in the console instead of the result


Solution

  • because I was using oraclize I should call the callback function instead of the one who generate the numbers but as I am using enums I created different functions to get the results and call those