Skip to content

Commit ff3981f

Browse files
g11techphilknows
authored andcommitted
fix: use bigint gwei type for amount in requests instead of num 64 (#7085)
* fix: use bigint gwei type for amount in requests instead of num 64 * revert deposit amount to uintnum64 as unlikely to get a high amount * fix
1 parent 35f8f42 commit ff3981f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/beacon-node/src/execution/engine/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ export function deserializeWithdrawalRequest(withdrawalRequest: WithdrawalReques
461461
return {
462462
sourceAddress: dataToBytes(withdrawalRequest.sourceAddress, 20),
463463
validatorPubkey: dataToBytes(withdrawalRequest.validatorPubkey, 48),
464-
amount: quantityToNum(withdrawalRequest.amount),
464+
amount: quantityToBigint(withdrawalRequest.amount),
465465
};
466466
}
467467

packages/types/src/electra/sszTypes.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export const DepositRequest = new ContainerType(
116116
{
117117
pubkey: BLSPubkey,
118118
withdrawalCredentials: Bytes32,
119+
// this is actually gwei uintbn64 type, but super unlikely to get a high amount here
120+
// to warrant a bn type
119121
amount: UintNum64,
120122
signature: BLSSignature,
121123
index: DepositIndex,
@@ -129,7 +131,7 @@ export const WithdrawalRequest = new ContainerType(
129131
{
130132
sourceAddress: ExecutionAddress,
131133
validatorPubkey: BLSPubkey,
132-
amount: UintNum64,
134+
amount: Gwei,
133135
},
134136
{typeName: "WithdrawalRequest", jsonCase: "eth2"}
135137
);

0 commit comments

Comments
 (0)