mpt

package
v0.0.0-...-5fa8bf8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullNode

type FullNode struct {
	Children [257]Node
	// contains filtered or unexported fields
}

func (*FullNode) CachedHash

func (n *FullNode) CachedHash() []byte

func (*FullNode) Hash

func (fn *FullNode) Hash() []byte

func (*FullNode) Save

func (fn *FullNode) Save(kv stateStorage.StateStorage)

func (*FullNode) Serialize

func (fn *FullNode) Serialize() []byte

type HashNode

type HashNode []byte

func (*HashNode) CachedHash

func (n *HashNode) CachedHash() []byte

func (*HashNode) Hash

func (hn *HashNode) Hash() []byte

func (*HashNode) Save

func (hn *HashNode) Save(kv stateStorage.StateStorage)

func (*HashNode) Serialize

func (hn *HashNode) Serialize() []byte

type Node

type Node interface {
	Hash() []byte
	CachedHash() []byte
	Serialize() []byte
	Save(stateStorage.StateStorage)
}

func DeserializeNode

func DeserializeNode(data []byte) (Node, error)

type PersistFullNode

type PersistFullNode struct {
	Children             [][]byte `protobuf:"bytes,1,rep,name=Children,proto3" json:"Children,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PersistFullNode) Descriptor

func (*PersistFullNode) Descriptor() ([]byte, []int)

func (*PersistFullNode) GetChildren

func (m *PersistFullNode) GetChildren() [][]byte

func (*PersistFullNode) ProtoMessage

func (*PersistFullNode) ProtoMessage()

func (*PersistFullNode) Reset

func (m *PersistFullNode) Reset()

func (*PersistFullNode) String

func (m *PersistFullNode) String() string

func (*PersistFullNode) XXX_DiscardUnknown

func (m *PersistFullNode) XXX_DiscardUnknown()

func (*PersistFullNode) XXX_Marshal

func (m *PersistFullNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PersistFullNode) XXX_Merge

func (m *PersistFullNode) XXX_Merge(src proto.Message)

func (*PersistFullNode) XXX_Size

func (m *PersistFullNode) XXX_Size() int

func (*PersistFullNode) XXX_Unmarshal

func (m *PersistFullNode) XXX_Unmarshal(b []byte) error

type PersistKV

type PersistKV struct {
	Key                  []byte   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value                []byte   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PersistKV) Descriptor

func (*PersistKV) Descriptor() ([]byte, []int)

func (*PersistKV) GetKey

func (m *PersistKV) GetKey() []byte

func (*PersistKV) GetValue

func (m *PersistKV) GetValue() []byte

func (*PersistKV) ProtoMessage

func (*PersistKV) ProtoMessage()

func (*PersistKV) Reset

func (m *PersistKV) Reset()

func (*PersistKV) String

func (m *PersistKV) String() string

func (*PersistKV) XXX_DiscardUnknown

func (m *PersistKV) XXX_DiscardUnknown()

func (*PersistKV) XXX_Marshal

func (m *PersistKV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PersistKV) XXX_Merge

func (m *PersistKV) XXX_Merge(src proto.Message)

func (*PersistKV) XXX_Size

func (m *PersistKV) XXX_Size() int

func (*PersistKV) XXX_Unmarshal

func (m *PersistKV) XXX_Unmarshal(b []byte) error

type PersistNode

type PersistNode struct {
	// Types that are valid to be assigned to Content:
	//	*PersistNode_Full
	//	*PersistNode_Short
	//	*PersistNode_Value
	Content              isPersistNode_Content `protobuf_oneof:"Content"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

func (*PersistNode) Descriptor

func (*PersistNode) Descriptor() ([]byte, []int)

func (*PersistNode) GetContent

func (m *PersistNode) GetContent() isPersistNode_Content

func (*PersistNode) GetFull

func (m *PersistNode) GetFull() *PersistFullNode

func (*PersistNode) GetShort

func (m *PersistNode) GetShort() *PersistShortNode

func (*PersistNode) GetValue

func (m *PersistNode) GetValue() []byte

func (*PersistNode) ProtoMessage

func (*PersistNode) ProtoMessage()

func (*PersistNode) Reset

func (m *PersistNode) Reset()

func (*PersistNode) String

func (m *PersistNode) String() string

func (*PersistNode) XXX_DiscardUnknown

func (m *PersistNode) XXX_DiscardUnknown()

func (*PersistNode) XXX_Marshal

func (m *PersistNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PersistNode) XXX_Merge

func (m *PersistNode) XXX_Merge(src proto.Message)

func (*PersistNode) XXX_OneofWrappers

func (*PersistNode) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*PersistNode) XXX_Size

