store

package
v0.0.0-...-c9960b4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Value  []byte
	Childs map[rune]*Node
}

Node 节点

type State

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

func InitState

func InitState() *State

func (*State) GetAccount

func (s *State) GetAccount(addr string) []byte

func (*State) GetStateRoot

func (s *State) GetStateRoot() []byte

func (*State) UpdateAccount

func (s *State) UpdateAccount(addr string, data []byte)

type Trie

type Trie struct {
	RootHash []byte
	Head     *Node
}

Trie 树

func DeserializeTrie

func DeserializeTrie(data []byte) *Trie

DeserializeTrie 反序列化

func InitTrie

func InitTrie() *Trie

func (*Trie) GenRootHash

func (t *Trie) GenRootHash()

func (*Trie) Get

func (t *Trie) Get(key string) (*Node, error)

func (*Trie) SerializeTrie

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

SerializeTrie 序列化

func (*Trie) Update

func (t *Trie) Update(key string, value []byte)

Jump to

Keyboard shortcuts

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