embark/test_apps/contracts_app/test/another_storage_spec.js
Jonathan Rainville d09d410021 refactor(ENS): adds a whitelist for ens
Enables only the use of domains in that white list
2018-11-23 16:32:57 -05:00

33 lines
840 B
JavaScript

/*global contract, config, it*/
const assert = require('assert');
const AnotherStorage = require('Embark/contracts/AnotherStorage');
const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
config({
contracts: {
"SimpleStorage": {
args: [100]
},
"AnotherStorage": {
args: ["$SimpleStorage", "embark.eth"]
}
}
}, (err, accs) => {
accounts = accs;
});
contract("AnotherStorage", function() {
this.timeout(0);
it("set SimpleStorage address", async function() {
const result = await AnotherStorage.methods.simpleStorageAddress().call();
assert.equal(result.toString(), SimpleStorage.options.address);
});
it("set ENS address", async function() {
const result = await AnotherStorage.methods.ens().call();
assert.equal(result.toString(), accounts[0]);
});
});