mirror of https://github.com/embarklabs/embark.git
change another storage test
This commit is contained in:
parent
049af73294
commit
3555575ff9
|
@ -81,6 +81,9 @@ class Test {
|
|||
if (!callback) {
|
||||
callback = function () {};
|
||||
}
|
||||
if (!options.contracts) {
|
||||
throw new Error(__('No contracts specified in the options'));
|
||||
}
|
||||
this.options = utils.recursiveMerge(this.options, options);
|
||||
this.simOptions = this.options.simulatorOptions || {};
|
||||
this.ready = false;
|
||||
|
@ -145,8 +148,8 @@ class Test {
|
|||
}
|
||||
|
||||
require(module) {
|
||||
if (module.startsWith('contracts/')) {
|
||||
const contractName = module.substr(10);
|
||||
if (module.startsWith('Embark/contracts/')) {
|
||||
const contractName = module.substr(17);
|
||||
if (!this.engine.contractsManager.contracts[contractName]) {
|
||||
throw new Error(__('No contract with the name %s', contractName));
|
||||
}
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
/*global contract, config, it, embark*/
|
||||
const assert = require('assert');
|
||||
const AnotherStorage = embark.require('Embark/contracts/AnotherStorage');
|
||||
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
|
||||
|
||||
config({
|
||||
contracts: {
|
||||
"SimpleStorage": {
|
||||
args: [100]
|
||||
},
|
||||
"AnotherStorage": {
|
||||
args: ["$SimpleStorage"]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
contract("AnotherStorage", function() {
|
||||
this.timeout(0);
|
||||
before(function(done) {
|
||||
this.timeout(0);
|
||||
var contractsConfig = {
|
||||
"SimpleStorage": {
|
||||
args: [100]
|
||||
},
|
||||
"AnotherStorage": {
|
||||
args: ["$SimpleStorage"]
|
||||
}
|
||||
};
|
||||
EmbarkSpec.deployAll(contractsConfig, () => { done() });
|
||||
});
|
||||
|
||||
it("set SimpleStorage address", async function() {
|
||||
let result = await AnotherStorage.methods.simpleStorageAddress().call();
|
||||
assert.equal(result.toString(), SimpleStorage.options.address);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*global contract, config, it, embark*/
|
||||
const assert = require('assert');
|
||||
const SimpleStorage = embark.require('contracts/SimpleStorage');
|
||||
const SimpleStorage = embark.require('Embark/contracts/SimpleStorage');
|
||||
|
||||
config({
|
||||
contracts: {
|
||||
|
|
Loading…
Reference in New Issue