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