embark/dapps/tests/contracts/test/another_storage_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

38 lines
911 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({
namesystem: {
enabled: true
},
contracts: {
deploy: {
"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]);
});
});