smt

package
v0.46.0-alpha2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProofType = "smt"
)

Variables

This section is empty.

Functions

func ProofDecoder

func ProofDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error)

Types

type HasherType

type HasherType byte
const (
	SHA256 HasherType = iota
)

type ProofOp

type ProofOp struct {
	Root   []byte
	Key    []byte
	Hasher HasherType
	Proof  smt.SparseMerkleProof
}

func NewProofOp

func NewProofOp(root, key []byte, hasher HasherType, proof smt.SparseMerkleProof) *ProofOp

NewProofOp returns a ProofOp for a SparseMerkleProof.

func (*ProofOp) GetKey

func (p *ProofOp) GetKey() []byte

func (*ProofOp) ProofOp

func (p *ProofOp) ProofOp() tmmerkle.ProofOp

func (*ProofOp) Run

func (p *ProofOp) Run(args [][]byte) ([][]byte, error)

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store Implements types.KVStore and CommitKVStore.

func LoadStore

func LoadStore(nodes, values dbm.DBReadWriter, root []byte) *Store

func NewStore

func NewStore(nodes, values dbm.DBReadWriter) *Store

func (*Store) Delete

func (s *Store) Delete(key []byte)

Delete deletes the key. Panics on nil key.

func (*Store) Get

func (s *Store) Get(key []byte) []byte

Get returns nil iff key doesn't exist. Panics on nil key.

func (*Store) GetProof

func (s *Store) GetProof(key []byte) (*tmcrypto.ProofOps, error)

func (*Store) Has

func (s *Store) Has(key []byte) bool

Has checks if a key exists. Panics on nil key.

func (*Store) Root

func (s *Store) Root() []byte

func (*Store) Set

func (s *Store) Set(key []byte, value []byte)

Set sets the key. Panics on nil key or value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL