Skip to content

Commit

Permalink
patch ganache-core to serialize signatures r and s as quantities
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed May 6, 2019
1 parent 912ef7a commit ddac0af
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions patches/ganache-core+2.5.6-beta.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/node_modules/ganache-core/lib/utils/to.js b/node_modules/ganache-core/lib/utils/to.js
index 7af5cbf..82f6533 100644
--- a/node_modules/ganache-core/lib/utils/to.js
+++ b/node_modules/ganache-core/lib/utils/to.js
@@ -47,7 +47,7 @@ module.exports = {

_rpcQuantityHexString: function(val) {
val = this.hex(val);
- // remove all zeroes leading zeros, `0+`, from the hex-encoded value
+ // remove all leading zeros, `0+`, from the hex-encoded value
// This doesn't remove the last 0 which would be captured by `(.+?)`
val = val.replace(/^(?:0x)(?:0+(.+?))?$/, "0x$1");
return val;
diff --git a/node_modules/ganache-core/lib/utils/transaction.js b/node_modules/ganache-core/lib/utils/transaction.js
index 5bff9f8..73bf1c7 100644
--- a/node_modules/ganache-core/lib/utils/transaction.js
+++ b/node_modules/ganache-core/lib/utils/transaction.js
@@ -300,8 +300,8 @@ module.exports = class Transaction extends EthereumJsTransaction {
gasPrice: to.rpcQuantityHexString(this.gasPrice),
input: to.rpcDataHexString(this.data),
v: to.nullableRpcQuantityHexString(this.v),
- r: to.nullableRpcDataHexString(this.r),
- s: to.nullableRpcDataHexString(this.s)
+ r: to.nullableRpcQuantityHexString(this.r),
+ s: to.nullableRpcQuantityHexString(this.s)
};

return resultJSON;

0 comments on commit ddac0af

Please sign in to comment.