Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit a6ebb2a

Browse files
nikoulaijdevcs
andauthored
Nikos/5071/investigate signtransaction testcases (#5377)
* Fix testcases * Update tests to check for v,r,s Co-authored-by: Junaid <[email protected]>
1 parent f07bae2 commit a6ebb2a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/eth.accounts.signTransaction.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ var tests = [
133133
common: common
134134
},
135135
// expected r and s values from signature
136-
r: "0x22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd9",
137-
s: "0x83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
136+
r: "0x74dcecc6b8ad09ca09882ac1088eac145e799f56ea3f5b5fe8fcb52bbd3ea4f7",
137+
s: "0x3d49e02af9c239b1b8aea8a7ac9162862dec03207f9f59bc38a4f2b9e42077a9",
138+
v: "0x26",
138139
// signature from eth_signTransaction
139140
oldSignature: "0xf85d8080827c6d94f0109fc8df283027b6285cc889f5aa624eac1f558080269f22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd99f83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
140141
rawTransaction: "0xf85f8001827c6d94f0109fc8df283027b6285cc889f5aa624eac1f55808026a074dcecc6b8ad09ca09882ac1088eac145e799f56ea3f5b5fe8fcb52bbd3ea4f7a03d49e02af9c239b1b8aea8a7ac9162862dec03207f9f59bc38a4f2b9e42077a9",
@@ -159,6 +160,7 @@ var tests = [
159160
// expected r and s values from signature
160161
r: "0x9ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9c",
161162
s: "0x440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
163+
v: "0x25",
162164
// signature from eth_signTransaction
163165
rawTransaction: "0xf86a8086d55698372431831e848094f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a009ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9ca0440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
164166
oldSignature: "0xf86a8086d55698372431831e848094f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a009ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9ca0440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
@@ -181,8 +183,9 @@ var tests = [
181183
common: common
182184
},
183185
// expected r and s values from signature
184-
r: "0x22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd9",
185-
s: "0x83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
186+
r: "0x3cbfff5b8ef4588b930ecbf9b85388795875edf814dfc6c71884f99b6d7555cc",
187+
s: "0x57142e729c1c83bfccb2785e629fc32dffb2e613df565e78e119aa4694cb1df9",
188+
v: "0x25",
186189
// signature from eth_signTransaction
187190
oldSignature: "0xf85d8080827c6d94f0109fc8df283027b6285cc889f5aa624eac1f558080269f22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd99f83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
188191
rawTransaction: "0xf85f800a827c6d94f0109fc8df283027b6285cc889f5aa624eac1f55808025a03cbfff5b8ef4588b930ecbf9b85388795875edf814dfc6c71884f99b6d7555cca057142e729c1c83bfccb2785e629fc32dffb2e613df565e78e119aa4694cb1df9",
@@ -827,6 +830,12 @@ describe("eth", function () {
827830
assert.equal(tx.messageHash, test.messageHash, "message hash failed");
828831
assert.equal(tx.transactionHash, test.transactionHash, "tx hash failed");
829832
assert.equal(tx.rawTransaction, test.rawTransaction, "rawtx failed");
833+
834+
if(test.r && test.s && test.v){
835+
assert.equal(tx.v, test.v, "v property of signature failed");
836+
assert.equal(tx.s, test.s, "s property of signature failed");
837+
assert.equal(tx.r, test.r, "r property of signature failed");
838+
}
830839
done();
831840
})
832841
.catch(e => {

0 commit comments

Comments
 (0)