松露无法识别构造函数的大小变化

时间:2018-08-08 02:12:28

标签: solidity truffle

出于某种原因,松露无法识别构造函数大小的变化

我尝试过的事情

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

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

(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.

第二次运行测试时,它会使松露崩溃,所以我必须运行一个测试后才能重新启动松露。

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)

1 个答案:

答案 0 :(得分:0)

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