Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Patch gas check and tx status for Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
gabmontes committed Feb 15, 2019
1 parent 06ce2f6 commit da5fba1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion patches/web3-core-method+1.0.0-beta.37.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
patch-package
--- a/node_modules/web3-core-method/src/index.js
+++ b/node_modules/web3-core-method/src/index.js
@@ -533,7 +533,16 @@ Method.prototype.buildCall = function() {
@@ -200,6 +200,7 @@ Method.prototype._confirmTransaction = function (defer, result, payload) {
intervalId = null,
receiptJSON = '',
gasProvided = (_.isObject(payload.params[0]) && payload.params[0].gas) ? payload.params[0].gas : null,
+ isContractCall = _.isObject(payload.params[0]) && !!payload.params[0].data,
isContractDeployment = _.isObject(payload.params[0]) &&
payload.params[0].data &&
payload.params[0].from &&
@@ -348,8 +349,8 @@ Method.prototype._confirmTransaction = function (defer, result, payload) {
if (!isContractDeployment && !promiseResolved) {

if(!receipt.outOfGas &&
- (!gasProvided || gasProvided !== receipt.gasUsed) &&
- (receipt.status === true || receipt.status === '0x1' || typeof receipt.status === 'undefined')) {
+ (!gasProvided || gasProvided !== utils.numberToHex(receipt.gasUsed) || !isContractCall || (isContractCall && receipt.events)) &&
+ (receipt.status === true || receipt.status === '0x1' || receipt.status === null || typeof receipt.status === 'undefined')) {
defer.eventEmitter.emit('receipt', receipt);
defer.resolve(receipt);

@@ -533,7 +534,16 @@ Method.prototype.buildCall = function() {

// If wallet was found, sign tx, and send using sendRawTransaction
if (wallet && wallet.privateKey) {
Expand Down

0 comments on commit da5fba1

Please sign in to comment.