由于某种原因,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)发布于 2018-08-08 10:49:36
事实证明,在我的迁移文件夹中,我没有更新2_deploy_contracts来使用所有三个构造函数参数。它对我来说是隐藏的,因为我只运行测试testFile.js,并没有意识到它每次都会运行这个迁移
https://stackoverflow.com/questions/51737704
复制相似问题