【问题标题】:Truffle not recognizing constructor size change松露不识别构造函数大小变化
【发布时间】:2018-08-08 02:12:28
【问题描述】:

由于某种原因 truffle 无法识别构造函数大小的变化

我尝试过的事情

1) 卸载松露并重新安装 2)删除build文件夹并重新编译

当我运行测试时它会抱怨但仍然运行测试

(node:97628) UnhandledPromiseRejectionWarning: Error: Factory contract constructor expected 3 arguments, received 2
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:390:1
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:374:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:97628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:97628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

第二次运行测试时,truffle 崩溃了,所以我必须在运行一个测试后重新启动 truffle。

Error: Factory contract constructor expected 3 arguments, received 2
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:390:1
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:374:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)

【问题讨论】:

    标签: solidity truffle


    【解决方案1】:

    事实证明,在我的迁移文件夹中,我没有更新 2_deploy_contracts 以使用所有三个构造函数参数。它对我来说是隐藏的,因为我只是在运行测试 testFile.js 并且没有意识到它每次都运行这个迁移

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 1970-01-01
      相关资源
      最近更新 更多