2018-05-31 13:52:37 +00:00
|
|
|
/*global contract, config, it, embark*/
|
|
|
|
const assert = require('assert');
|
|
|
|
const SomeContract = embark.require('Embark/contracts/SomeContract');
|
|
|
|
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
|
|
|
|
const MyToken2 = embark.require('Embark/contracts/MyToken2');
|
|
|
|
|
|
|
|
config({
|
|
|
|
contracts: {
|
|
|
|
"SimpleStorage": {
|
|
|
|
args: [100]
|
|
|
|
},
|
|
|
|
"Token": {
|
|
|
|
deploy: false,
|
|
|
|
args: [1000]
|
|
|
|
},
|
|
|
|
"MyToken2": {
|
|
|
|
instanceOf: "Token",
|
|
|
|
args: [2000]
|
|
|
|
},
|
|
|
|
"SomeContract": {
|
|
|
|
"args": [
|
|
|
|
["$MyToken2", "$SimpleStorage"],
|
|
|
|
100
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-03-04 23:46:12 +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();
|
|
|
|
assert.equal(address, MyToken2.options.address);
|
2018-03-04 23:46:12 +00:00
|
|
|
});
|
|
|
|
|
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);
|
2018-03-04 23:46:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|