func (m *PersistNode) XXX_Size() int

func (*PersistNode) XXX_Unmarshal

func (m *PersistNode) XXX_Unmarshal(b []byte) error

type PersistNode_Full

type PersistNode_Full struct {
	Full *PersistFullNode `protobuf:"bytes,1,opt,name=full,proto3,oneof"`
}

type PersistNode_Short

type PersistNode_Short struct {
	Short *PersistShortNode `protobuf:"bytes,2,opt,name=short,proto3,oneof"`
}

type PersistNode_Value

type PersistNode_Value struct {
	Value []byte `protobuf:"bytes,3,opt,name=value,proto3,oneof"`
}

type PersistShortNode

type PersistShortNode struct {
	Key                  []byte   `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Value                []byte   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PersistShortNode) Descriptor

func (*PersistShortNode) Descriptor() ([]byte, []int)

func (*PersistShortNode) GetKey

func (m *PersistShortNode) GetKey() []byte

func (*PersistShortNode) GetValue

func (m *PersistShortNode) GetValue() []byte

func (*PersistShortNode) ProtoMessage

func (*PersistShortNode) ProtoMessage()

func (*PersistShortNode) Reset

func (m *PersistShortNode) Reset()

func (*PersistShortNode) String

func (m *PersistShortNode) String() string

func (*PersistShortNode) XXX_DiscardUnknown

func (m *PersistShortNode) XXX_DiscardUnknown()

func (*PersistShortNode) XXX_Marshal

func (m *PersistShortNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PersistShortNode) XXX_Merge

func (m *PersistShortNode) XXX_Merge(src proto.Message)

func (*PersistShortNode) XXX_Size

func (m *PersistShortNode) XXX_Size() int

func (*PersistShortNode) XXX_Unmarshal

func (m *PersistShortNode) XXX_Unmarshal(b []byte) error

type PersistTrie

type PersistTrie struct {
	Pairs                []*PersistKV `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*PersistTrie) Descriptor

func (*PersistTrie) Descriptor() ([]byte, []int)

func (*PersistTrie) GetPairs

func (m *PersistTrie) GetPairs() []*PersistKV

func (*PersistTrie) ProtoMessage

func (*PersistTrie) ProtoMessage()

func (*PersistTrie) Reset

func (m *PersistTrie) Reset()

func (*PersistTrie) String

func (m *PersistTrie) String() string

func (*PersistTrie) XXX_DiscardUnknown

func (m *PersistTrie) XXX_DiscardUnknown()

func (*PersistTrie) XXX_Marshal

func (m *PersistTrie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PersistTrie) XXX_Merge

func (m *PersistTrie) XXX_Merge(src proto.Message)

func (*PersistTrie) XXX_Size

func (m *PersistTrie) XXX_Size() int

func (*PersistTrie) XXX_Unmarshal

func (m *PersistTrie) XXX_Unmarshal(b []byte) error

type ShortNode

type ShortNode struct {
	Key   []byte
	Value Node
	// contains filtered or unexported fields
}

func (*ShortNode) CachedHash

func (n *ShortNode) CachedHash() []byte

func (*ShortNode) Hash

func (sn *ShortNode) Hash() []byte

func (*ShortNode) Save

func (sn *ShortNode) Save(kv stateStorage.StateStorage)

func (*ShortNode) Serialize

func (sn *ShortNode) Serialize() []byte

type Trie

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

func New

func New(root Node, kv stateStorage.StateStorage) *Trie

func (*Trie) Abort

func (t *Trie) Abort()

func (*Trie) Close

func (t *Trie) Close() error

func (*Trie) Commit

func (t *Trie) Commit()

func (*Trie) Deserialize

func (t *Trie) Deserialize(data []byte) error

func (*Trie) Get

func (t *Trie) Get(key []byte) ([]byte, error)

func (*Trie) Put

func (t *Trie) Put(key, value []byte) error

func (*Trie) RootHash

func (t *Trie) RootHash() []byte

func (*Trie) Serialize

func (t *Trie) Serialize() ([]byte, error)

type ValueNode

type ValueNode struct {
	Value []byte
	// contains filtered or unexported fields
}

func (*ValueNode) CachedHash

func (n *ValueNode) CachedHash() []byte

func (*ValueNode) Hash

func (vn *ValueNode) Hash() []byte

func (*ValueNode) Save

func (vn *ValueNode) Save(kv stateStorage.StateStorage)

func (*ValueNode) Serialize

func (vn *ValueNode) Serialize() []byte

Jump to

Keyboard shortcuts

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