embark/dapps/tests/app/test/array_references_spec.js
Michael Bradley b736ebefcd refactor: initial steps toward 5.0.0-alpha.0 (#1856)
BREAKING CHANGE:

There are more than several breaking changes, including DApp configuration for
accounts.
2019-08-30 16:50:20 -04:00

42 lines
921 B
JavaScript

/*global contract, config, it, web3*/
const assert = require('assert');
const SomeContract = require('Embark/contracts/SomeContract');
const MyToken2 = require('Embark/contracts/MyToken2');
config({
contracts: {
deploy: {
"Token": {
deploy: false,
args: [1000]
},
"MyToken2": {
instanceOf: "Token",
args: [2000]
},
"SomeContract": {
"args": [
["$MyToken2", "$accounts[0]"],
100
]
}
}
}
});
contract("SomeContract", function() {
this.timeout(0);
it("set MyToken2 address", async function() {
let address = await SomeContract.methods.addr_1().call();
assert.strictEqual(address, MyToken2.options.address);
});
it("set account address", async function() {
let address = await SomeContract.methods.addr_2().call();
assert.strictEqual(address, web3.eth.defaultAccount);
});
});