mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-27 22:16:15 +00:00
b021689387
This commit adds a convenience API `artifacts.require(name)` that aims to make requiring artifacts a little bit more straight forward. Usage: ``` const SimpleStorage = artifacts.require('SimpleStorage'); const EmbarkJS = artifacts.require('EmbarkJS'); ```
38 lines
908 B
JavaScript
38 lines
908 B
JavaScript
/*global artifacts, contract, config, it*/
|
|
const assert = require('assert');
|
|
const AnotherStorage = artifacts.require('AnotherStorage');
|
|
const SimpleStorage = artifacts.require('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]);
|
|
});
|
|
});
|