-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtestdeploy.js
More file actions
53 lines (38 loc) · 1.92 KB
/
testdeploy.js
File metadata and controls
53 lines (38 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var WonkaEngine = artifacts.require("./WonkaEngine.sol");
var OrchTestContract = artifacts.require("./OrchTestContract.sol");
var WonkaRegistry = artifacts.require("./WonkaRegistry.sol");
var WonkaTransactionState = artifacts.require("./WonkaTransactionState.sol");
// NOTE: in mist web3 is already available, so check first if it's available before instantiating
// var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545"));
var version = web3.version.api;
console.log("Web3 version is now (" + version + ")");
contract('WonkaEngine', function(accounts) {
contract('OrchTestContract', function(accounts) {
contract('WonkaRegistry', function(accounts) {
contract('WonkaTransactionState', function(accounts) {
it("should be 3 attributes stored in the engine", function() {
return WonkaEngine.deployed().then(function(wInstance) {
return OrchTestContract.deployed().then(function(tInstance) {
return WonkaRegistry.deployed().then(function(rInstance) {
return WonkaTransactionState.deployed().then(function(xInstance) {
xInstance.setOwner(accounts[0], 100);
xInstance.setExecutor(accounts[0]);
xInstance.addConfirmation(accounts[0]);
xInstance.setMinScoreRequirement(1);
console.log("Address of WonkaEngine is (" + wInstance.address + ")");
console.log("Address of OrchTestContract is (" + tInstance.address + ")");
console.log("Address of WonkaRegistry is (" + rInstance.address + ")");
console.log("Address of WonkaTransactionState is (" + xInstance.address + ")");
return wInstance.getNumberOfAttributes.call();
}).then(function(balance) {
assert.equal(balance.valueOf(), 3, "More or less than 3 attributes populated");
});
});
});
});
});
});
});
});
});