github.com/Finschia/finschia-sdk@v0.48.1/store/rootmulti/proof.go (about)

     1  package rootmulti
     2  
     3  import (
     4  	"github.com/Finschia/ostracon/crypto/merkle"
     5  
     6  	storetypes "github.com/Finschia/finschia-sdk/store/types"
     7  )
     8  
     9  // RequireProof returns whether proof is required for the subpath.
    10  func RequireProof(subpath string) bool {
    11  	// XXX: create a better convention.
    12  	// Currently, only when query subpath is "/key", will proof be included in
    13  	// response. If there are some changes about proof building in iavlstore.go,
    14  	// we must change code here to keep consistency with iavlStore#Query.
    15  	return subpath == "/key"
    16  }
    17  
    18  //-----------------------------------------------------------------------------
    19  
    20  // XXX: This should be managed by the rootMultiStore which may want to register
    21  // more proof ops?
    22  func DefaultProofRuntime() (prt *merkle.ProofRuntime) {
    23  	prt = merkle.NewProofRuntime()
    24  	prt.RegisterOpDecoder(storetypes.ProofOpIAVLCommitment, storetypes.CommitmentOpDecoder)
    25  	prt.RegisterOpDecoder(storetypes.ProofOpSimpleMerkleCommitment, storetypes.CommitmentOpDecoder)
    26  	return
    27  }