github.com/okex/exchain@v1.8.0/libs/ibc-go/modules/core/exported/commitment.go (about)

     1  package exported
     2  
     3  import ics23 "github.com/confio/ics23/go"
     4  
     5  // Prefix implements spec:CommitmentPrefix.
     6  // Prefix represents the common "prefix" that a set of keys shares.
     7  type Prefix interface {
     8  	Bytes() []byte
     9  	Empty() bool
    10  }
    11  
    12  type Root interface {
    13  	GetHash() []byte
    14  	Empty() bool
    15  }
    16  
    17  // Path implements spec:CommitmentPath.
    18  // A path is the additional information provided to the verification function.
    19  type Path interface {
    20  	String() string
    21  	Empty() bool
    22  }
    23  
    24  // Proof implements spec:CommitmentProof.
    25  // Proof can prove whether the key-value pair is a part of the Root or not.
    26  // Each proof has designated key-value pair it is able to prove.
    27  // Proofs includes key but value is provided dynamically at the verification time.
    28  type Proof interface {
    29  	VerifyMembership([]*ics23.ProofSpec, Root, Path, []byte) error
    30  	VerifyNonMembership([]*ics23.ProofSpec, Root, Path) error
    31  	Empty() bool
    32  
    33  	ValidateBasic() error
    34  }