-
Notifications
You must be signed in to change notification settings - Fork 179
/
epoch.go
31 lines (23 loc) · 1.07 KB
/
epoch.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
package operation
import (
"github.com/dgraph-io/badger/v2"
"github.com/onflow/flow-go/model/flow"
)
func InsertEpochSetup(eventID flow.Identifier, event *flow.EpochSetup) func(*badger.Txn) error {
return insert(makePrefix(codeEpochSetup, eventID), event)
}
func RetrieveEpochSetup(eventID flow.Identifier, event *flow.EpochSetup) func(*badger.Txn) error {
return retrieve(makePrefix(codeEpochSetup, eventID), event)
}
func InsertEpochCommit(eventID flow.Identifier, event *flow.EpochCommit) func(*badger.Txn) error {
return insert(makePrefix(codeEpochCommit, eventID), event)
}
func RetrieveEpochCommit(eventID flow.Identifier, event *flow.EpochCommit) func(*badger.Txn) error {
return retrieve(makePrefix(codeEpochCommit, eventID), event)
}
func InsertEpochStatus(blockID flow.Identifier, status *flow.EpochStatus) func(*badger.Txn) error {
return insert(makePrefix(codeBlockEpochStatus, blockID), status)
}
func RetrieveEpochStatus(blockID flow.Identifier, status *flow.EpochStatus) func(*badger.Txn) error {
return retrieve(makePrefix(codeBlockEpochStatus, blockID), status)
}