File tree Expand file tree Collapse file tree 3 files changed +8
-27
lines changed
Expand file tree Collapse file tree 3 files changed +8
-27
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ require (
1111 github.com/stretchr/testify v1.9.0
1212)
1313
14- replace github.com/flare-foundation/verifier-indexer-framework => ../verifier-indexer-framework
15-
1614require (
1715 github.com/BurntSushi/toml v1.4.0 // indirect
1816 github.com/alexflint/go-arg v1.5.1 // indirect
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ github.com/ethereum/go-ethereum v1.13.15 h1:U7sSGYGo4SPjP6iNIifNoyIAiNjrmQkz6EwQ
2323github.com/ethereum/go-ethereum v1.13.15 /go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU =
2424github.com/flare-foundation/go-flare-common v1.0.2 h1:GZTQMmIBMVhEMMe2smuGu46jWNoe6+xzeE68XAhmxSE =
2525github.com/flare-foundation/go-flare-common v1.0.2 /go.mod h1:Pb1OAtNe8jNsD2fh6syJD6kVdqxAAXWESTGgd7uQlME =
26+ github.com/flare-foundation/verifier-indexer-framework v1.0.6 h1:47t7l1AJ+cjeQ/h+oGBGVqdpKg2+2Y61kvvEeJLqDsw =
27+ github.com/flare-foundation/verifier-indexer-framework v1.0.6 /go.mod h1:oaed4K4QdNOVCOHj9ydQgyA2ggGXu5wh8zNWlV5Q2Uw =
2628github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU =
2729github.com/holiman/uint256 v1.2.4 /go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E =
2830github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM =
Original file line number Diff line number Diff line change 11package xrp
22
3- import "github.com/flare-foundation/verifier-indexer-framework/pkg/database"
4-
53type Block struct {
64 Hash string `gorm:"primaryKey;type:varchar(64)"`
75 BlockNumber uint64 `gorm:"index"`
86 Timestamp uint64 `gorm:"index"`
97 Transactions uint64
108}
119
12- func (b Block ) GetBlockNumber () uint64 {
13- return b .BlockNumber
14- }
15-
16- func (b Block ) GetTimestamp () uint64 {
17- return b .Timestamp
18- }
19-
20- func (b Block ) TimestampQuery () string {
21- return "timestamp < ?"
22- }
23-
24- func (b Block ) HistoryDropOrder () []database.Deletable {
25- // It does not particularly matter the order as there are no foreign key constraints.
26- // However we drop transactions first to avoid leaving orphaned records in case of partial failures.
27- return []database.Deletable {
28- Transaction {},
29- Block {},
30- }
31- }
32-
3310type Transaction struct {
3411 Hash string `gorm:"primaryKey;type:varchar(64);index:idx_block_hash_composite,priority:2,option:CONCURRENTLY"`
3512 BlockNumber uint64 `gorm:"index:idx_block_hash_composite,priority:1,option:CONCURRENTLY"`
@@ -40,6 +17,10 @@ type Transaction struct {
4017 SourceAddressesRoot string `gorm:"index;type:varchar(64);default:null"`
4118}
4219
43- func (t Transaction ) TimestampQuery () string {
44- return "timestamp < ?"
20+ func (b Block ) GetBlockNumber () uint64 {
21+ return b .BlockNumber
22+ }
23+
24+ func (b Block ) GetTimestamp () uint64 {
25+ return b .Timestamp
4526}
You can’t perform that action at this time.
0 commit comments