2020-01-24 12:04:42 +01:00
|
|
|
/*global artifacts, contract, config, it*/
|
2018-05-30 17:35:54 -04:00
|
|
|
const assert = require('assert');
|
2020-01-24 12:04:42 +01:00
|
|
|
const AnotherStorage = artifacts.require('AnotherStorage');
|
|
|
|
const SimpleStorage = artifacts.require('SimpleStorage');
|
2018-11-22 08:47:39 -05:00
|
|
|
let accounts;
|
2018-05-30 17:35:54 -04:00
|
|
|
|
|
|
|
config({
|
2019-08-30 15:50:20 -05:00
|
|
|
namesystem: {
|
|
|
|
enabled: true
|
|
|
|
},
|
2018-05-30 17:35:54 -04:00
|
|
|
contracts: {
|
2019-08-30 15:50:20 -05:00
|
|
|
deploy: {
|
|
|
|
"SimpleStorage": {
|
|
|
|
args: [100]
|
|
|
|
},
|
|
|
|
"AnotherStorage": {
|
2019-11-07 10:59:26 -05:00
|
|
|
args: ["$SimpleStorage", "embark.eth"]
|
2019-08-30 15:50:20 -05:00
|
|
|
}
|
2018-05-30 17:35:54 -04:00
|
|
|
}
|
|
|
|
}
|
2018-11-22 08:47:39 -05:00
|
|
|
}, (err, accs) => {
|
|
|
|
accounts = accs;
|
2018-05-30 17:35:54 -04:00
|
|
|
});
|
|
|
|
|
2017-07-03 18:15:43 -04:00
|
|
|
contract("AnotherStorage", function() {
|
2018-01-05 15:10:47 -05:00
|
|
|
this.timeout(0);
|
2017-02-09 19:38:02 -05:00
|
|
|
|
2018-04-17 14:48:31 -04:00
|
|
|
it("set SimpleStorage address", async function() {
|
2018-11-22 08:47:39 -05:00
|
|
|
const result = await AnotherStorage.methods.simpleStorageAddress().call();
|
2018-04-17 14:48:31 -04:00
|
|
|
assert.equal(result.toString(), SimpleStorage.options.address);
|
2017-02-09 19:38:02 -05:00
|
|
|
});
|
2018-11-22 08:47:39 -05:00
|
|
|
|
2019-11-07 10:59:26 -05:00
|
|
|
it("set ENS address", async function() {
|
2018-11-22 08:47:39 -05:00
|
|
|
const result = await AnotherStorage.methods.ens().call();
|
|
|
|
assert.equal(result.toString(), accounts[0]);
|
|
|
|
});
|
2017-02-09 19:38:02 -05:00
|
|
|
});
|