embark/test_apps/contracts_app/test/array_references_spec.js

39 lines
882 B
JavaScript
Raw Normal View History

contract("SomeContract", function() {
this.timeout(0);
before(function(done) {
this.timeout(0);
var contractsConfig = {
"SimpleStorage": {
args: [100]
},
"Token": {
deploy: false,
args: [1000]
},
"MyToken2": {
instanceOf: "Token",
args: [2000]
},
"SomeContract": {
"args": [
["$MyToken2", "$SimpleStorage"],
100
]
}
};
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
2018-04-17 18:48:31 +00:00
it("set MyToken2 address", async function() {
let address = await SomeContract.methods.addr_1().call();
assert.equal(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();
assert.equal(address, SimpleStorage.options.address);
});
});