添加migration.js

时间:2018-06-05 17:30:04

标签: ethereum truffle

我编写的javascript测试与truffle test ./test/Token.js

运行良好

然而,当我有以下内容时:

var UTO = artifacts.require("./uto.sol");

module.exports = function(deployer) {
  deployer.deploy(UTO);
};

然后我收到以下错误:

  

UTO合同构造函数预期6个参数,收到0

错误本身很好,它需要参数。但是,我想知道为什么会发生这种情况,因为我的测试脚本设置了这些参数:

before(async function() {

      // deploy contract with parameters for testing
      contract = await C.new(company, _token_eth, _name, _symbol, _decimals, _percentToHold);
  });

我可以对部署者进行注释,一切正常..那么为什么truffle命令会在测试脚本之外触发部署呢?

由于

0 个答案:

没有答案