embark/dapps/tests/contracts/test/another_storage_spec.js

42 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-06-07 16:14:42 -04:00
/*global contract, config, it*/
2018-05-30 17:35:54 -04:00
const assert = require('assert');
2018-06-07 16:14:42 -04:00
const AnotherStorage = require('Embark/contracts/AnotherStorage');
const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
2018-05-30 17:35:54 -04:00
config({
namesystem: {
enabled: true
},
2018-05-30 17:35:54 -04:00
contracts: {
deploy: {
"SimpleStorage": {
args: [100]
},
// "AnotherStorage": {
// args: ["$SimpleStorage", "embark.eth"]
// },
"AnotherStorage": {
args: ["$SimpleStorage", "$SimpleStorage"]
}
2018-05-30 17:35:54 -04: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() {
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
});
// FIXME add back when the ENS feature is back
xit("set ENS address", async function() {
const result = await AnotherStorage.methods.ens().call();
assert.equal(result.toString(), accounts[0]);
});
2017-02-09 19:38:02 -05:00
});