forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signed_block.go
34 lines (29 loc) · 977 Bytes
/
signed_block.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package guardianproverhealthcheck
import (
"time"
)
type SignedBlock struct {
GuardianProverID uint64 `json:"guardianProverID"`
BlockID uint64 `json:"blockID"`
BlockHash string `json:"blockHash"`
Signature string `json:"signature"`
RecoveredAddress string `json:"recoveredAddress"`
CreatedAt time.Time `json:"createdAt"`
}
type SaveSignedBlockOpts struct {
GuardianProverID uint64
BlockID uint64
BlockHash string
Signature string
RecoveredAddress string
}
type GetSignedBlocksByStartingBlockIDOpts struct {
StartingBlockID uint64
}
// SignedBlockRepository defines database interaction methods to create and get
// signed blocks submitted by guardian provers.
type SignedBlockRepository interface {
Save(opts SaveSignedBlockOpts) error
GetByStartingBlockID(opts GetSignedBlocksByStartingBlockIDOpts) ([]*SignedBlock, error)
GetMostRecentByGuardianProverID(id int) (*SignedBlock, error)
}