Documentation ¶
Index ¶
- func PrefixLength(a, b []byte) int
- type MTP
- func (mtp *MTP) ContainsKey(key []byte) bool
- func (mtp *MTP) FindParents(key []byte) (parentHashes [][]byte, prefixs [][]byte, err error)
- func (mtp *MTP) GetInterfaceValue(key []byte, v interface{}) error
- func (mtp *MTP) GetNode(hash []byte) (*TrieNode, error)
- func (mtp *MTP) GetValue(key []byte) (value []byte, err error)
- func (mtp *MTP) GetValueByKey(key []byte) (value []byte, err error)
- func (mtp MTP) MarshalJSON() ([]byte, error)
- func (mtp *MTP) MustInsert(key, value []byte) error
- func (mtp *MTP) SaveNode(node TrieNode) (nodeHash []byte, err error)
- func (mtp *MTP) SaveValue(value []byte) ([]byte, error)
- func (mtp *MTP) TryInsert(key, value []byte, parentHashes, prefixs [][]byte) error
- func (mtp *MTP) UnmarshalJSON(data []byte) error
- func (mtp *MTP) Update(key, value []byte, parentHashes [][]byte, prefixs [][]byte) error
- type SortedSon
- type TrieNode
- type TrieSonInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MTP ¶
type MTP struct { Root types.HexBytes DB db.IKVDatabase }
func NewMTP ¶
func NewMTP(db db.IKVDatabase) *MTP
func (*MTP) ContainsKey ¶
func (*MTP) FindParents ¶
func (*MTP) GetInterfaceValue ¶
func (MTP) MarshalJSON ¶
func (*MTP) MustInsert ¶
* *把Key和Value插入到root对应的树上 * *首先搜索到要插入的节点,插入之后向上回溯寻找自己的Parent节点更新,直至root节点
func (*MTP) UnmarshalJSON ¶
type SortedSon ¶
type SortedSon []TrieSonInfo
Click to show internal directories.
Click to hide internal directories.