diff --git a/boilerplate/config/blockchain.json b/boilerplate/config/blockchain.json
index 3453a87d7..26c14fcce 100644
--- a/boilerplate/config/blockchain.json
+++ b/boilerplate/config/blockchain.json
@@ -12,7 +12,8 @@
"rpcCorsDomain": "http://localhost:8000",
"account": {
"password": "config/development/password"
- }
+ },
+ "wsOrigins": "http://localhost:8000"
},
"testnet": {
"enabled": true,
diff --git a/boilerplate/config/communication.json b/boilerplate/config/communication.json
index 07c7851aa..80ec2f80e 100644
--- a/boilerplate/config/communication.json
+++ b/boilerplate/config/communication.json
@@ -2,6 +2,11 @@
"default": {
"enabled": true,
"provider": "whisper",
- "available_providers": ["whisper", "orbit"]
+ "available_providers": ["whisper", "orbit"],
+ "connection": {
+ "host": "localhost",
+ "port": 8546,
+ "type": "ws"
+ }
}
}
diff --git a/boilerplate/config/contracts.json b/boilerplate/config/contracts.json
index f9bbf576f..f365b2137 100644
--- a/boilerplate/config/contracts.json
+++ b/boilerplate/config/contracts.json
@@ -1,5 +1,18 @@
{
"default": {
+ "versions": {
+ "web3.js": "1.0.0-beta",
+ "solc": "0.4.18"
+ },
+ "deployment": {
+ "host": "localhost",
+ "port": 8545,
+ "type": "rpc"
+ },
+ "dappConnection": [
+ "$WEB3",
+ "http://localhost:8545"
+ ],
"gas": "auto",
"contracts": {
}
diff --git a/boilerplate/config/storage.json b/boilerplate/config/storage.json
index f9516470b..f1041e849 100644
--- a/boilerplate/config/storage.json
+++ b/boilerplate/config/storage.json
@@ -11,6 +11,7 @@
"enabled": true,
"provider": "ipfs",
"host": "localhost",
- "port": 5001
+ "port": 5001,
+ "getUrl": "http://localhost:8080/ipfs/"
}
}
diff --git a/demo/app/contracts/simple_storage.sol b/demo/app/contracts/simple_storage.sol
index 13957b2de..9872d7782 100644
--- a/demo/app/contracts/simple_storage.sol
+++ b/demo/app/contracts/simple_storage.sol
@@ -1,16 +1,16 @@
-pragma solidity ^0.4.7;
+pragma solidity ^0.4.18;
contract SimpleStorage {
uint public storedData;
- function SimpleStorage(uint initialValue) {
+ function SimpleStorage(uint initialValue) public {
storedData = initialValue;
}
- function set(uint x) {
+ function set(uint x) public {
storedData = x;
}
- function get() constant returns (uint retVal) {
+ function get() public view returns (uint retVal) {
return storedData;
}
diff --git a/demo/config/blockchain.json b/demo/config/blockchain.json
index 0bc6ca2cc..18888bd89 100644
--- a/demo/config/blockchain.json
+++ b/demo/config/blockchain.json
@@ -12,7 +12,8 @@
"rpcCorsDomain": "http://localhost:8000",
"account": {
"password": "config/development/password"
- }
+ },
+ "wsOrigins": "http://localhost:8000"
},
"testnet": {
"enabled": true,
diff --git a/demo/config/communication.json b/demo/config/communication.json
index 07c7851aa..80ec2f80e 100644
--- a/demo/config/communication.json
+++ b/demo/config/communication.json
@@ -2,6 +2,11 @@
"default": {
"enabled": true,
"provider": "whisper",
- "available_providers": ["whisper", "orbit"]
+ "available_providers": ["whisper", "orbit"],
+ "connection": {
+ "host": "localhost",
+ "port": 8546,
+ "type": "ws"
+ }
}
}
diff --git a/demo/config/contracts.json b/demo/config/contracts.json
index b899cb0f1..41fa45739 100644
--- a/demo/config/contracts.json
+++ b/demo/config/contracts.json
@@ -1,5 +1,18 @@
{
"default": {
+ "versions": {
+ "web3.js": "1.0.0-beta",
+ "solc": "0.4.18"
+ },
+ "deployment": {
+ "host": "localhost",
+ "port": 8545,
+ "type": "rpc"
+ },
+ "dappConnection": [
+ "$WEB3",
+ "http://localhost:8545"
+ ],
"gas": "auto",
"contracts": {
"SimpleStorage": {
diff --git a/demo/config/storage.json b/demo/config/storage.json
index f9516470b..f1041e849 100644
--- a/demo/config/storage.json
+++ b/demo/config/storage.json
@@ -11,6 +11,7 @@
"enabled": true,
"provider": "ipfs",
"host": "localhost",
- "port": 5001
+ "port": 5001,
+ "getUrl": "http://localhost:8080/ipfs/"
}
}
diff --git a/docs/conf.py b/docs/conf.py
index 7bb0e679f..0e3adac19 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -58,9 +58,9 @@ author = u'Iuri Matias'
# built documents.
#
# The short X.Y version.
-version = u'2.5'
+version = u'2.6'
# The full version, including alpha/beta/rc tags.
-release = u'2.5.2'
+release = u'2.6.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/js/build/embark.bundle.js b/js/build/embark.bundle.js
index bef9ab49d..64f45b8c4 100644
--- a/js/build/embark.bundle.js
+++ b/js/build/embark.bundle.js
@@ -43,9 +43,6 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
-/******/ // identity function for calling harmony imports with the correct context
-/******/ __webpack_require__.i = function(value) { return value; };
-/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
@@ -100,6 +97,7 @@ EmbarkJS.isNewWeb3 = function() {
EmbarkJS.Contract = function(options) {
var self = this;
var i, abiElement;
+ var ContractClass;
this.abi = options.abi;
this.address = options.address;
@@ -110,14 +108,12 @@ EmbarkJS.Contract = function(options) {
// TODO:
// add default **from** address
// add gasPrice
- var ContractClass = new this.web3.eth.Contract(this.abi, this.address);
+ ContractClass = new this.web3.eth.Contract(this.abi, this.address);
ContractClass.setProvider(this.web3.currentProvider);
return ContractClass;
} else {
-
-
- var ContractClass = this.web3.eth.contract(this.abi);
+ ContractClass = this.web3.eth.contract(this.abi);
this.eventList = [];
@@ -444,7 +440,7 @@ EmbarkJS.Messages.setProvider = function(provider, options) {
var self = this;
var ipfs;
if (provider === 'whisper') {
- this.providerName = 'whisper'
+ this.providerName = 'whisper';
this.currentMessages = EmbarkJS.Messages.Whisper;
let provider;
if (options === undefined) {
@@ -473,7 +469,7 @@ EmbarkJS.Messages.setProvider = function(provider, options) {
self.currentMessages.whisperVersion = self.currentMessages.web3.version.whisper;
});
} else if (provider === 'orbit') {
- this.providerName = 'orbit'
+ this.providerName = 'orbit';
this.currentMessages = EmbarkJS.Messages.Orbit;
if (options === undefined) {
ipfs = HaadIpfsApi('localhost', '5001');
@@ -502,11 +498,12 @@ EmbarkJS.Messages.listenTo = function(options) {
EmbarkJS.Messages.Whisper = {};
EmbarkJS.Messages.Whisper.sendMessage = function(options) {
+ var topics, data, ttl, priority, payload;
if (EmbarkJS.Messages.isNewWeb3()) {
- var topics = options.topic || options.topics;
- var data = options.data || options.payload;
- var ttl = options.ttl || 100;
- var priority = options.priority || 1000;
+ topics = options.topic || options.topics;
+ data = options.data || options.payload;
+ ttl = options.ttl || 100;
+ priority = options.priority || 1000;
var powTime = options.powTime || 3;
var powTarget = options.powTarget || 0.5;
@@ -520,7 +517,7 @@ EmbarkJS.Messages.Whisper.sendMessage = function(options) {
topics = this.web3.utils.toHex(topics).slice(0, 10);
- var payload = JSON.stringify(data);
+ payload = JSON.stringify(data);
let message = {
symKeyID: this.symKeyID, // encrypts using the sym key ID
@@ -534,11 +531,11 @@ EmbarkJS.Messages.Whisper.sendMessage = function(options) {
this.web3.shh.post(message, function() { });
} else {
- var topics = options.topic || options.topics;
- var data = options.data || options.payload;
+ topics = options.topic || options.topics;
+ data = options.data || options.payload;
+ ttl = options.ttl || 100;
+ priority = options.priority || 1000;
var identity = options.identity || this.identity || web3.shh.newIdentity();
- var ttl = options.ttl || 100;
- var priority = options.priority || 1000;
var _topics;
if (topics === undefined) {
@@ -556,7 +553,7 @@ EmbarkJS.Messages.Whisper.sendMessage = function(options) {
}
topics = _topics;
- var payload = JSON.stringify(data);
+ payload = JSON.stringify(data);
var message;
message = {
@@ -567,13 +564,14 @@ EmbarkJS.Messages.Whisper.sendMessage = function(options) {
priority: priority
};
- return EmbarkJS.Messages.currentMessages.web3.shh.post(message, function() { console.log("message sent") });
+ return EmbarkJS.Messages.currentMessages.web3.shh.post(message, function() { });
}
};
EmbarkJS.Messages.Whisper.listenTo = function(options) {
+ var topics, _topics, messageEvents;
if (EmbarkJS.Messages.isNewWeb3()) {
- var messageEvents = function() {
+ messageEvents = function() {
this.cb = function() {};
};
@@ -589,8 +587,8 @@ EmbarkJS.Messages.Whisper.listenTo = function(options) {
this.filter.stopWatching();
};
- var topics = options.topic || options.topics;
- var _topics = [];
+ topics = options.topic || options.topics;
+ _topics = [];
let promise = new messageEvents();
@@ -621,10 +619,10 @@ EmbarkJS.Messages.Whisper.listenTo = function(options) {
return promise;
} else {
- var topics = options.topic || options.topics;
- var _topics = [];
+ topics = options.topic || options.topics;
+ _topics = [];
- var messageEvents = function() {
+ messageEvents = function() {
this.cb = function() {};
};
@@ -673,7 +671,7 @@ EmbarkJS.Messages.Whisper.listenTo = function(options) {
return promise;
}
-}
+};
EmbarkJS.Messages.Orbit = {};
diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js
index 57d87dc2d..5d8104c35 100644
--- a/lib/cmds/blockchain/geth_commands.js
+++ b/lib/cmds/blockchain/geth_commands.js
@@ -162,7 +162,9 @@ class GethCommands {
function whisper(callback) {
if (config.whisper) {
rpc_api.push('shh');
- ws_api.push('shh');
+ if (ws_api.indexOf('shh') === -1) {
+ ws_api.push('shh');
+ }
return callback(null, "--shh ");
}
callback("");
diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js
index 51b856ab8..3b73f4f68 100644
--- a/lib/contracts/code_generator.js
+++ b/lib/contracts/code_generator.js
@@ -28,28 +28,28 @@ class CodeGenerator {
let self = this;
// deprecated events; to remove in embark 2.7.0
- this.events.setCommandHandler('abi-vanila', function(cb) {
+ this.events.setCommandHandlerOnce('abi-vanila', function(cb) {
let vanillaABI = self.generateABI({useEmbarkJS: false});
let contractsJSON = self.generateContractsJSON();
cb(vanillaABI, contractsJSON);
});
- this.events.setCommandHandler('abi', function(cb) {
+ this.events.setCommandHandlerOnce('abi', function(cb) {
let embarkJSABI = self.generateABI({useEmbarkJS: true});
let contractsJSON = self.generateContractsJSON();
cb(embarkJSABI, contractsJSON);
});
- this.events.setCommandHandler('abi-contracts-vanila', function(cb) {
+ this.events.setCommandHandlerOnce('abi-contracts-vanila', function(cb) {
let vanillaContractsABI = self.generateContracts(false, true, false);
let contractsJSON = self.generateContractsJSON();
cb(vanillaContractsABI, contractsJSON);
});
- this.events.setCommandHandler('abi-vanila-deployment', function(cb) {
+ this.events.setCommandHandlerOnce('abi-vanila-deployment', function(cb) {
let vanillaABI = self.generateABI({useEmbarkJS: false, deployment: true});
let contractsJSON = self.generateContractsJSON();
@@ -57,35 +57,34 @@ class CodeGenerator {
});
// new events
- this.events.setCommandHandler('code-vanila', function(cb) {
+ this.events.setCommandHandlerOnce('code-vanila', function(cb) {
let vanillaABI = self.generateABI({useEmbarkJS: false});
let contractsJSON = self.generateContractsJSON();
cb(vanillaABI, contractsJSON);
});
- this.events.setCommandHandler('code', function(cb) {
+ this.events.setCommandHandlerOnce('code', function(cb) {
let embarkJSABI = self.generateABI({useEmbarkJS: true});
let contractsJSON = self.generateContractsJSON();
cb(embarkJSABI, contractsJSON);
});
- this.events.setCommandHandler('code-contracts-vanila', function(cb) {
+ this.events.setCommandHandlerOnce('code-contracts-vanila', function(cb) {
let vanillaContractsABI = self.generateContracts(false, true, false);
let contractsJSON = self.generateContractsJSON();
cb(vanillaContractsABI, contractsJSON);
});
- this.events.setCommandHandler('code-vanila-deployment', function(cb) {
+ this.events.setCommandHandlerOnce('code-vanila-deployment', function(cb) {
let vanillaABI = self.generateABI({useEmbarkJS: false, deployment: true});
let contractsJSON = self.generateContractsJSON();
cb(vanillaABI, contractsJSON);
});
-
}
generateProvider(isDeployment) {
@@ -222,8 +221,6 @@ class CodeGenerator {
result += Templates.exec_when_env_loaded({block: block});
}
- console.log(result);
-
return result;
}
diff --git a/lib/core/config.js b/lib/core/config.js
index 9ea787ee0..9e2a7fd0c 100644
--- a/lib/core/config.js
+++ b/lib/core/config.js
@@ -79,7 +79,7 @@ Config.prototype.loadContractsConfigFile = function() {
var configObject = {
"versions": {
"web3.js": "0.19.1",
- "solc": "0.4.17"
+ "solc": "0.4.18"
},
"deployment": {
"host": "localhost",
diff --git a/lib/core/events.js b/lib/core/events.js
index 425574e91..f7f055fc8 100644
--- a/lib/core/events.js
+++ b/lib/core/events.js
@@ -42,4 +42,11 @@ EventEmitter.prototype.setCommandHandler = function(requestName, cb) {
});
};
+EventEmitter.prototype.setCommandHandlerOnce = function(requestName, cb) {
+ log("setting command handler for: ", requestName);
+ return this.once('request:' + requestName, function(_cb) {
+ cb.call(this, _cb);
+ });
+};
+
module.exports = EventEmitter;
diff --git a/package.json b/package.json
index c51cfcf99..17d64be89 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "2.6.0",
"description": "Embark is a framework that allows you to easily develop and deploy DApps",
"scripts": {
- "test": "grunt jshint && mocha test/ --no-timeouts"
+ "test": "grunt jshint && mocha test/ --no-timeouts && cd test_app/ && npm install && ../bin/embark test"
},
"bin": {
"embark": "./bin/embark"
@@ -33,7 +33,7 @@
"promptly": "^2.1.0",
"serve-static": "^1.11.1",
"shelljs": "^0.5.0",
- "solc": "0.4.17",
+ "solc": "0.4.18",
"tar": "^3.1.5",
"toposort": "^1.0.0",
"underscore": "^1.8.3",
diff --git a/test_app/app/contracts/another_storage.sol b/test_app/app/contracts/another_storage.sol
index e00c236a6..d8e0a1a81 100644
--- a/test_app/app/contracts/another_storage.sol
+++ b/test_app/app/contracts/another_storage.sol
@@ -1,9 +1,9 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
contract AnotherStorage {
address public simpleStorageAddress;
address simpleStorageAddress2;
- function AnotherStorage(address addr) {
+ function AnotherStorage(address addr) public {
simpleStorageAddress = addr;
}
diff --git a/test_app/app/contracts/ownable.sol b/test_app/app/contracts/ownable.sol
index 640f1e4c8..097df9951 100644
--- a/test_app/app/contracts/ownable.sol
+++ b/test_app/app/contracts/ownable.sol
@@ -1,4 +1,4 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
/**
* @title Ownable
@@ -13,7 +13,7 @@ contract Ownable {
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
- function Ownable() {
+ function Ownable() public {
owner = msg.sender;
}
@@ -23,7 +23,7 @@ contract Ownable {
*/
modifier onlyOwner() {
if (msg.sender != owner) {
- throw;
+ revert();
}
_;
}
@@ -33,7 +33,7 @@ contract Ownable {
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
- function transferOwnership(address newOwner) onlyOwner {
+ function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
diff --git a/test_app/app/contracts/simple_storage.sol b/test_app/app/contracts/simple_storage.sol
index 2a243a77f..2682a7e4d 100644
--- a/test_app/app/contracts/simple_storage.sol
+++ b/test_app/app/contracts/simple_storage.sol
@@ -1,29 +1,29 @@
-pragma solidity ^0.4.7;
+pragma solidity ^0.4.18;
import "ownable.sol";
contract SimpleStorage is Ownable {
uint public storedData;
- function() payable { }
+ function() public payable { }
- function SimpleStorage(uint initialValue) {
+ function SimpleStorage(uint initialValue) public {
storedData = initialValue;
}
- function set(uint x) {
+ function set(uint x) public {
storedData = x;
}
- function set2(uint x, uint unusedGiveWarning) onlyOwner {
+ function set2(uint x, uint unusedGiveWarning) public onlyOwner {
storedData = x;
}
- function get() constant returns (uint retVal) {
+ function get() public view returns (uint retVal) {
return storedData;
}
- function getS() constant returns (string d) {
+ function getS() public pure returns (string d) {
return "hello";
}
diff --git a/test_app/app/contracts/test.sol b/test_app/app/contracts/test.sol
index da76aa297..f1523673f 100644
--- a/test_app/app/contracts/test.sol
+++ b/test_app/app/contracts/test.sol
@@ -1,8 +1,8 @@
-pragma solidity ^0.4.11;
+pragma solidity ^0.4.18;
library ZAMyLib {
- function add(uint _a, uint _b) returns (uint _c) {
+ function add(uint _a, uint _b) public pure returns (uint _c) {
return _a + _b;
}
@@ -10,7 +10,7 @@ library ZAMyLib {
contract Test {
- function testAdd() constant returns (uint _result) {
+ function testAdd() public pure returns (uint _result) {
return ZAMyLib.add(1, 2);
}
diff --git a/test_app/app/contracts/token.sol b/test_app/app/contracts/token.sol
index 0eff9e71b..fc92206a8 100644
--- a/test_app/app/contracts/token.sol
+++ b/test_app/app/contracts/token.sol
@@ -1,6 +1,6 @@
// https://github.com/nexusdev/erc20/blob/master/contracts/base.sol
-pragma solidity ^0.4.2;
+pragma solidity ^0.4.18;
contract Token {
event Transfer(address indexed from, address indexed to, uint value);
@@ -10,39 +10,39 @@ contract Token {
mapping( address => mapping( address => uint ) ) _approvals;
uint public _supply;
//uint public _supply2;
- function Token( uint initial_balance ) {
+ function Token( uint initial_balance ) public {
_balances[msg.sender] = initial_balance;
_supply = initial_balance;
}
- function totalSupply() constant returns (uint supply) {
+ function totalSupply() public constant returns (uint supply) {
return _supply;
}
- function balanceOf( address who ) constant returns (uint value) {
+ function balanceOf( address who ) public constant returns (uint value) {
return _balances[who];
}
- function transfer( address to, uint value) returns (bool ok) {
+ function transfer( address to, uint value) public returns (bool ok) {
if( _balances[msg.sender] < value ) {
- throw;
+ revert();
}
if( !safeToAdd(_balances[to], value) ) {
- throw;
+ revert();
}
_balances[msg.sender] -= value;
_balances[to] += value;
Transfer( msg.sender, to, value );
return true;
}
- function transferFrom( address from, address to, uint value) returns (bool ok) {
+ function transferFrom( address from, address to, uint value) public returns (bool ok) {
// if you don't have enough balance, throw
if( _balances[from] < value ) {
- throw;
+ revert();
}
// if you don't have approval, throw
if( _approvals[from][msg.sender] < value ) {
- throw;
+ revert();
}
if( !safeToAdd(_balances[to], value) ) {
- throw;
+ revert();
}
// transfer and return true
_approvals[from][msg.sender] -= value;
@@ -51,16 +51,16 @@ contract Token {
Transfer( from, to, value );
return true;
}
- function approve(address spender, uint value) returns (bool ok) {
+ function approve(address spender, uint value) public returns (bool ok) {
// TODO: should increase instead
_approvals[msg.sender][spender] = value;
Approval( msg.sender, spender, value );
return true;
}
- function allowance(address owner, address spender) constant returns (uint _allowance) {
+ function allowance(address owner, address spender) public constant returns (uint _allowance) {
return _approvals[owner][spender];
}
- function safeToAdd(uint a, uint b) internal returns (bool) {
+ function safeToAdd(uint a, uint b) internal pure returns (bool) {
return (a + b >= a);
}
}
diff --git a/test_app/app/js/test.js b/test_app/app/js/test.js
index ad51fa254..a4ba623cb 100644
--- a/test_app/app/js/test.js
+++ b/test_app/app/js/test.js
@@ -1,53 +1,56 @@
$(document).ready(function() {
- async.waterfall([
- function test1(callback) {
- AnotherStorage.simpleStorageAddress().then(function(simpleStorageAddress) {
- $("#tests").append("
test 1: " + (simpleStorageAddress === SimpleStorage.address));
- callback();
- });
- },
- function test2(callback) {
- SimpleStorage.storedData().then(function(result) {
- $("#tests").append("
test 2 (true first time): " + (result.toNumber() === 100));
- $("#tests").append("
test 2 (true after): " + (result.toNumber() === 150));
- callback();
- });
- },
- function test3(callback) {
- SimpleStorage.set(150).then(function() {
- SimpleStorage.get().then(function(result) {
- $("#tests").append("
test 3: " + (result.toNumber() === 150));
+ document.getElementById("runTests").onclick = function() {
+ async.waterfall([
+ function test1(callback) {
+ AnotherStorage.methods.simpleStorageAddress().call().then(function(simpleStorageAddress) {
+ $("#tests").append("
test 1: " + (simpleStorageAddress === SimpleStorage._address));
callback();
});
- });
- },
- function test4(callback) {
- $("#tests").append("
test 4: " + (Token.address === "undefined"));
- $("#tests").append("
test 4: " + (MyToken.address !== undefined));
- $("#tests").append("
test 4: " + (MyToken2.address !== undefined));
- callback();
- },
- function test5(callback) {
- MyToken._supply().then(function(result) {
- $("#tests").append("
test 5: " + (result.toNumber() === 1000));
+ },
+ function test2(callback) {
+ SimpleStorage.methods.storedData().call().then(function(result) {
+ $("#tests").append("
test 2 (true first time): " + (result === "100"));
+ $("#tests").append("
test 2 (true after): " + (result === "150"));
+ callback();
+ });
+ },
+ function test3(callback) {
+ SimpleStorage.methods.set(150).send({from: web3.eth.defaultAccount}).then(function() {
+ SimpleStorage.methods.get().call().then(function(result) {
+ $("#tests").append("
test 3: " + (result === "150"));
+ callback();
+ });
+ });
+ },
+ function test4(callback) {
+ $("#tests").append("
test 4: " + (Token._address === null));
+ $("#tests").append("
test 4: " + (MyToken._address !== undefined));
+ $("#tests").append("
test 4: " + (MyToken2._address !== undefined));
callback();
- });
- },
- function test6(callback) {
- MyToken2._supply().then(function(result) {
- $("#tests").append("
test 6: " + (result.toNumber() === 2000));
+ },
+ function test5(callback) {
+ MyToken.methods._supply().call().then(function(result) {
+ $("#tests").append("
test 5: " + (result === "1000"));
+ callback();
+ });
+ },
+ function test6(callback) {
+ MyToken2.methods._supply().call().then(function(result) {
+ $("#tests").append("
test 6: " + (result === "2000"));
+ callback();
+ });
+ },
+ function test7(callback) {
+ $("#tests").append("
test 7: " + (AlreadyDeployedToken._address === "0xeCE374063fE5Cc7EFbACA0a498477CaDA94E5AD6"));
callback();
- });
- },
- function test7(callback) {
- $("#tests").append("
test 7: " + (AlreadyDeployedToken.address === "0x123"));
- callback();
- }
- ], function (err, result) {
+ }
+ ], function (err, result) {
$("#tests").append("
done");
- });
+ });
+
+ };
});
diff --git a/test_app/app/test.html b/test_app/app/test.html
index 2fcceb298..ee41604a3 100644
--- a/test_app/app/test.html
+++ b/test_app/app/test.html
@@ -6,6 +6,7 @@