-
Notifications
You must be signed in to change notification settings - Fork 174
/
seals.go
31 lines (23 loc) · 1.02 KB
/
seals.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 InsertSeal(sealID flow.Identifier, seal *flow.Seal) func(*badger.Txn) error {
return insert(makePrefix(codeSeal, sealID), seal)
}
func RetrieveSeal(sealID flow.Identifier, seal *flow.Seal) func(*badger.Txn) error {
return retrieve(makePrefix(codeSeal, sealID), seal)
}
func IndexPayloadSeals(blockID flow.Identifier, sealIDs []flow.Identifier) func(*badger.Txn) error {
return insert(makePrefix(codePayloadSeals, blockID), sealIDs)
}
func LookupPayloadSeals(blockID flow.Identifier, sealIDs *[]flow.Identifier) func(*badger.Txn) error {
return retrieve(makePrefix(codePayloadSeals, blockID), sealIDs)
}
func IndexBlockSeal(blockID flow.Identifier, sealID flow.Identifier) func(*badger.Txn) error {
return insert(makePrefix(codeBlockToSeal, blockID), sealID)
}
func LookupBlockSeal(blockID flow.Identifier, sealID *flow.Identifier) func(*badger.Txn) error {
return retrieve(makePrefix(codeBlockToSeal, blockID), &sealID)
}