Skip to content

Commit e2f69d1

Browse files
committed
fix(staking): stake amount history api
1 parent 5c60d72 commit e2f69d1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

db/cl_staking_event.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package db
22

33
import (
44
"errors"
5+
"time"
56

67
"gorm.io/gorm"
78
)
@@ -18,7 +19,7 @@ type CLStakingEvent struct {
1819

1920
type CLSuccessfulStakingEvent struct {
2021
CLStakingEvent
21-
BlockTime int64 `gorm:"not null;column:block_time"`
22+
BlockTime time.Time `gorm:"not null;column:block_time"`
2223
}
2324

2425
func (CLStakingEvent) TableName() string {

pkg/indexer/cl_total_stake_hist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (c *CLTotalStakeHistIndexer) index() error {
116116
for blkno, amt := range blk2StakeChange {
117117
scs = append(scs, &stakeChange{
118118
BlockHeight: blkno,
119-
BlockTime: events[blkno].BlockTime,
119+
BlockTime: events[blkno].BlockTime.Unix(),
120120
StakeChangeAmount: amt,
121121
})
122122
}

0 commit comments

Comments
 (0)