From f7d40e3cb72f4af5b6615763f8cc0b0775b9967a Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 30 Oct 2016 08:49:43 -0400 Subject: [PATCH 01/15] update to 2.1.3 --- boilerplate/package.json | 2 +- demo/package.json | 2 +- lib/cmd.js | 2 +- lib/services.js | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boilerplate/package.json b/boilerplate/package.json index 7fd1f3dcd..0636ae3a9 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.1.2", + "embark": "^2.1.3", "mocha": "^2.2.5" } } diff --git a/demo/package.json b/demo/package.json index 7fd1f3dcd..0636ae3a9 100644 --- a/demo/package.json +++ b/demo/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.1.2", + "embark": "^2.1.3", "mocha": "^2.2.5" } } diff --git a/lib/cmd.js b/lib/cmd.js index 781737589..9cc9ac88a 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -3,7 +3,7 @@ var colors = require('colors'); var Cmd = function(Embark) { this.Embark = Embark; - program.version('2.1.2'); + program.version('2.1.3'); }; Cmd.prototype.process = function(args) { diff --git a/lib/services.js b/lib/services.js index 5e4f2f504..3144285c6 100644 --- a/lib/services.js +++ b/lib/services.js @@ -28,7 +28,7 @@ ServicesMonitor.prototype.check = function() { }, function addEmbarkVersion(web3, result, callback) { self.logger.trace('addEmbarkVersion'); - result.push('Embark 2.1.2'.green); + result.push('Embark 2.1.3'.green); callback(null, web3, result); }, function checkEthereum(web3, result, callback) { diff --git a/package.json b/package.json index b20579327..ce8f13091 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.1.2", + "version": "2.1.3", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "test": "grunt jshint && mocha test/ --no-timeouts" From d8fcd3d09f556f232b44c37eaa90991857bb9cdc Mon Sep 17 00:00:00 2001 From: Jonathan Brown Date: Thu, 3 Nov 2016 17:31:12 +0700 Subject: [PATCH 02/15] require('embark-framework') => require('embark') --- README.md | 2 +- boilerplate/test/contract_spec.js | 2 +- demo/test/simple_storage_spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1e0e014b..0bef07fd5 100644 --- a/README.md +++ b/README.md @@ -384,7 +384,7 @@ Embark includes a testing lib to fastly run & test your contracts in a EVM. # test/simple_storage_spec.js var assert = require('assert'); -var Embark = require('embark-framework'); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/boilerplate/test/contract_spec.js b/boilerplate/test/contract_spec.js index d17d31bdc..ec1b87383 100644 --- a/boilerplate/test/contract_spec.js +++ b/boilerplate/test/contract_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark-framework'); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/demo/test/simple_storage_spec.js b/demo/test/simple_storage_spec.js index c887fe783..83ad1610f 100644 --- a/demo/test/simple_storage_spec.js +++ b/demo/test/simple_storage_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark-framework'); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; From e3ba77d6b9cd540da73ce1ae5f404b6be537c725 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 3 Nov 2016 07:57:56 -0400 Subject: [PATCH 03/15] use solc 0.4.4 or later --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce8f13091..03cd57b66 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "merge": "^1.2.0", "meteor-build-client": "^0.1.6", "mkdirp": "^0.5.1", - "solc": "^0.4.0", + "solc": "^0.4.4", "read-yaml": "^1.0.0", "request": "^2.75.0", "serve-static": "^1.11.1", From 1681ba9e86ba91564bb16d050188141bad00c0dd Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 3 Nov 2016 08:09:07 -0400 Subject: [PATCH 04/15] update to 2.1.4 --- boilerplate/package.json | 2 +- demo/package.json | 2 +- lib/cmd.js | 2 +- lib/services.js | 2 +- package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boilerplate/package.json b/boilerplate/package.json index 0636ae3a9..a315d360a 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.1.3", + "embark": "^2.1.4", "mocha": "^2.2.5" } } diff --git a/demo/package.json b/demo/package.json index 0636ae3a9..a315d360a 100644 --- a/demo/package.json +++ b/demo/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.1.3", + "embark": "^2.1.4", "mocha": "^2.2.5" } } diff --git a/lib/cmd.js b/lib/cmd.js index 9cc9ac88a..91dcf3142 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -3,7 +3,7 @@ var colors = require('colors'); var Cmd = function(Embark) { this.Embark = Embark; - program.version('2.1.3'); + program.version('2.1.4'); }; Cmd.prototype.process = function(args) { diff --git a/lib/services.js b/lib/services.js index 3144285c6..f8c21d163 100644 --- a/lib/services.js +++ b/lib/services.js @@ -28,7 +28,7 @@ ServicesMonitor.prototype.check = function() { }, function addEmbarkVersion(web3, result, callback) { self.logger.trace('addEmbarkVersion'); - result.push('Embark 2.1.3'.green); + result.push('Embark 2.1.4'.green); callback(null, web3, result); }, function checkEthereum(web3, result, callback) { diff --git a/package.json b/package.json index 03cd57b66..6158b8049 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.1.3", + "version": "2.1.4", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "test": "grunt jshint && mocha test/ --no-timeouts" From 48c72ab257ba4559539aed91697f2c28aa85a236 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 9 Mar 2017 06:46:11 -0500 Subject: [PATCH 05/15] remove inconsistent file between master and develop --- lib/services.js | 75 ------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 lib/services.js diff --git a/lib/services.js b/lib/services.js deleted file mode 100644 index f8c21d163..000000000 --- a/lib/services.js +++ /dev/null @@ -1,75 +0,0 @@ -var Web3 = require('web3'); -var async = require('async'); -var request = require('request'); - -var ServicesMonitor = function(options) { - this.logger = options.logger; - this.interval = options.interval || 5000; - this.config = options.config; - this.serverPort = options.serverPort || 8000; -}; - -ServicesMonitor.prototype.startMonitor = function() { - this.monitor = setInterval(this.check.bind(this), this.interval); -}; - -ServicesMonitor.prototype.stopMonitor = function() { -}; - -ServicesMonitor.prototype.check = function() { - var self = this; - async.waterfall([ - function connectWeb3(callback) { - self.logger.trace('connectWeb3'); - var web3 = new Web3(); - var web3Endpoint = 'http://' + self.config.blockchainConfig.rpcHost + ':' + self.config.blockchainConfig.rpcPort; - web3.setProvider(new web3.providers.HttpProvider(web3Endpoint)); - callback(null, web3, []); - }, - function addEmbarkVersion(web3, result, callback) { - self.logger.trace('addEmbarkVersion'); - result.push('Embark 2.1.4'.green); - callback(null, web3, result); - }, - function checkEthereum(web3, result, callback) { - self.logger.trace('checkEthereum'); - var service; - if (web3.isConnected()) { - service = (web3.version.node.split("/")[0] + " (Ethereum)").green; - } else { - service = "No Blockchain node found".red; - } - result.push(service); - callback(null, web3, result); - }, - function checkWhisper(web3, result, callback) { - self.logger.trace('checkWhisper'); - web3.version.getWhisper(function(err, res) { - var service = 'whisper'; - result.push(err ? service.red : service.green); - callback(null, result); - }); - }, - function checkIPFS(result, callback) { - self.logger.trace('checkIPFS'); - - request('http://localhost:5001', function(error, response, body) { - if (error) { - result.push('IPFS'.red); - } else { - result.push('IPFS'.green); - } - callback(null, result); - }); - }, - function checkDevServer(result, callback) { - self.logger.trace('checkDevServer'); - result.push(('dev server (http://localhost:' + self.serverPort + ')').green); - callback(null, result); - } - ], function(err, result) { - self.logger.availableServices(result); - }); -}; - -module.exports = ServicesMonitor; From 8327725c3b19520d31b167a1d330299c275ea755 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 12 Mar 2017 20:47:07 -0400 Subject: [PATCH 06/15] fix broken js generation on asset change: (temporarily) revert change to not deploy on asset change and force redeploy of everything --- lib/core/engine.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/core/engine.js b/lib/core/engine.js index 872d8fc7a..db6305712 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -76,13 +76,15 @@ Engine.prototype.pipelineService = function(options) { pipeline.build(abi); self.events.emit('outputDone'); }); - this.events.on('file-event', function(fileType, path) { - if (fileType === 'asset') { - self.config.reloadConfig(); - pipeline.build(self.abi, path); - self.events.emit('outputDone'); - } - }); + // TODO: still need to redeploy contracts because the original contracts + // config is being corrupted + //this.events.on('file-event', function(fileType, path) { + // if (fileType === 'asset') { + // self.config.reloadConfig(); + // pipeline.build(self.abi, path); + // self.events.emit('outputDone'); + // } + //}); }; Engine.prototype.abiService = function(options) { @@ -119,10 +121,12 @@ Engine.prototype.deploymentService = function(options) { }); this.events.on('file-event', function(fileType, path) { - if (fileType === 'contract' || fileType === 'config') { + // TODO: for now need to deploy on asset chanes as well + // because the contractsManager config is corrupted after a deploy + //if (fileType === 'contract' || fileType === 'config') { self.config.reloadConfig(); self.deployManager.deployContracts(function() {}); - } + //} }); }; From b2c0c8f3553703d8d499b14fbe8f5f8bf0ddca10 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 12 Mar 2017 20:51:34 -0400 Subject: [PATCH 07/15] update to 2.4.1 --- boilerplate/package.json | 2 +- demo/package.json | 2 +- docs/conf.py | 2 +- lib/core/engine.js | 2 +- lib/dashboard/monitor.js | 2 +- lib/index.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boilerplate/package.json b/boilerplate/package.json index ebd650e94..b5f371257 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -9,7 +9,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.4.0", + "embark": "^2.4.1", "mocha": "^2.2.5" } } diff --git a/demo/package.json b/demo/package.json index 2d3815944..d955d134d 100644 --- a/demo/package.json +++ b/demo/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.4.0", + "embark": "^2.4.1", "mocha": "^2.2.5" } } diff --git a/docs/conf.py b/docs/conf.py index 7af4b190a..9c30e7271 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ author = u'Iuri Matias' # The short X.Y version. version = u'2.4' # The full version, including alpha/beta/rc tags. -release = u'2.4.0' +release = u'2.4.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/lib/core/engine.js b/lib/core/engine.js index db6305712..f706130df 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -14,7 +14,7 @@ var Engine = function(options) { this.env = options.env; this.embarkConfig = options.embarkConfig; this.interceptLogs = options.interceptLogs; - this.version = "2.4.0"; + this.version = "2.4.1"; }; Engine.prototype.init = function(_options) { diff --git a/lib/dashboard/monitor.js b/lib/dashboard/monitor.js index 5468128ba..d6035d721 100644 --- a/lib/dashboard/monitor.js +++ b/lib/dashboard/monitor.js @@ -4,7 +4,7 @@ var blessed = require("blessed"); var CommandHistory = require('./command_history.js'); function Dashboard(options) { - var title = (options && options.title) || "Embark 2.4.0"; + var title = (options && options.title) || "Embark 2.4.1"; this.env = options.env; this.console = options.console; this.history = new CommandHistory(); diff --git a/lib/index.js b/lib/index.js index 97877acb5..fbf4d95ac 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,7 +25,7 @@ var Cmd = require('./cmd.js'); var Embark = { - version: '2.4.0', + version: '2.4.1', process: function(args) { var cmd = new Cmd(Embark); From 3490083f23be2d48082437f9afae452a04b18812 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 12 Mar 2017 20:53:50 -0400 Subject: [PATCH 08/15] update to 2.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 06833395b..eed769485 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.4.0", + "version": "2.4.1", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "test": "grunt jshint && mocha test/ --no-timeouts" From 5a8304dd359b08c80f403f9a3ff097a058ba4b00 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 4 Apr 2017 08:17:17 -0400 Subject: [PATCH 09/15] fix for metamask integration; --- js/build/embark.bundle.js | 2 +- js/embark.js | 2 +- lib/contracts/abi.js | 21 +++++++++++++++++++++ test/abi.js | 6 +++--- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/js/build/embark.bundle.js b/js/build/embark.bundle.js index eed9d3d46..6556a58d4 100644 --- a/js/build/embark.bundle.js +++ b/js/build/embark.bundle.js @@ -282,7 +282,7 @@ var EmbarkJS = var ipfs; if (provider === 'whisper') { this.currentMessages = EmbarkJS.Messages.Whisper; - if (typeof variable === 'undefined') { + if (typeof variable === 'undefined' && typeof(web3) === 'undefined') { if (options === undefined) { web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); } else { diff --git a/js/embark.js b/js/embark.js index 93b7e39fe..d9aba4ac1 100644 --- a/js/embark.js +++ b/js/embark.js @@ -235,7 +235,7 @@ EmbarkJS.Messages.setProvider = function(provider, options) { var ipfs; if (provider === 'whisper') { this.currentMessages = EmbarkJS.Messages.Whisper; - if (typeof variable === 'undefined') { + if (typeof variable === 'undefined' && typeof(web3) === 'undefined') { if (options === undefined) { web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); } else { diff --git a/lib/contracts/abi.js b/lib/contracts/abi.js index 479b9f771..95c444855 100644 --- a/lib/contracts/abi.js +++ b/lib/contracts/abi.js @@ -18,6 +18,14 @@ ABIGenerator.prototype.generateProvider = function() { return ""; } + result += "\nvar whenEnvIsLoaded = function(cb) {"; + result += "\n if (typeof window !== 'undefined' && window !== null) {"; + result += "\n window.addEventListener('load', cb);"; + result += "\n } else {"; + result += "\n cb();"; + result += "\n }"; + result += "\n}"; + if (this.plugins) { providerPlugins = this.plugins.getPluginsFor('clientWeb3Provider'); } @@ -27,12 +35,14 @@ ABIGenerator.prototype.generateProvider = function() { result += plugin.generateProvider(self) + "\n"; }); } else { + result += "\nwhenEnvIsLoaded(function() {"; result += "\nif (typeof web3 !== 'undefined' && typeof Web3 !== 'undefined') {"; result += '\n\tweb3 = new Web3(web3.currentProvider);'; result += "\n} else if (typeof Web3 !== 'undefined') {"; result += '\n\tweb3 = new Web3(new Web3.providers.HttpProvider("http://' + this.rpcHost + ':' + this.rpcPort + '"));'; result += '\n}'; result += "\nweb3.eth.defaultAccount = web3.eth.accounts[0];"; + result += '\n})'; } return result; @@ -62,6 +72,16 @@ ABIGenerator.prototype.generateContracts = function(useEmbarkJS) { var abi = JSON.stringify(contract.abiDefinition); var gasEstimates = JSON.stringify(contract.gasEstimates); + // TODO: refactor this + result += "\nvar whenEnvIsLoaded = function(cb) {"; + result += "\n if (typeof window !== 'undefined' && window !== null) {"; + result += "\n window.addEventListener('load', cb);"; + result += "\n } else {"; + result += "\n cb();"; + result += "\n }"; + result += "\n}"; + + result += "\nwhenEnvIsLoaded(function() {"; if (useEmbarkJS) { result += "\n" + className + " = new EmbarkJS.Contract({abi: " + abi + ", address: '" + contract.deployedAddress + "', code: '" + contract.code + "', gasEstimates: " + gasEstimates + "});"; } else { @@ -69,6 +89,7 @@ ABIGenerator.prototype.generateContracts = function(useEmbarkJS) { result += "\n" + className + "Contract = web3.eth.contract(" + className + "Abi);"; result += "\n" + className + " = " + className + "Contract.at('" + contract.deployedAddress + "');"; } + result += '\n});'; } } diff --git a/test/abi.js b/test/abi.js index 4d2533ba3..05a443d31 100644 --- a/test/abi.js +++ b/test/abi.js @@ -10,7 +10,7 @@ describe('embark.ABIGenerator', function() { var generator = new ABIGenerator({blockchainConfig: {rpcHost: 'somehost', rpcPort: '1234'}, contractsManager: {}}); it('should generate code to connect to a provider', function() { - var providerCode = "\nif (typeof web3 !== 'undefined' && typeof Web3 !== 'undefined') {\n\tweb3 = new Web3(web3.currentProvider);\n} else if (typeof Web3 !== 'undefined') {\n\tweb3 = new Web3(new Web3.providers.HttpProvider(\"http://somehost:1234\"));\n}\nweb3.eth.defaultAccount = web3.eth.accounts[0];"; + var providerCode = "\nvar whenEnvIsLoaded = function(cb) {\n if (typeof window !== 'undefined' && window !== null) {\n window.addEventListener('load', cb);\n } else {\n cb();\n }\n}\nwhenEnvIsLoaded(function() {\nif (typeof web3 !== 'undefined' && typeof Web3 !== 'undefined') {\n\tweb3 = new Web3(web3.currentProvider);\n} else if (typeof Web3 !== 'undefined') {\n\tweb3 = new Web3(new Web3.providers.HttpProvider(\"http://somehost:1234\"));\n}\nweb3.eth.defaultAccount = web3.eth.accounts[0];\n})" assert.equal(generator.generateProvider(), providerCode); }); @@ -38,7 +38,7 @@ describe('embark.ABIGenerator', function() { var withEmbarkJS = true; it('should generate contract code', function() { - var contractCode = "\n\nSimpleStorage = new EmbarkJS.Contract({abi: [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}], address: '0x123', code: '12345', gasEstimates: 12000});\nFoo = new EmbarkJS.Contract({abi: [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}], address: '0x124', code: '123456', gasEstimates: 12000});"; + var contractCode = "\n\nwhenEnvIsLoaded(function() {\nSimpleStorage = new EmbarkJS.Contract({abi: [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}], address: '0x123', code: '12345', gasEstimates: 12000});\n});\nwhenEnvIsLoaded(function() {\nFoo = new EmbarkJS.Contract({abi: [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}], address: '0x124', code: '123456', gasEstimates: 12000});\n});"; assert.equal(generator.generateContracts(withEmbarkJS), contractCode); }); }); @@ -47,7 +47,7 @@ describe('embark.ABIGenerator', function() { var withEmbarkJS = false; it('should generate contract code', function() { - var contractCode = "\n\nSimpleStorageAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nSimpleStorageContract = web3.eth.contract(SimpleStorageAbi);\nSimpleStorage = SimpleStorageContract.at('0x123');\nFooAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nFooContract = web3.eth.contract(FooAbi);\nFoo = FooContract.at('0x124');"; + var contractCode = "\n\nwhenEnvIsLoaded(function() {\nSimpleStorageAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nSimpleStorageContract = web3.eth.contract(SimpleStorageAbi);\nSimpleStorage = SimpleStorageContract.at('0x123');\n});\nwhenEnvIsLoaded(function() {\nFooAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"storedData\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"retVal\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"initialValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}];\nFooContract = web3.eth.contract(FooAbi);\nFoo = FooContract.at('0x124');\n});"; assert.equal(generator.generateContracts(withEmbarkJS), contractCode); }); }); From cfc75c361904970724045d2cc4e07048f0996f25 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 4 Apr 2017 08:19:52 -0400 Subject: [PATCH 10/15] update to 2.4.2 --- boilerplate/package.json | 2 +- demo/package.json | 2 +- docs/conf.py | 2 +- lib/core/engine.js | 2 +- lib/dashboard/monitor.js | 2 +- lib/index.js | 2 +- package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/boilerplate/package.json b/boilerplate/package.json index b5f371257..4802dec8c 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -9,7 +9,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.4.1", + "embark": "^2.4.2", "mocha": "^2.2.5" } } diff --git a/demo/package.json b/demo/package.json index d955d134d..e169030b6 100644 --- a/demo/package.json +++ b/demo/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.4.1", + "embark": "^2.4.2", "mocha": "^2.2.5" } } diff --git a/docs/conf.py b/docs/conf.py index 9c30e7271..6cfd371b7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ author = u'Iuri Matias' # The short X.Y version. version = u'2.4' # The full version, including alpha/beta/rc tags. -release = u'2.4.1' +release = u'2.4.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/lib/core/engine.js b/lib/core/engine.js index f706130df..730ca3470 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -14,7 +14,7 @@ var Engine = function(options) { this.env = options.env; this.embarkConfig = options.embarkConfig; this.interceptLogs = options.interceptLogs; - this.version = "2.4.1"; + this.version = "2.4.2"; }; Engine.prototype.init = function(_options) { diff --git a/lib/dashboard/monitor.js b/lib/dashboard/monitor.js index d6035d721..54a262ab0 100644 --- a/lib/dashboard/monitor.js +++ b/lib/dashboard/monitor.js @@ -4,7 +4,7 @@ var blessed = require("blessed"); var CommandHistory = require('./command_history.js'); function Dashboard(options) { - var title = (options && options.title) || "Embark 2.4.1"; + var title = (options && options.title) || "Embark 2.4.2"; this.env = options.env; this.console = options.console; this.history = new CommandHistory(); diff --git a/lib/index.js b/lib/index.js index fbf4d95ac..b06ad4c60 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,7 +25,7 @@ var Cmd = require('./cmd.js'); var Embark = { - version: '2.4.1', + version: '2.4.2', process: function(args) { var cmd = new Cmd(Embark); diff --git a/package.json b/package.json index eed769485..d9ff11322 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.4.1", + "version": "2.4.2", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "test": "grunt jshint && mocha test/ --no-timeouts" From ecab599d003eb4ae9eb43e02f4ee7411f4509aa7 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 16 Jul 2017 12:10:17 -0400 Subject: [PATCH 11/15] detect and replace library references with address --- boilerplate/config/development/genesis.json | 4 +++- demo/config/development/genesis.json | 4 +++- lib/contracts/compiler.js | 3 +++ lib/contracts/contracts.js | 1 + lib/contracts/deploy.js | 16 +++++++++++++++- test_app/app/contracts/test.sol | 17 +++++++++++++++++ test_app/config/development/genesis.json | 4 +++- 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 test_app/app/contracts/test.sol diff --git a/boilerplate/config/development/genesis.json b/boilerplate/config/development/genesis.json index 8df404021..4a50a438b 100644 --- a/boilerplate/config/development/genesis.json +++ b/boilerplate/config/development/genesis.json @@ -1,5 +1,7 @@ { - "config": {}, + "config": { + "homesteadBlock": 1 + }, "nonce": "0x0000000000000042", "difficulty": "0x0", "alloc": { diff --git a/demo/config/development/genesis.json b/demo/config/development/genesis.json index 8df404021..4a50a438b 100644 --- a/demo/config/development/genesis.json +++ b/demo/config/development/genesis.json @@ -1,5 +1,7 @@ { - "config": {}, + "config": { + "homesteadBlock": 1 + }, "nonce": "0x0000000000000042", "difficulty": "0x0", "alloc": { diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 05b3e072b..41a3f2e59 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -95,6 +95,7 @@ class Compiler { // [2] classname const regex = /(.*):(.*)/; const className = contractName.match(regex)[2]; + const filename = contractName.match(regex)[1]; compiled_object[className] = {}; compiled_object[className].code = contract.bytecode; @@ -104,7 +105,9 @@ class Compiler { compiled_object[className].gasEstimates = contract.gasEstimates; compiled_object[className].functionHashes = contract.functionHashes; compiled_object[className].abiDefinition = JSON.parse(contract.interface); + compiled_object[className].filename = filename } + callback(null, compiled_object); } ], function (err, result) { diff --git a/lib/contracts/contracts.js b/lib/contracts/contracts.js index 54fb8e896..8faa33031 100644 --- a/lib/contracts/contracts.js +++ b/lib/contracts/contracts.js @@ -61,6 +61,7 @@ class ContractsManager { contract.gasEstimates = compiledContract.gasEstimates; contract.functionHashes = compiledContract.functionHashes; contract.abiDefinition = compiledContract.abiDefinition; + contract.filename = compiledContract.filename; contract.gas = (contractConfig && contractConfig.gas) || self.contractsConfig.gas || 'auto'; self.adjustGas(contract); diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index f9b2259be..e3103da23 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -105,18 +105,32 @@ class Deploy { return callback(new Error(err)); } + let contractCode = contract.code; + let contractsList = self.contractsManager.listContracts(); + for (let contractObj of contractsList) { + let filename = contractObj.filename; + let deployedAddress = contractObj.deployedAddress; + if (deployedAddress) { + deployedAddress = deployedAddress.substr(2); + } + let linkReference = '__' + filename + ":" + contractObj.className; + let toReplace = linkReference + "_".repeat(40 - linkReference.length); + contractCode = contractCode.replace(toReplace, deployedAddress); + } + // TODO: probably needs to be defaultAccount // TODO: it wouldn't necessary be the first address // use defined blockchain address or first address contractParams.push({ //from: this.web3.eth.coinbase, from: accounts[0], - data: "0x" + contract.code, + data: "0x" + contractCode, gas: contract.gas, gasPrice: contract.gasPrice }); self.logger.info("deploying " + contract.className.bold.cyan + " with ".green + contract.gas + " gas".green); + contractParams.push(function (err, transaction) { self.logger.contractsState(self.contractsManager.contractsState()); diff --git a/test_app/app/contracts/test.sol b/test_app/app/contracts/test.sol new file mode 100644 index 000000000..2618d93df --- /dev/null +++ b/test_app/app/contracts/test.sol @@ -0,0 +1,17 @@ +pragma solidity ^0.4.11; + +library AMyLib { + + function add(uint _a, uint _b) returns (uint _c) { + return _a + _b; + } + +} + +contract Test { + + function testAdd() constant returns (uint _result) { + return AMyLib.add(1, 2); + } + +} diff --git a/test_app/config/development/genesis.json b/test_app/config/development/genesis.json index 8df404021..4a50a438b 100644 --- a/test_app/config/development/genesis.json +++ b/test_app/config/development/genesis.json @@ -1,5 +1,7 @@ { - "config": {}, + "config": { + "homesteadBlock": 1 + }, "nonce": "0x0000000000000042", "difficulty": "0x0", "alloc": { From acee934467b0bd8b1e59c043856a794c568bb0b5 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 16 Jul 2017 13:31:40 -0400 Subject: [PATCH 12/15] treat library as dependencies for contract deployment --- lib/contracts/contracts.js | 9 ++++++++- test_app/app/contracts/test.sol | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/contracts/contracts.js b/lib/contracts/contracts.js index 8faa33031..67654ab66 100644 --- a/lib/contracts/contracts.js +++ b/lib/contracts/contracts.js @@ -137,8 +137,15 @@ class ContractsManager { for (className in self.contracts) { contract = self.contracts[className]; - if (contract.args === []) continue; + // look in code for dependencies + let libMatches = (contract.code.match(/\:(.*?)(?=_)/g) || []); + for (let match of libMatches) { + self.contractDependencies[className] = self.contractDependencies[className] || []; + self.contractDependencies[className].push(match.substr(1)); + } + // look in arguments for dependencies + if (contract.args === []) continue; let ref = contract.args; for (let j = 0; j < ref.length; j++) { let arg = ref[j]; diff --git a/test_app/app/contracts/test.sol b/test_app/app/contracts/test.sol index 2618d93df..da76aa297 100644 --- a/test_app/app/contracts/test.sol +++ b/test_app/app/contracts/test.sol @@ -1,6 +1,6 @@ pragma solidity ^0.4.11; -library AMyLib { +library ZAMyLib { function add(uint _a, uint _b) returns (uint _c) { return _a + _b; @@ -11,7 +11,7 @@ library AMyLib { contract Test { function testAdd() constant returns (uint _result) { - return AMyLib.add(1, 2); + return ZAMyLib.add(1, 2); } } From 8b891c5f0c4d82d1a3576eba990c21a4562cce54 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 16 Jul 2017 13:38:12 -0400 Subject: [PATCH 13/15] replace all instances of matched lib --- lib/contracts/deploy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index e3103da23..8af0a1703 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -115,7 +115,7 @@ class Deploy { } let linkReference = '__' + filename + ":" + contractObj.className; let toReplace = linkReference + "_".repeat(40 - linkReference.length); - contractCode = contractCode.replace(toReplace, deployedAddress); + contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress); } // TODO: probably needs to be defaultAccount From f2fe24aa2970fbe4f5e0516b0212af1bbc107181 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 25 Jul 2017 07:23:59 -0400 Subject: [PATCH 14/15] update specs --- lib/contracts/compiler.js | 2 +- test/compiler.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 41a3f2e59..ced0fb1a8 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -105,7 +105,7 @@ class Compiler { compiled_object[className].gasEstimates = contract.gasEstimates; compiled_object[className].functionHashes = contract.functionHashes; compiled_object[className].abiDefinition = JSON.parse(contract.interface); - compiled_object[className].filename = filename + compiled_object[className].filename = filename; } callback(null, compiled_object); diff --git a/test/compiler.js b/test/compiler.js index c829b09e1..d4a2e5a74 100644 --- a/test/compiler.js +++ b/test/compiler.js @@ -16,9 +16,9 @@ describe('embark.Compiler', function() { let expectedObject = {}; - expectedObject["SimpleStorage"] = {"code":"6060604052341561000c57fe5b60405160208061011383398101604052515b60008190555b505b60df806100346000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c0029","realRuntimeBytecode": "606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820","runtimeBytecode":"606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c0029","swarmHash": "a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c","gasEstimates":{"creation":[20141,44600],"external":{"get()":400,"set(uint256)":20144,"storedData()":355},"internal":{}},"functionHashes":{"get()":"6d4ce63c","set(uint256)":"60fe47b1","storedData()":"2a1afcd9"},"abiDefinition":[{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initialValue","type":"uint256"}],"payable":false,"type":"constructor"}]}; + expectedObject["SimpleStorage"] = {"code":"6060604052341561000c57fe5b60405160208061011383398101604052515b60008190555b505b60df806100346000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c0029","realRuntimeBytecode": "606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820","runtimeBytecode":"606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632a1afcd98114604d57806360fe47b114606c5780636d4ce63c14607e575bfe5b3415605457fe5b605a609d565b60408051918252519081900360200190f35b3415607357fe5b607c60043560a3565b005b3415608557fe5b605a60ac565b60408051918252519081900360200190f35b60005481565b60008190555b50565b6000545b905600a165627a7a72305820a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c0029","filename": "test/contracts/simple_storage.sol","swarmHash": "a89e7fdce74e002378f275124c03a50f7796db2cf1f0d1ad12dd8bafe6a8892c","gasEstimates":{"creation":[20141,44600],"external":{"get()":400,"set(uint256)":20144,"storedData()":355},"internal":{}},"functionHashes":{"get()":"6d4ce63c","set(uint256)":"60fe47b1","storedData()":"2a1afcd9"},"abiDefinition":[{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initialValue","type":"uint256"}],"payable":false,"type":"constructor"}]}; - expectedObject["Token"] = {"code":"6060604052341561000c57fe5b6040516020806104be83398101604052515b600160a060020a033316600090815260208190526040902081905560028190555b505b61046e806100506000396000f300606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b30029","realRuntimeBytecode": "606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820","runtimeBytecode":"606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b30029","swarmHash": "f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b3","gasEstimates":{"creation":[40472,226800],"external":{"allowance(address,address)":809,"approve(address,uint256)":22334,"balanceOf(address)":673,"totalSupply()":396,"transfer(address,uint256)":43635,"transferFrom(address,address,uint256)":64415},"internal":{"safeToAdd(uint256,uint256)":41}},"functionHashes":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd"},"abiDefinition":[{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"value","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"_allowance","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initial_balance","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]} + expectedObject["Token"] = {"code":"6060604052341561000c57fe5b6040516020806104be83398101604052515b600160a060020a033316600090815260208190526040902081905560028190555b505b61046e806100506000396000f300606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b30029","filename": "test/contracts/token.sol","realRuntimeBytecode": "606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820","runtimeBytecode":"606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007757806318160ddd146100aa57806323b872dd146100cc57806370a0823114610105578063a9059cbb14610133578063dd62ed3e14610166575bfe5b341561007f57fe5b610096600160a060020a036004351660243561019a565b604080519115158252519081900360200190f35b34156100b257fe5b6100ba610205565b60408051918252519081900360200190f35b34156100d457fe5b610096600160a060020a036004358116906024351660443561020c565b604080519115158252519081900360200190f35b341561010d57fe5b6100ba600160a060020a0360043516610323565b60408051918252519081900360200190f35b341561013b57fe5b610096600160a060020a0360043516602435610342565b604080519115158252519081900360200190f35b341561016e57fe5b6100ba600160a060020a0360043581169060243516610407565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b6002545b90565b600160a060020a038316600090815260208190526040812054829010156102335760006000fd5b600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010156102685760006000fd5b600160a060020a03831660009081526020819052604090205461028b9083610434565b15156102975760006000fd5b600160a060020a038085166000818152600160209081526040808320338616845282528083208054889003905583835282825280832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a0381166000908152602081905260409020545b919050565b600160a060020a033316600090815260208190526040812054829010156103695760006000fd5b600160a060020a03831660009081526020819052604090205461038c9083610434565b15156103985760006000fd5b600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b808201829010155b929150505600a165627a7a72305820f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b30029","swarmHash": "f1e53450d0d5723ba8f341856e7786c43607109cbb25ff3975ce9ccd042506b3","gasEstimates":{"creation":[40472,226800],"external":{"allowance(address,address)":809,"approve(address,uint256)":22334,"balanceOf(address)":673,"totalSupply()":396,"transfer(address,uint256)":43635,"transferFrom(address,address,uint256)":64415},"internal":{"safeToAdd(uint256,uint256)":41}},"functionHashes":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd"},"abiDefinition":[{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"value","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"ok","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"_allowance","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initial_balance","type":"uint256"}],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]} it('should generate compiled code and abi', function(done) { compiler.compile_solidity([ From bc2c6b637cb3f08d5ebb2c4bd1abf3a10e8a1309 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 25 Jul 2017 07:31:24 -0400 Subject: [PATCH 15/15] update to 2.5.2 --- boilerplate/package.json | 2 +- demo/package.json | 2 +- docs/conf.py | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/boilerplate/package.json b/boilerplate/package.json index 64f510d4b..3dac555b0 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -9,7 +9,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.5.1", + "embark": "^2.5.2", "mocha": "^2.2.5" } } diff --git a/demo/package.json b/demo/package.json index 4c8b060e6..930fb0047 100644 --- a/demo/package.json +++ b/demo/package.json @@ -10,7 +10,7 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark": "^2.5.1", + "embark": "^2.5.2", "mocha": "^2.2.5" } } diff --git a/docs/conf.py b/docs/conf.py index f254edd11..7bb0e679f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ author = u'Iuri Matias' # The short X.Y version. version = u'2.5' # The full version, including alpha/beta/rc tags. -release = u'2.5.1' +release = u'2.5.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/package.json b/package.json index 74c8eae45..ef3363ccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.5.1", + "version": "2.5.2", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "test": "grunt jshint && mocha test/ --no-timeouts"