Skip to content

Commit 915b960

Browse files
committed
Revert "use local framework and implement required new methods for history drop"
This reverts commit eb171f2.
1 parent eb171f2 commit 915b960

File tree

3 files changed

+8
-27
lines changed

3 files changed

+8
-27
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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-
1614
require (
1715
github.com/BurntSushi/toml v1.4.0 // indirect
1816
github.com/alexflint/go-arg v1.5.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ github.com/ethereum/go-ethereum v1.13.15 h1:U7sSGYGo4SPjP6iNIifNoyIAiNjrmQkz6EwQ
2323
github.com/ethereum/go-ethereum v1.13.15/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
2424
github.com/flare-foundation/go-flare-common v1.0.2 h1:GZTQMmIBMVhEMMe2smuGu46jWNoe6+xzeE68XAhmxSE=
2525
github.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=
2628
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
2729
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
2830
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=

internal/xrp/entities.go

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
11
package xrp
22

3-
import "github.com/flare-foundation/verifier-indexer-framework/pkg/database"
4-
53
type 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-
3310
type 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
}

0 commit comments

Comments
 (0)