db

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionSize = 8
)

Variables

View Source
var (
	ErrKeyNotFound = errors.New("types not found")
)

Functions

func RegisterAmino

func RegisterAmino(cdc *amino.Codec)

Types

type RWSet

type RWSet struct {
	Address types.AccAddress
	Items   *RWSetItems
}

type RWSetItems

type RWSetItems struct {
	ReadSet  []Read
	WriteSet []Write
}

type RWSetMap

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

func NewRWSetMap

func NewRWSetMap() *RWSetMap

func (*RWSetMap) AddRead

func (m *RWSetMap) AddRead(key []byte, version Version) bool

func (*RWSetMap) AddWrite

func (m *RWSetMap) AddWrite(key, value []byte)

func (*RWSetMap) GetRead

func (m *RWSetMap) GetRead(key []byte) (Read, bool)

func (*RWSetMap) ToItems

func (m *RWSetMap) ToItems() *RWSetItems

type RWSets

type RWSets []*RWSet

func (*RWSets) Add

func (rs *RWSets) Add(ss ...*RWSet)

func (RWSets) Bytes

func (rs RWSets) Bytes() ([]byte, error)

func (*RWSets) FromBytes

func (rs *RWSets) FromBytes(b []byte) error

func (RWSets) Hash

func (rs RWSets) Hash() []byte

type Read

type Read struct {
	Key     []byte
	Version Version
}

type StateDB

type StateDB interface {
	Set(k, v []byte) error
	Get(k []byte) ([]byte, error)
}

type StateManager

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

func NewStateManager

func NewStateManager(key sdk.StoreKey) *StateManager

type ValueObject

type ValueObject struct {
	Value   []byte
	Version Version
}

func BytesToValueObject

func BytesToValueObject(b []byte) (*ValueObject, error)

func (ValueObject) Marshal

func (vo ValueObject) Marshal() []byte

func (*ValueObject) Unmarshal

func (vo *ValueObject) Unmarshal(b []byte) error

type Version

type Version struct {
	Height uint32
	TxIdx  uint32
}

func MakeVersion

func MakeVersion(b []byte) (Version, error)

func (Version) Bytes

func (v Version) Bytes() []byte

type VersionedDB

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

func NewVersionedDB

func NewVersionedDB(store types.KVStore) *VersionedDB

func (*VersionedDB) Get

func (db *VersionedDB) Get(k []byte) ([]byte, error)

func (*VersionedDB) RWSetItems

func (db *VersionedDB) RWSetItems() *RWSetItems

func (*VersionedDB) Set

func (db *VersionedDB) Set(k, v []byte) error

type Write

type Write struct {
	Key   []byte
	Value []byte
}

Jump to

Keyboard shortcuts

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