Skip to content

Commit

Permalink
fix: Use string representation of ints in DepositSnapshotJSON
Browse files Browse the repository at this point in the history
Clients give (and expect) the integers deposit_count and
execution_block_height to be represented as strings in the JSON. This
mismatch that this commit fixes caused us to not actually store and
serve the snapshots clients gave us.
  • Loading branch information
Pietje Puk committed Aug 23, 2023
1 parent bd0e9e1 commit 96ac38a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/beacon/api/types/deposit_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type DepositSnapshot struct {
type DepositSnapshotJSON struct {
Finalized []string `json:"finalized"`
DepositRoot string `json:"deposit_root"`
DepositCount uint64 `json:"deposit_count"`
DepositCount uint64 `json:"deposit_count,string"`
ExecutionBlockHash string `json:"execution_block_hash"`
ExecutionBlockHeight uint64 `json:"execution_block_height"`
ExecutionBlockHeight uint64 `json:"execution_block_height,string"`
}

func (d *DepositSnapshot) MarshalJSON() ([]byte, error) {
Expand Down

0 comments on commit 96ac38a

Please sign in to comment.