Skip to content

Commit ab2d7a3

Browse files
committed
fix(api): don't filter skimmings post pectra
1 parent 526272b commit ab2d7a3

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

backend/pkg/api/data_access/vdb_withdrawals.go

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (d *DataAccessService) GetValidatorDashboardElWithdrawals(ctx context.Conte
238238
TxIndexQueued: res.TxIndex,
239239
ITxIndexQueued: res.ITxIndex,
240240
TxHash: t.Hash(hexutil.Encode(res.TxHash)),
241-
Amount: res.Amount.Mul(decimal.NewFromInt(1e9)),
241+
Amount: utils.GWeiToWei(big.NewInt(res.Amount.IntPart())),
242242
}
243243
if res.GroupId.Valid && !dashboardId.AggregateGroups {
244244
row.GroupId = uint64(res.GroupId.Int64)
@@ -373,26 +373,21 @@ func (d *DataAccessService) GetValidatorDashboardClWithdrawals(ctx context.Conte
373373
}
374374

375375
// there is a pre- and a post-pectra table in db; only query from respective tables if possible to increase compatibility and simplicity
376-
hasPrePectraRows, hasPostPectraRows := true, false
376+
hasPostPectraRows := false
377377
if d.config.ClConfig.ElectraForkEpoch < utils.MaxForkEpoch {
378378
hasPostPectraRows = true
379379
if currentCursor.IsValid() && colSort.Column == enums.VDBWithdrawalsClColumns.Slot {
380380
postElectra := currentCursor.Slot/d.config.ClConfig.SlotsPerEpoch > d.config.ClConfig.ElectraForkEpoch
381381
lookBack := colSort.Desc != currentCursor.Reverse
382-
if postElectra && !lookBack {
383-
hasPrePectraRows, hasPostPectraRows = false, true
384-
} else if !postElectra && lookBack {
385-
hasPrePectraRows, hasPostPectraRows = true, false
382+
if !postElectra && lookBack {
383+
hasPostPectraRows = false
386384
}
387385
}
388386
}
389387

390-
var withdrawalsDs *goqu.SelectDataset
391-
if hasPrePectraRows {
392-
withdrawalsDs, err = getWithdrawalsBridgeDs(dashboardId, search, isValidSearchWithdrawalAddress, isValidSearchIndexOrSlot, isValidSearchGroup, isValidSearchPublicKey)
393-
if err != nil {
394-
return nil, nil, err
395-
}
388+
withdrawalsDs, err := getWithdrawalsBridgeDs(dashboardId, search, isValidSearchWithdrawalAddress, isValidSearchIndexOrSlot, isValidSearchGroup, isValidSearchPublicKey)
389+
if err != nil {
390+
return nil, nil, err
396391
}
397392
if hasPostPectraRows {
398393
requestsDs, err := getWithdrawalRequestsDs(dashboardId, search, isValidSearchWithdrawalAddress, isValidSearchIndexOrSlot, isValidSearchGroup, isValidSearchPublicKey)

0 commit comments

Comments
 (0)