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

Incorrect V for EIP712 signature #152

Merged
merged 2 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class LedgerBridgeKeyring extends EventEmitter {
},
({ success, payload }) => {
if (success) {
let v = payload.v - 27
let v = parseInt(payload.v, 10)
v = v.toString(16)
if (v.length < 2) {
v = `0${v}`
Expand Down Expand Up @@ -414,7 +414,7 @@ class LedgerBridgeKeyring extends EventEmitter {
})

if (success) {
let v = payload.v - 27
let v = parseInt(payload.v, 10)
digiwand marked this conversation as resolved.
Show resolved Hide resolved
v = v.toString(16)
if (v.length < 2) {
v = `0${v}`
Expand Down
2 changes: 1 addition & 1 deletion test/test-eth-ledger-bridge-keyring.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ describe('LedgerBridgeKeyring', function () {
})

const result = await keyring.signTypedData(fakeAccounts[15], fixtureData, options)
assert.strictEqual(result, '0x72d4e38a0e582e09a620fd38e236fe687a1ec782206b56d576f579c026a7e5b946759735981cd0c3efb02d36df28bb2feedfec3d90e408efc93f45b894946e3200')
assert.strictEqual(result, '0x72d4e38a0e582e09a620fd38e236fe687a1ec782206b56d576f579c026a7e5b946759735981cd0c3efb02d36df28bb2feedfec3d90e408efc93f45b894946e321b')
})

it('should error when address does not match', async function () {
Expand Down