state

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpmtIndex = "spmt-index"
	Nodes     = "spmt-nodes"
	Values    = "spmt-values"
)
View Source
const (
	SetOp = iota
	DeleteOp
)

Variables

View Source
var (
	EmptyRoot = HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
)

Functions

This section is empty.

Types

type IState

type IState interface {
	Set(triName NameString, key, value []byte)
	Delete(triName NameString, key []byte)
	Get(triName NameString, key []byte) ([]byte, error)
	GetFinalized(triName NameString, key []byte) ([]byte, error)
	Exist(triName NameString, key []byte) bool
	GetByBlockHash(triName NameString, key []byte, block *types.Block) ([]byte, error)
	Commit() ([]byte, error)
	NextTxn()
	Discard()
	DiscardAll()
	StartBlock(block *types.Block)
	FinalizeBlock(block *types.Block)
}

TODO: need to add prove() and verify()

func NewSpmtKV

func NewSpmtKV(root []byte, kvdb kv.Kvdb) IState

func NewStateDB

func NewStateDB(typ string, kvdb kv.Kvdb) IState

type KvStash

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

type NameString

type NameString interface {
	Name() string
}

type NoStateDB added in v1.0.12

type NoStateDB struct {
}

func (*NoStateDB) Commit added in v1.0.12

func (n *NoStateDB) Commit() ([]byte, error)

func (*NoStateDB) Delete added in v1.0.12

func (n *NoStateDB) Delete(triName NameString, key []byte)

func (*NoStateDB) Discard added in v1.0.12

func (n *NoStateDB) Discard()

func (*NoStateDB) DiscardAll added in v1.0.12

func (n *NoStateDB) DiscardAll()

func (*NoStateDB) Exist added in v1.0.12

func (n *NoStateDB) Exist(triName NameString, key []byte) bool

func (*NoStateDB) FinalizeBlock added in v1.0.12

func (n *NoStateDB) FinalizeBlock(block *types.Block)

func (*NoStateDB) Get added in v1.0.12

func (n *NoStateDB) Get(triName NameString, key []byte) ([]byte, error)

func (*NoStateDB) GetByBlockHash added in v1.0.12

func (n *NoStateDB) GetByBlockHash(triName NameString, key []byte, block *types.Block) ([]byte, error)

func (*NoStateDB) GetFinalized added in v1.0.12

func (n *NoStateDB) GetFinalized(triName NameString, key []byte) ([]byte, error)

func (*NoStateDB) NextTxn added in v1.0.12

func (n *NoStateDB) NextTxn()

func (*NoStateDB) Set added in v1.0.12

func (n *NoStateDB) Set(triName NameString, key, value []byte)

func (*NoStateDB) StartBlock added in v1.0.12

func (n *NoStateDB) StartBlock(block *types.Block)

type Ops

type Ops int

type SpmtKV

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

func (*SpmtKV) Commit

func (skv *SpmtKV) Commit() ([]byte, error)

Commit returns StateRoot or error

func (*SpmtKV) Delete

func (skv *SpmtKV) Delete(triName NameString, key []byte)

func (*SpmtKV) Discard

func (skv *SpmtKV) Discard()

func (*SpmtKV) DiscardAll

func (skv *SpmtKV) DiscardAll()

func (*SpmtKV) Exist

func (skv *SpmtKV) Exist(triName NameString, key []byte) bool

func (*SpmtKV) FinalizeBlock

func (skv *SpmtKV) FinalizeBlock(block *types.Block)

func (*SpmtKV) Get

func (skv *SpmtKV) Get(triName NameString, key []byte) ([]byte, error)

func (*SpmtKV) GetByBlockHash

func (skv *SpmtKV) GetByBlockHash(triName NameString, key []byte, block *types.Block) ([]byte, error)

FIXME

func (*SpmtKV) GetFinalized

func (skv *SpmtKV) GetFinalized(triName NameString, key []byte) ([]byte, error)

func (*SpmtKV) NextTxn

func (skv *SpmtKV) NextTxn()

func (*SpmtKV) Set

func (skv *SpmtKV) Set(triName NameString, key, value []byte)

func (*SpmtKV) StartBlock

func (skv *SpmtKV) StartBlock(block *types.Block)

type TxnStashes

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

Jump to

Keyboard shortcuts

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