conflict in packagelock

This commit is contained in:
Jonathan Rainville 2018-06-01 13:44:30 -04:00
parent dbb2352928
commit 5fb4e3330c
3 changed files with 98 additions and 102 deletions

View File

@ -31,12 +31,12 @@ contract("SomeContract", function() {
it("set MyToken2 address", async function() { it("set MyToken2 address", async function() {
let address = await SomeContract.methods.addr_1().call(); let address = await SomeContract.methods.addr_1().call();
assert.equal(address, MyToken2.options.address); assert.strictEqual(address, MyToken2.options.address);
}); });
it("set SimpleStorage address", async function() { it("set SimpleStorage address", async function() {
let address = await SomeContract.methods.addr_2().call(); let address = await SomeContract.methods.addr_2().call();
assert.equal(address, SimpleStorage.options.address); assert.strictEqual(address, SimpleStorage.options.address);
}); });
}); });

View File

@ -1,7 +1,9 @@
contract("Test", function() { /*global contract, config, it, embark*/
before(function(done) { const assert = require('assert');
this.timeout(0); const Test2 = embark.require('Embark/contracts/Test2');
var contractsConfig = {
config({
contracts: {
"Test2": { "Test2": {
}, },
"ZAMyLib": { "ZAMyLib": {
@ -9,14 +11,13 @@ contract("Test", function() {
"ZAMyLib2": { "ZAMyLib2": {
"deploy": true "deploy": true
} }
}; }
});
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
contract("Test", function() {
it("should call library correctly", async function() { it("should call library correctly", async function() {
let result = await Test2.methods.testAdd().call(); let result = await Test2.methods.testAdd().call();
assert.equal(result, 3); assert.strictEqual(parseInt(result, 10), 3);
}); });
}); });

View File

@ -1,87 +1,82 @@
/*global describe, config, it, embark*/
const assert = require('assert');
const Token = embark.require('Embark/contracts/Token');
const MyToken = embark.require('Embark/contracts/MyToken');
const MyToken2 = embark.require('Embark/contracts/MyToken2');
const AlreadyDeployedToken = embark.require('Embark/contracts/AlreadyDeployedToken');
const Test = embark.require('Embark/contracts/Test');
describe("Token", function() { config({
contracts: {
this.timeout(0); ZAMyLib: {},
before(function(done) { SimpleStorage: {
this.timeout(0);
//config({
// node: "http://localhost:8545"
//});
var contractsConfig = {
"ZAMyLib": {
},
"Token": {
},
"SimpleStorage": {
args: [100] args: [100]
}, },
"AnotherStorage": { AnotherStorage: {
args: ["$SimpleStorage"] args: ["$SimpleStorage"]
}, },
"Token": { Token: {
deploy: false, deploy: false,
args: [1000] args: [1000]
}, },
"MyToken": { MyToken: {
instanceOf: "Token" instanceOf: "Token"
}, },
"MyToken2": { MyToken2: {
instanceOf: "Token", instanceOf: "Token",
args: [2000] args: [2000]
}, },
"AlreadyDeployedToken": { AlreadyDeployedToken: {
"address": "0xCAFECAFECAFECAFECAFECAFECAFECAFECAFECAFE", address: "0xCAFECAFECAFECAFECAFECAFECAFECAFECAFECAFE",
instanceOf: "Token" instanceOf: "Token"
}, },
"Test": { Test: {
onDeploy: [ onDeploy: ["Test.methods.changeAddress('$MyToken').send()"]
"Test.methods.changeAddress('$MyToken').send()"
]
}, },
"ContractArgs": { ContractArgs: {
"args": { args: {
"initialValue": 123, initialValue: 123,
"_addresses": ["$MyToken2", "$SimpleStorage"] _addresses: ["$MyToken2", "$SimpleStorage"]
} }
}, },
"SomeContract": { SomeContract: {
"args": [ args: [
["$MyToken2", "$SimpleStorage"], ["$MyToken2", "$SimpleStorage"],
100 100
] ]
} }
}; }
EmbarkSpec.deployAll(contractsConfig, () => { done() }); });
});
describe("Token", function () {
it("not deploy Token", function() { this.timeout(0);
assert.equal(Token.address, "");
}); it("not deploy Token", function () {
assert.strictEqual(Token.address, undefined);
it("not deploy MyToken and MyToken2", function() { });
assert.notEqual(MyToken.address, "");
assert.notEqual(MyToken2.address, ""); it("should deploy MyToken and MyToken2", function () {
}); assert.ok(MyToken.options.address);
assert.ok(MyToken2.options.address);
it("set MyToken Balance correctly", async function() { });
let result = await MyToken.methods._supply().call();
assert.equal(result, 1000); it("set MyToken Balance correctly", async function () {
}); let result = await MyToken.methods._supply().call();
assert.strictEqual(parseInt(result, 10), 1000);
it("set MyToken2 Balance correctly", async function() { });
let result = await MyToken2.methods._supply().call();
assert.equal(result, 2000); it("set MyToken2 Balance correctly", async function () {
}); let result = await MyToken2.methods._supply().call();
assert.strictEqual(parseInt(result, 10), 2000);
it("get right address", function() { });
assert.equal(AlreadyDeployedToken.address, "0xCAFECAFECAFECAFECAFECAFECAFECAFECAFECAFE");
}); it("get right address", function () {
assert.strictEqual(AlreadyDeployedToken.options.address.toLowerCase(),
it("should use onDeploy", async function() { "0xCAFECAFECAFECAFECAFECAFECAFECAFECAFECAFE".toLowerCase());
let result = await Test.methods.addr().call(); });
assert.equal(result, MyToken.address)
}); it("should use onDeploy", async function () {
let result = await Test.methods.addr().call();
assert.strictEqual(result, MyToken.options.address);
});
}); });