Skip to content

Commit 15b9140

Browse files
committed
String amount
1 parent e9fb1af commit 15b9140

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

app/obolapi/deposit.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,15 @@ func (c Client) GetFullDeposit(ctx context.Context, valPubkey string, lockHash [
146146
return []eth2p0.DepositData{}, errors.Wrap(err, "partial signatures threshold aggregate")
147147
}
148148

149+
amountUint, err := strconv.ParseUint(am.Amount, 10, 64)
150+
if err != nil {
151+
return []eth2p0.DepositData{}, errors.Wrap(err, "parse amount to uint")
152+
}
153+
149154
fullDeposits = append(fullDeposits, eth2p0.DepositData{
150155
PublicKey: eth2p0.BLSPubKey(valPubkeyBytes),
151156
WithdrawalCredentials: withdrawalCredentialsBytes,
152-
Amount: eth2p0.Gwei(am.Amount),
157+
Amount: eth2p0.Gwei(amountUint),
153158
Signature: eth2p0.BLSSignature(fullSig),
154159
})
155160
}

app/obolapi/deposit_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type FullDepositResponse struct {
2020
}
2121

2222
type Amount struct {
23-
Amount uint64 `json:"amount"`
23+
Amount string `json:"amount"`
2424
Partials []Partial `json:"partials"`
2525
}
2626

testutil/obolapimock/deposit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (ts *testServer) HandleSubmitPartialDeposit(writer http.ResponseWriter, req
121121
amtFound := false
122122

123123
for idx, amt := range amounts {
124-
if amt.Amount == uint64(depositData.Amount) {
124+
if amt.Amount == strconv.FormatUint(uint64(depositData.Amount), 10) {
125125
amt.Partials = append(amt.Partials, obolapi.Partial{
126126
PartialDepositSignature: depositData.Signature.String(),
127127
PartialPublicKey: "",
@@ -135,7 +135,7 @@ func (ts *testServer) HandleSubmitPartialDeposit(writer http.ResponseWriter, req
135135

136136
if !amtFound {
137137
amounts = append(amounts, obolapi.Amount{
138-
Amount: uint64(depositData.Amount),
138+
Amount: strconv.FormatUint(uint64(depositData.Amount), 10),
139139
Partials: []obolapi.Partial{
140140
{
141141
PartialDepositSignature: depositData.Signature.String(),

0 commit comments

Comments
 (0)