embark/dapps/tests/contracts/test/array_references_spec.js

45 lines
1.0 KiB
JavaScript
Raw Normal View History

/*global artifacts, contract, config, it*/
2018-05-31 13:52:37 +00:00
const assert = require('assert');
const SomeContract = artifacts.require('SomeContract');
const SimpleStorage = artifacts.require('SimpleStorage');
const MyToken2 = artifacts.require('MyToken2');
2018-05-31 13:52:37 +00:00
config({
contracts: {
deploy: {
"SimpleStorage": {
args: [100]
},
"Token": {
deploy: false,
args: [1000]
},
"MyToken2": {
instanceOf: "Token",
args: [2000]
},
"SomeContract": {
"args": [
["$MyToken2", "$SimpleStorage"],
100
]
}
2018-05-31 13:52:37 +00:00
}
}
});
contract("SomeContract", function() {
this.timeout(0);
2018-04-17 18:48:31 +00:00
it("set MyToken2 address", async function() {
let address = await SomeContract.methods.addr_1().call();
2018-06-01 17:44:30 +00:00
assert.strictEqual(address, MyToken2.options.address);
});
2018-04-17 18:48:31 +00:00
it("set SimpleStorage address", async function() {
let address = await SomeContract.methods.addr_2().call();
2018-06-01 17:44:30 +00:00
assert.strictEqual(address, SimpleStorage.options.address);
});
});