github.com/koko1123/flow-go-1@v0.29.6/model/flow/collectionGuarantee.go (about)

     1  // (c) 2019 Dapper Labs - ALL RIGHTS RESERVED
     2  
     3  package flow
     4  
     5  import (
     6  	"github.com/onflow/flow-go/crypto"
     7  )
     8  
     9  // CollectionGuarantee is a signed hash for a collection, which is used
    10  // to announce collections to consensus nodes.
    11  type CollectionGuarantee struct {
    12  	CollectionID     Identifier       // ID of the collection being guaranteed
    13  	ReferenceBlockID Identifier       // defines expiry of the collection
    14  	ChainID          ChainID          // the chainID of the cluster in order to determine which cluster this guarantee belongs to
    15  	SignerIndices    []byte           // encoded indices of the signers
    16  	Signature        crypto.Signature // guarantor signatures
    17  }
    18  
    19  // ID returns the fingerprint of the collection guarantee.
    20  func (cg *CollectionGuarantee) ID() Identifier {
    21  	return cg.CollectionID
    22  }
    23  
    24  // Checksum returns a checksum of the collection guarantee including the
    25  // signatures.
    26  func (cg *CollectionGuarantee) Checksum() Identifier {
    27  	return MakeID(cg)
    28  }