【问题标题】:I cant read the result from the Oraclize query but i can call it successfully我无法读取 Oraclize 查询的结果,但我可以成功调用它
【发布时间】:2019-06-22 21:54:17
【问题描述】:

我在solidity中创建了另一个函数来返回结果(getGameNumbers),但我可以将它添加到 oraclizeCall 函数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)

      })
    }
  })
}

我在控制台中得到交易哈希而不是结果

【问题讨论】:

标签: reactjs ethereum solidity truffle oraclize


【解决方案1】:

因为我使用的是 oraclize,所以我应该调用回调函数而不是生成数字的那个,但是当我使用枚举时,我创建了不同的函数来获取结果并调用这些函数

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-04
    • 2021-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多