From 12836f53e811b1ce0b21d38caa58bdc7dec3ec4c Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 29 May 2018 13:53:21 -0500 Subject: [PATCH 1/5] alias to the abi property in an object Signed-off-by: VoR0220 --- js/embark.js | 2 ++ lib/contracts/code_templates/vanilla-contract.js.ejs | 1 + 2 files changed, 3 insertions(+) diff --git a/js/embark.js b/js/embark.js index 57a9d6c5..903d7ac8 100644 --- a/js/embark.js +++ b/js/embark.js @@ -44,6 +44,8 @@ EmbarkJS.Contract = function(options) { } } + ContractClass.abi = ContractClass.options.abi; + var messageEvents = function() { this.cb = function() {}; }; diff --git a/lib/contracts/code_templates/vanilla-contract.js.ejs b/lib/contracts/code_templates/vanilla-contract.js.ejs index 908d5769..8527b3a3 100644 --- a/lib/contracts/code_templates/vanilla-contract.js.ejs +++ b/lib/contracts/code_templates/vanilla-contract.js.ejs @@ -1,6 +1,7 @@ <%- className %>Abi = <%- abi %>; <%- className %> = new web3.eth.Contract(<%- className %>Abi); <%- className %>.options.address = '<%- contract.deployedAddress %>'; +<%- className %>.abi = <%- abi %>; <%- className %>.address = '<%- contract.deployedAddress %>'; <%- className %>.options.from = web3.eth.defaultAccount; <% if (gasLimit != false) { %> From 0be18390f1ef6f750145f5b509b9cc6b55c82048 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Tue, 29 May 2018 14:02:26 -0500 Subject: [PATCH 2/5] get rid of the template Signed-off-by: VoR0220 --- lib/contracts/code_templates/vanilla-contract.js.ejs | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/contracts/code_templates/vanilla-contract.js.ejs b/lib/contracts/code_templates/vanilla-contract.js.ejs index 8527b3a3..908d5769 100644 --- a/lib/contracts/code_templates/vanilla-contract.js.ejs +++ b/lib/contracts/code_templates/vanilla-contract.js.ejs @@ -1,7 +1,6 @@ <%- className %>Abi = <%- abi %>; <%- className %> = new web3.eth.Contract(<%- className %>Abi); <%- className %>.options.address = '<%- contract.deployedAddress %>'; -<%- className %>.abi = <%- abi %>; <%- className %>.address = '<%- contract.deployedAddress %>'; <%- className %>.options.from = web3.eth.defaultAccount; <% if (gasLimit != false) { %> From 4d65ccec7a9549d20004d45370cb20b800655b86 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Wed, 30 May 2018 14:33:29 -0500 Subject: [PATCH 3/5] fixed this up Signed-off-by: VoR0220 --- js/embark.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/embark.js b/js/embark.js index 903d7ac8..9e9446c4 100644 --- a/js/embark.js +++ b/js/embark.js @@ -28,11 +28,9 @@ EmbarkJS.Contract = function(options) { ContractClass = new this.web3.eth.Contract(this.abi, this.address); ContractClass.setProvider(this.web3.currentProvider); ContractClass.options.data = this.code; - + ContractClass = this.web3.eth.contract(this.abi); return ContractClass; } else { - ContractClass = this.web3.eth.contract(this.abi); - this.eventList = []; if (this.abi) { From 21b530fad26f4bee031d1fdfd6a33fcec2238dc0 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Wed, 30 May 2018 14:34:36 -0500 Subject: [PATCH 4/5] fix for the fix Signed-off-by: VoR0220 --- js/embark.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/embark.js b/js/embark.js index 9e9446c4..6e0f3c1e 100644 --- a/js/embark.js +++ b/js/embark.js @@ -28,9 +28,11 @@ EmbarkJS.Contract = function(options) { ContractClass = new this.web3.eth.Contract(this.abi, this.address); ContractClass.setProvider(this.web3.currentProvider); ContractClass.options.data = this.code; - ContractClass = this.web3.eth.contract(this.abi); + ContractClass.abi = ContractClass.options.abi; return ContractClass; } else { + ContractClass = this.web3.eth.contract(this.abi); + this.eventList = []; if (this.abi) { @@ -41,9 +43,7 @@ EmbarkJS.Contract = function(options) { } } } - - ContractClass.abi = ContractClass.options.abi; - + var messageEvents = function() { this.cb = function() {}; }; From 2d98938f18a28b1edf0b2a5942a0d415c4c2c5ed Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Wed, 30 May 2018 14:35:07 -0500 Subject: [PATCH 5/5] eliminate space Signed-off-by: VoR0220 --- js/embark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/embark.js b/js/embark.js index 6e0f3c1e..1b0b324f 100644 --- a/js/embark.js +++ b/js/embark.js @@ -43,7 +43,7 @@ EmbarkJS.Contract = function(options) { } } } - + var messageEvents = function() { this.cb = function() {}; };