Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Add v,r,s signature parameters in getTransaction
Browse files Browse the repository at this point in the history
Includes the v,r, and s signature parameters in the eth_getTransaction and eth_getTransactionReciept calls.
  • Loading branch information
nicholasjpaterno committed Sep 25, 2018
1 parent 22e3af6 commit 5dc6510
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/utils/receipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ Receipt.prototype.toJSON = function() {
contractAddress: this.contractAddress != null ? to.rpcDataHexString(this.contractAddress) : null,
logs: this.logs.map(function(log) {return log.toJSON()}),
status: to.rpcQuantityHexString(this.status),
logsBloom: to.rpcDataHexString(this.logsBloom)
logsBloom: to.rpcDataHexString(this.logsBloom),
v: to.rpcDataHexString(this.tx.v),
r: to.rpcDataHexString(this.tx.r),
s: to.rpcDataHexString(this.tx.s)
}
};

Expand Down
7 changes: 6 additions & 1 deletion test/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ var tests = function(web3) {

assert.notEqual(receipt, null, "Transaction receipt shouldn't be null");
assert.notEqual(contractAddress, null, "Transaction did not create a contract");
assert.equal(receipt.hasOwnProperty('v'), true, "Transaction includes v signature parameter");
assert.equal(receipt.hasOwnProperty('r'), true, "Transaction includes r signature parameter");
assert.equal(receipt.hasOwnProperty('s'), true, "Transaction includes s signature parameter");
done();
});
});
Expand All @@ -963,7 +966,9 @@ var tests = function(web3) {

assert.notEqual(result, null, "Transaction result shouldn't be null");
assert.equal(result.hash, initialTransaction, "Resultant hash isn't what we expected")

assert.equal(result.hasOwnProperty('v'), true, "Transaction includes v signature parameter");
assert.equal(result.hasOwnProperty('r'), true, "Transaction includes r signature parameter");
assert.equal(result.hasOwnProperty('s'), true, "Transaction includes s signature parameter");
done();
});
});
Expand Down

0 comments on commit 5dc6510

Please sign in to comment.