@@ -30,7 +30,7 @@ export type DepositRequestV1 = {
30
30
31
31
export type WithdrawalRequestV1 = {
32
32
sourceAddress : PrefixedHexString // DATA 20 bytes
33
- validatorPublicKey : PrefixedHexString // DATA 48 bytes
33
+ validatorPubkey : PrefixedHexString // DATA 48 bytes
34
34
amount : PrefixedHexString // QUANTITY 8 bytes in gwei
35
35
}
36
36
@@ -49,7 +49,7 @@ export type DepositRequestData = {
49
49
50
50
export type WithdrawalRequestData = {
51
51
sourceAddress : Uint8Array
52
- validatorPublicKey : Uint8Array
52
+ validatorPubkey : Uint8Array
53
53
amount : bigint
54
54
}
55
55
@@ -140,22 +140,22 @@ export class DepositRequest extends CLRequest<CLRequestType.Deposit> {
140
140
export class WithdrawalRequest extends CLRequest < CLRequestType . Withdrawal > {
141
141
constructor (
142
142
public readonly sourceAddress : Uint8Array ,
143
- public readonly validatorPublicKey : Uint8Array ,
143
+ public readonly validatorPubkey : Uint8Array ,
144
144
public readonly amount : bigint
145
145
) {
146
146
super ( CLRequestType . Withdrawal )
147
147
}
148
148
149
149
public static fromRequestData ( withdrawalData : WithdrawalRequestData ) : WithdrawalRequest {
150
- const { sourceAddress, validatorPublicKey , amount } = withdrawalData
151
- return new WithdrawalRequest ( sourceAddress , validatorPublicKey , amount )
150
+ const { sourceAddress, validatorPubkey , amount } = withdrawalData
151
+ return new WithdrawalRequest ( sourceAddress , validatorPubkey , amount )
152
152
}
153
153
154
154
public static fromJSON ( jsonData : WithdrawalRequestV1 ) : WithdrawalRequest {
155
- const { sourceAddress, validatorPublicKey , amount } = jsonData
155
+ const { sourceAddress, validatorPubkey , amount } = jsonData
156
156
return this . fromRequestData ( {
157
157
sourceAddress : hexToBytes ( sourceAddress ) ,
158
- validatorPublicKey : hexToBytes ( validatorPublicKey ) ,
158
+ validatorPubkey : hexToBytes ( validatorPubkey ) ,
159
159
amount : hexToBigInt ( amount ) ,
160
160
} )
161
161
}
@@ -165,27 +165,27 @@ export class WithdrawalRequest extends CLRequest<CLRequestType.Withdrawal> {
165
165
166
166
return concatBytes (
167
167
Uint8Array . from ( [ this . type ] ) ,
168
- RLP . encode ( [ this . sourceAddress , this . validatorPublicKey , amountBytes ] )
168
+ RLP . encode ( [ this . sourceAddress , this . validatorPubkey , amountBytes ] )
169
169
)
170
170
}
171
171
172
172
toJSON ( ) : WithdrawalRequestV1 {
173
173
return {
174
174
sourceAddress : bytesToHex ( this . sourceAddress ) ,
175
- validatorPublicKey : bytesToHex ( this . validatorPublicKey ) ,
175
+ validatorPubkey : bytesToHex ( this . validatorPubkey ) ,
176
176
amount : bigIntToHex ( this . amount ) ,
177
177
}
178
178
}
179
179
180
180
public static deserialize ( bytes : Uint8Array ) : WithdrawalRequest {
181
- const [ sourceAddress , validatorPublicKey , amount ] = RLP . decode ( bytes . slice ( 1 ) ) as [
181
+ const [ sourceAddress , validatorPubkey , amount ] = RLP . decode ( bytes . slice ( 1 ) ) as [
182
182
Uint8Array ,
183
183
Uint8Array ,
184
184
Uint8Array
185
185
]
186
186
return this . fromRequestData ( {
187
187
sourceAddress,
188
- validatorPublicKey ,
188
+ validatorPubkey ,
189
189
amount : bytesToBigInt ( amount ) ,
190
190
} )
191
191
}
0 commit comments