Skip to content

Commit 29fa697

Browse files
authored
Refactor serialisation params in getAwsKmsAccount and getGcpKmsAccount (#731)
* Refactor serialisation params in getAwsKmsAccount and getGcpKmsAccount * better typees
1 parent 3369ba8 commit 29fa697

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/server/utils/wallets/getAwsKmsAccount.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ export async function getAwsKmsAccount(
5252

5353
const r = `0x${signature.r.toString("hex")}` as Hex;
5454
const s = `0x${signature.s.toString("hex")}` as Hex;
55-
const v = signature.v;
55+
const v = BigInt(signature.v);
5656

57-
const yParity = v % 2 === 0 ? 1 : (0 as 0 | 1);
57+
const yParity: 0 | 1 = signature.v % 2 === 0 ? 1 : 0;
5858

5959
const signedTx = serializeTransaction({
6060
transaction: tx,
6161
signature: {
6262
r,
6363
s,
64+
v,
6465
yParity,
6566
},
6667
});

src/server/utils/wallets/getGcpKmsAccount.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ export async function getGcpKmsAccount(
7272

7373
const r = signature.r.toString() as Hex;
7474
const s = signature.s.toString() as Hex;
75-
const v = signature.v;
75+
const v = BigInt(signature.v);
7676

77-
const yParity = v % 2 === 0 ? 1 : (0 as 0 | 1);
77+
const yParity: 0 | 1 = signature.v % 2 === 0 ? 1 : 0;
7878

7979
const signedTx = serializeTransaction({
8080
transaction: tx,
8181
signature: {
8282
r,
8383
s,
84+
v,
8485
yParity,
8586
},
8687
});

0 commit comments

Comments
 (0)