【问题标题】:Ethereum/Truffle/Solidity: Error: the tx doesn't have the correct nonceEthereum/Truffle/Solidity:错误:tx 没有正确的随机数
【发布时间】:2019-02-21 12:47:12
【问题描述】:

运行 truffle 测试时,控制台出现以下错误。这可能是什么问题造成的。

错误:tx 没有正确的随机数。帐户的随机数为:7 tx 的随机数为:6

function activateAirline(address airlineAddress) external payable returns(bool) { require(isOperational(), "Service is not available"); require(msg.sender == airlineAddress, "You can only fund your airline"); require(msg.value == 10 ether, "Please submit 10 ether to activate your airline"); contractOwner.transfer(10 ether); }

这是我运行合约脚本的松露初始化

这是我的松露迁移文件

这是我的松露测试

这是我的合约函数

【问题讨论】:

  • 在此处将代码添加为文本,而不是图像。
  • 也添加了代码。

标签: ethereum solidity truffle ganache


【解决方案1】:

"tx 的随机数为:6"

您使用“TX”的方式没有明确定义。当它要求随机数时,取决于你想要做什么,它是与该合约方法交互的地址的随机数。你能发布你的代码吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-11
    • 1970-01-01
    相关资源
    最近更新 更多