-
Notifications
You must be signed in to change notification settings - Fork 179
/
snapshot.go
55 lines (42 loc) · 1.15 KB
/
snapshot.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package invalid
import (
"github.com/onflow/flow-go/model/flow"
)
// Snapshot represents a snapshot referencing an invalid block, or for
// which an error occurred while resolving the reference block.
type Snapshot struct {
err error
}
func NewSnapshot(err error) *Snapshot {
return &Snapshot{err: err}
}
func (u *Snapshot) Head() (*flow.Header, error) {
return nil, u.err
}
func (u *Snapshot) QuorumCertificate() (*flow.QuorumCertificate, error) {
return nil, u.err
}
func (u *Snapshot) Phase() (flow.EpochPhase, error) {
return 0, u.err
}
func (u *Snapshot) Identities(_ flow.IdentityFilter) (flow.IdentityList, error) {
return nil, u.err
}
func (u *Snapshot) Identity(_ flow.Identifier) (*flow.Identity, error) {
return nil, u.err
}
func (u *Snapshot) Commit() (flow.StateCommitment, error) {
return nil, u.err
}
func (u *Snapshot) SealedResult() (*flow.ExecutionResult, *flow.Seal, error) {
return nil, nil, u.err
}
func (u *Snapshot) SealingSegment() ([]*flow.Block, error) {
return nil, u.err
}
func (u *Snapshot) Pending() ([]flow.Identifier, error) {
return nil, u.err
}
func (u *Snapshot) Seed(_ ...uint32) ([]byte, error) {
return nil, u.err
}