2018-08-14 17:36:08 +00:00
|
|
|
/*global contract, config, it, web3*/
|
2018-06-01 14:48:29 +00:00
|
|
|
const assert = require('assert');
|
2018-06-07 20:14:42 +00:00
|
|
|
const SomeContract = require('Embark/contracts/SomeContract');
|
|
|
|
const MyToken2 = require('Embark/contracts/MyToken2');
|
2018-06-01 14:48:29 +00:00
|
|
|
|
|
|
|
config({
|
|
|
|
contracts: {
|
2019-08-30 20:50:20 +00:00
|
|
|
deploy: {
|
|
|
|
"Token": {
|
|
|
|
deploy: false,
|
|
|
|
args: [1000]
|
|
|
|
},
|
|
|
|
"MyToken2": {
|
|
|
|
instanceOf: "Token",
|
|
|
|
args: [2000]
|
|
|
|
},
|
|
|
|
"SomeContract": {
|
|
|
|
"args": [
|
|
|
|
["$MyToken2", "$accounts[0]"],
|
|
|
|
100
|
|
|
|
]
|
|
|
|
}
|
2018-06-01 14:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
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();
|
2018-06-01 14:48:29 +00:00
|
|
|
assert.strictEqual(address, MyToken2.options.address);
|
2018-03-04 23:46:12 +00:00
|
|
|
});
|
|
|
|
|
2018-08-14 17:36:08 +00:00
|
|
|
it("set account address", async function() {
|
2018-04-17 18:48:31 +00:00
|
|
|
let address = await SomeContract.methods.addr_2().call();
|
2018-08-14 17:36:08 +00:00
|
|
|
assert.strictEqual(address, web3.eth.defaultAccount);
|
2018-03-04 23:46:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|