Versions in this module Expand all Collapse all v0 v0.9.2 May 24, 2021 Changes in this version + const ANSIBright + const ANSIFgBlue + const ANSIFgCyan + const ANSIFgGreen + const ANSIReset + const ProofOpIAVLAbsence + const ProofOpIAVLValue + const Version + var ErrInvalidInputs = fmt.Errorf("invalid inputs") + var ErrInvalidProof = fmt.Errorf("invalid proof") + var ErrInvalidRoot = fmt.Errorf("invalid root") + var ErrVersionDoesNotExist = fmt.Errorf("version does not exist") + func Blue(args ...interface{}) string + func ColoredBytes(data []byte, textColor, bytesColor func(...interface{}) string) string + func Cyan(args ...interface{}) string + func Green(args ...interface{}) string + func IAVLAbsenceOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) + func IAVLValueOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) + func PrintTree(tree *ImmutableTree) + func RegisterWire(cdc *amino.Codec) + func WriteDOTGraph(w io.Writer, tree *ImmutableTree, paths []PathToLeaf) + type IAVLAbsenceOp struct + Proof *RangeProof + func NewIAVLAbsenceOp(key []byte, proof *RangeProof) IAVLAbsenceOp + func (op IAVLAbsenceOp) GetKey() []byte + func (op IAVLAbsenceOp) ProofOp() merkle.ProofOp + func (op IAVLAbsenceOp) Run(args [][]byte) ([][]byte, error) + func (op IAVLAbsenceOp) String() string + type IAVLValueOp struct + Proof *RangeProof + func NewIAVLValueOp(key []byte, proof *RangeProof) IAVLValueOp + func (op IAVLValueOp) GetKey() []byte + func (op IAVLValueOp) ProofOp() merkle.ProofOp + func (op IAVLValueOp) Run(args [][]byte) ([][]byte, error) + func (op IAVLValueOp) String() string + type ImmutableTree struct + func NewImmutableTree(db dbm.DB, cacheSize int) *ImmutableTree + func (t *ImmutableTree) Get(key []byte) (index int64, value []byte) + func (t *ImmutableTree) GetByIndex(index int64) (key []byte, value []byte) + func (t *ImmutableTree) GetRangeWithProof(startKey []byte, endKey []byte, limit int) (keys, values [][]byte, proof *RangeProof, err error) + func (t *ImmutableTree) GetWithProof(key []byte) (value []byte, proof *RangeProof, err error) + func (t *ImmutableTree) Has(key []byte) bool + func (t *ImmutableTree) Hash() []byte + func (t *ImmutableTree) Height() int8 + func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRangeInclusive(start, end []byte, ascending bool, ...) (stopped bool) + func (t *ImmutableTree) RenderShape(indent string, encoder NodeEncoder) []string + func (t *ImmutableTree) Size() int64 + func (t *ImmutableTree) String() string + func (t *ImmutableTree) Version() int64 + type KeyFormat struct + func NewKeyFormat(prefix byte, layout ...int) *KeyFormat + func (kf *KeyFormat) Key(args ...interface{}) []byte + func (kf *KeyFormat) KeyBytes(segments ...[]byte) []byte + func (kf *KeyFormat) Prefix() string + func (kf *KeyFormat) Scan(key []byte, args ...interface{}) + func (kf *KeyFormat) ScanBytes(key []byte) [][]byte + type MutableTree struct + func NewMutableTree(db dbm.DB, cacheSize int, initVersion int64) *MutableTree + func (tree *MutableTree) AvailableVersions() []int + func (tree *MutableTree) DeleteVersion(version int64) error + func (tree *MutableTree) GetImmutable(version int64) (*ImmutableTree, error) + func (tree *MutableTree) GetVersioned(key []byte, version int64) (index int64, value []byte) + func (tree *MutableTree) GetVersionedRangeWithProof(startKey, endKey []byte, limit int, version int64) (keys, values [][]byte, proof *RangeProof, err error) + func (tree *MutableTree) GetVersionedWithProof(key []byte, version int64) ([]byte, *RangeProof, error) + func (tree *MutableTree) Hash() []byte + func (tree *MutableTree) IsEmpty() bool + func (tree *MutableTree) LazyLoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) Load() (int64, error) + func (tree *MutableTree) LoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error) + func (tree *MutableTree) Remove(key []byte) ([]byte, bool) + func (tree *MutableTree) Rollback() + func (tree *MutableTree) SaveVersion() ([]byte, int64, error) + func (tree *MutableTree) Set(key, value []byte) bool + func (tree *MutableTree) String() string + func (tree *MutableTree) VersionExists(version int64) bool + func (tree *MutableTree) WorkingHash() []byte + type Node struct + func MakeNode(buf []byte) (*Node, error) + func NewNode(key []byte, value []byte, version int64) *Node + func (node *Node) PathToLeaf(t *ImmutableTree, key []byte) (PathToLeaf, *Node, error) + func (node *Node) String() string + type NodeEncoder func(id []byte, depth int, isLeaf bool) string + type PathToLeaf []proofInnerNode + func (pl PathToLeaf) Index() (idx int64) + func (pl PathToLeaf) String() string + type RangeProof struct + InnerNodes []PathToLeaf + Leaves []proofLeafNode + LeftPath PathToLeaf + func (proof *RangeProof) ComputeRootHash() []byte + func (proof *RangeProof) Keys() (keys [][]byte) + func (proof *RangeProof) LeftIndex() int64 + func (proof *RangeProof) String() string + func (proof *RangeProof) StringIndented(indent string) string + func (proof *RangeProof) Verify(root []byte) error + func (proof *RangeProof) VerifyAbsence(key []byte) error + func (proof *RangeProof) VerifyItem(key, value []byte) error