Documentation ¶
Index ¶
- Constants
- func DefaultProofRuntime() (prt *merkle.ProofRuntime)
- func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
- func QueryKeyWithProof(node rpcclient.Client, key []byte, storeName string, height int64) ([]byte, []byte, []byte, error)
- func RequireProof(subpath string) bool
- type Codec
- type CommitID
- type CommitInfo
- type ConsensusState
- type Header
- type KeyValueMerkleProof
- type MultiStoreProof
- type MultiStoreProofOp
- type StoreCore
- type StoreInfo
Constants ¶
const ProofOpMultiStore = "multistore"
the multi-store proof operation constant value
Variables ¶
This section is empty.
Functions ¶
func DefaultProofRuntime ¶
func DefaultProofRuntime() (prt *merkle.ProofRuntime)
XXX: This should be managed by the rootMultiStore which may want to register more proof ops?
func MultiStoreProofOpDecoder ¶
func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
MultiStoreProofOpDecoder returns a multi-store merkle proof operator from a given proof operation.
func QueryKeyWithProof ¶
func RequireProof ¶
RequireProof return whether proof is require for the subpath
Types ¶
type CommitInfo ¶
NOTE: Keep CommitInfo a simple immutable struct.
func (CommitInfo) CommitID ¶
func (ci CommitInfo) CommitID() CommitID
func (CommitInfo) Hash ¶
func (ci CommitInfo) Hash() []byte
Hash returns the simple merkle root hash of the stores sorted by name.
type ConsensusState ¶
type ConsensusState struct { ChainID string Height uint64 AppHash []byte CurValidatorSetHash []byte NextValidatorSet *tmtypes.ValidatorSet }
func DecodeConsensusState ¶
func DecodeConsensusState(input []byte) (ConsensusState, error)
input: | chainID | height | appHash | curValidatorSetHash | [{validator pubkey, voting power}] | | 32 bytes | 8 bytes | 32 bytes | 32 bytes | [{32 bytes, 8 bytes}] |
func GetInitConsensusState ¶
func GetInitConsensusState(node rpcclient.Client, height int64) (*ConsensusState, error)
func (*ConsensusState) ApplyHeader ¶
func (cs *ConsensusState) ApplyHeader(header *Header) (bool, error)
func (ConsensusState) EncodeConsensusState ¶
func (cs ConsensusState) EncodeConsensusState() ([]byte, error)
output: | chainID | height | appHash | curValidatorSetHash | [{validator pubkey, voting power}] | | 32 bytes | 8 bytes | 32 bytes | 32 bytes | [{32 bytes, 8 bytes}] |
type Header ¶
type Header struct { tmtypes.SignedHeader ValidatorSet *tmtypes.ValidatorSet `json:"validator_set"` NextValidatorSet *tmtypes.ValidatorSet `json:"next_validator_set"` }
func DecodeHeader ¶
func QueryTendermintHeader ¶
func (*Header) EncodeHeader ¶
type KeyValueMerkleProof ¶
type KeyValueMerkleProof struct { Key []byte Value []byte StoreName string AppHash []byte Proof *merkle.Proof // contains filtered or unexported fields }
func DecodeKeyValueMerkleProof ¶
func DecodeKeyValueMerkleProof(input []byte) (*KeyValueMerkleProof, error)
input: | storeName | key length | key | value length | value | appHash | proof | | 32 bytes | 32 bytes | | 32 bytes | | 32 bytes | |
func (*KeyValueMerkleProof) SetVerifiers ¶
func (kvmp *KeyValueMerkleProof) SetVerifiers(verifiers []merkle.ProofOpVerifier)
func (*KeyValueMerkleProof) Validate ¶
func (kvmp *KeyValueMerkleProof) Validate() bool
type MultiStoreProof ¶
type MultiStoreProof struct {
StoreInfos []StoreInfo
}
MultiStoreProof defines a collection of store proofs in a multi-store
func NewMultiStoreProof ¶
func NewMultiStoreProof(storeInfos []StoreInfo) *MultiStoreProof
func (*MultiStoreProof) ComputeRootHash ¶
func (proof *MultiStoreProof) ComputeRootHash() []byte
ComputeRootHash returns the root hash for a given multi-store proof.
type MultiStoreProofOp ¶
type MultiStoreProofOp struct { // To encode in ProofOp.Data. Proof *MultiStoreProof `json:"proof"` // contains filtered or unexported fields }
TODO: document
func NewMultiStoreProofOp ¶
func NewMultiStoreProofOp(key []byte, proof *MultiStoreProof) MultiStoreProofOp
func (MultiStoreProofOp) GetKey ¶
func (op MultiStoreProofOp) GetKey() []byte
GetKey returns the key for a multi-store proof operation.
func (MultiStoreProofOp) ProofOp ¶
func (op MultiStoreProofOp) ProofOp() merkle.ProofOp
ProofOp return a merkle proof operation from a given multi-store proof operation.
func (MultiStoreProofOp) Run ¶
func (op MultiStoreProofOp) Run(args [][]byte) ([][]byte, error)
Run executes a multi-store proof operation for a given value. It returns the root hash if the value matches all the store's commitID's hash or an error otherwise.
func (MultiStoreProofOp) String ¶
func (op MultiStoreProofOp) String() string
String implements the Stringer interface for a mult-store proof operation.