Skip to content

Commit

Permalink
(BIDS-2261) fix export of geneis deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbitfly committed Sep 26, 2023
1 parent c307d41 commit ddf6be2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func WriteValidatorStatisticsForDay(day uint64) error {

if day == 0 { // special case for deposits included in the genesis block
data.DepositsAmount = data.DepositsAmount + data.GenesisDepositsAmount
data.Deposits = data.Deposits + data.GenesisDeposits
}

// update el reward total
Expand Down Expand Up @@ -712,6 +713,7 @@ func gatherValidatorDepositWithdrawals(day uint64, data []*types.ValidatorStatsT

mux.Lock()
for _, r := range resGenesisDeposits {
data[r.ValidatorIndex].GenesisDeposits = int64(r.Deposits)
data[r.ValidatorIndex].GenesisDepositsAmount = int64(r.DepositsAmount)
}
mux.Unlock()
Expand Down
1 change: 1 addition & 0 deletions types/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ type ValidatorStatsTableDbRow struct {

Deposits int64 `db:"deposits"`
DepositsAmount int64 `db:"deposits_amount"`
GenesisDeposits int64 `db:"-"`
GenesisDepositsAmount int64 `db:"-"`

Withdrawals int64 `db:"withdrawals"`
Expand Down

0 comments on commit ddf6be2

Please sign in to comment.