-
Notifications
You must be signed in to change notification settings - Fork 179
/
snapshot.go
26 lines (21 loc) · 941 Bytes
/
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
package cluster
import (
"github.com/onflow/flow-go/model/flow"
)
// Snapshot represents an immutable snapshot at a specific point in the cluster
// state history.
type Snapshot interface {
// Collection returns the collection generated in this step of the cluster
// state history.
Collection() (*flow.Collection, error)
// Head returns the latest block at the selected point of the cluster state
// history. If the snapshot was selected by block ID, returns the header
// with that block ID. If the snapshot was selected as final, returns the
// latest finalized block.
Head() (*flow.Header, error)
// Pending returns all children IDs for the snapshot head, which thus were
// potential extensions of the protocol state at this snapshot. The result
// is ordered such that parents are included before their children. These
// are NOT guaranteed to have been validated by HotStuff.
Pending() ([]flow.Identifier, error)
}