github.com/koko1123/flow-go-1@v0.29.6/storage/badger/operation/guarantees.go (about)

     1  package operation
     2  
     3  import (
     4  	"github.com/dgraph-io/badger/v3"
     5  
     6  	"github.com/koko1123/flow-go-1/model/flow"
     7  )
     8  
     9  func InsertGuarantee(collID flow.Identifier, guarantee *flow.CollectionGuarantee) func(*badger.Txn) error {
    10  	return insert(makePrefix(codeGuarantee, collID), guarantee)
    11  }
    12  
    13  func RetrieveGuarantee(collID flow.Identifier, guarantee *flow.CollectionGuarantee) func(*badger.Txn) error {
    14  	return retrieve(makePrefix(codeGuarantee, collID), guarantee)
    15  }
    16  
    17  func IndexPayloadGuarantees(blockID flow.Identifier, guarIDs []flow.Identifier) func(*badger.Txn) error {
    18  	return insert(makePrefix(codePayloadGuarantees, blockID), guarIDs)
    19  }
    20  
    21  func LookupPayloadGuarantees(blockID flow.Identifier, guarIDs *[]flow.Identifier) func(*badger.Txn) error {
    22  	return retrieve(makePrefix(codePayloadGuarantees, blockID), guarIDs)
    23  }