Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nikos/5071/investigate signtransaction testcases #5377

Merged
merged 6 commits into from
Sep 6, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions test/eth.accounts.signTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ var tests = [
common: common
},
// expected r and s values from signature
r: "0x22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd9",
s: "0x83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
r: "0x74dcecc6b8ad09ca09882ac1088eac145e799f56ea3f5b5fe8fcb52bbd3ea4f7",
jdevcs marked this conversation as resolved.
Show resolved Hide resolved
s: "0x3d49e02af9c239b1b8aea8a7ac9162862dec03207f9f59bc38a4f2b9e42077a9",
v: "0x26",
// signature from eth_signTransaction
oldSignature: "0xf85d8080827c6d94f0109fc8df283027b6285cc889f5aa624eac1f558080269f22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd99f83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
rawTransaction: "0xf85f8001827c6d94f0109fc8df283027b6285cc889f5aa624eac1f55808026a074dcecc6b8ad09ca09882ac1088eac145e799f56ea3f5b5fe8fcb52bbd3ea4f7a03d49e02af9c239b1b8aea8a7ac9162862dec03207f9f59bc38a4f2b9e42077a9",
Expand All @@ -159,6 +160,7 @@ var tests = [
// expected r and s values from signature
r: "0x9ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9c",
s: "0x440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
v: "0x25",
// signature from eth_signTransaction
rawTransaction: "0xf86a8086d55698372431831e848094f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a009ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9ca0440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
oldSignature: "0xf86a8086d55698372431831e848094f0109fc8df283027b6285cc889f5aa624eac1f55843b9aca008025a009ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9ca0440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428",
Expand All @@ -181,8 +183,9 @@ var tests = [
common: common
},
// expected r and s values from signature
r: "0x22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd9",
s: "0x83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
r: "0x3cbfff5b8ef4588b930ecbf9b85388795875edf814dfc6c71884f99b6d7555cc",
s: "0x57142e729c1c83bfccb2785e629fc32dffb2e613df565e78e119aa4694cb1df9",
v: "0x25",
// signature from eth_signTransaction
oldSignature: "0xf85d8080827c6d94f0109fc8df283027b6285cc889f5aa624eac1f558080269f22f17b38af35286ffbb0c6376c86ec91c20ecbad93f84913a0cc15e7580cd99f83d6e12e82e3544cb4439964d5087da78f74cefeec9a450b16ae179fd8fe20",
rawTransaction: "0xf85f800a827c6d94f0109fc8df283027b6285cc889f5aa624eac1f55808025a03cbfff5b8ef4588b930ecbf9b85388795875edf814dfc6c71884f99b6d7555cca057142e729c1c83bfccb2785e629fc32dffb2e613df565e78e119aa4694cb1df9",
Expand Down Expand Up @@ -803,6 +806,12 @@ describe("eth", function () {
assert.equal(tx.messageHash, test.messageHash, "message hash failed");
assert.equal(tx.transactionHash, test.transactionHash, "tx hash failed");
assert.equal(tx.rawTransaction, test.rawTransaction, "rawtx failed");

if(test.r && test.s && test.v){
assert.equal(tx.v, test.v, "v property of signature failed");
assert.equal(tx.s, test.s, "s property of signature failed");
assert.equal(tx.r, test.r, "r property of signature failed");
}
done();
})
.catch(e => {
Expand Down