首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >松露不能识别构造函数大小的变化

松露不能识别构造函数大小的变化
EN

Stack Overflow用户
提问于 2018-08-08 10:12:28
回答 1查看 48关注 0票数 0

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

我试过的东西

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

当我运行一个测试时,它会报错,但还是会运行测试

代码语言:javascript
复制
(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。

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

发布于 2018-08-08 10:49:36

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51737704

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档