Skip to content

Commit 5872a4b

Browse files
committed
fix(staking): stake amount history api
1 parent 60af63d commit 5872a4b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pkg/indexer/cl_total_stake_hist.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ func (c *CLTotalStakeHistIndexer) index() error {
9393

9494
blk2StakeChange := make(map[int64]int64)
9595
for _, event := range events {
96-
amount, err := strconv.ParseInt(event.Amount, 10, 64)
97-
if err != nil {
98-
log.Error().Err(err).Msgf("event info %+v", event)
99-
return fmt.Errorf("parse amount %s failed: %w", event.Amount, err)
96+
var amount int64
97+
if event.Amount == "" {
98+
// special bypass for aeneid
99+
amount = 0
100+
} else {
101+
amt, err := strconv.ParseInt(event.Amount, 10, 64)
102+
if err != nil {
103+
return fmt.Errorf("parse amount %s failed: %w", event.Amount, err)
104+
}
105+
amount = amt
100106
}
101107

102108
switch event.EventType {

0 commit comments

Comments
 (0)