state

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(oldTree, newTree *StateTree) (map[string]types.Actor, error)

func VersionForNetwork

func VersionForNetwork(ver network.Version) types.StateTreeVersion

VersionForNetwork returns the state tree version for the given network version.

Types

type AdtStore

type AdtStore struct{ cbor.IpldStore }

func (*AdtStore) Context

func (a *AdtStore) Context() context.Context

type StateTree

type StateTree struct {
	Store cbor.IpldStore
	// contains filtered or unexported fields
}

StateTree stores actors state by their ID.

func LoadStateTree

func LoadStateTree(cst cbor.IpldStore, c cid.Cid) (*StateTree, error)

func NewStateTree

func NewStateTree(cst cbor.IpldStore, ver types.StateTreeVersion) (*StateTree, error)

func (*StateTree) ClearSnapshot

func (st *StateTree) ClearSnapshot()

func (*StateTree) DeleteActor

func (st *StateTree) DeleteActor(addr address.Address) error

func (*StateTree) Flush

func (st *StateTree) Flush(ctx context.Context) (cid.Cid, error)

func (*StateTree) ForEach

func (st *StateTree) ForEach(f func(address.Address, *types.Actor) error) error

func (*StateTree) GetActor

func (st *StateTree) GetActor(addr address.Address) (*types.Actor, error)

GetActor returns the actor from any type of `addr` provided.

func (*StateTree) LookupID

func (st *StateTree) LookupID(addr address.Address) (address.Address, error)

LookupID gets the ID address of this actor's `addr` stored in the `InitActor`.

func (*StateTree) MutateActor

func (st *StateTree) MutateActor(addr address.Address, f func(*types.Actor) error) error

func (*StateTree) RegisterNewAddress

func (st *StateTree) RegisterNewAddress(addr address.Address) (address.Address, error)

func (*StateTree) Revert

func (st *StateTree) Revert() error

func (*StateTree) SetActor

func (st *StateTree) SetActor(addr address.Address, act *types.Actor) error

func (*StateTree) Snapshot

func (st *StateTree) Snapshot(ctx context.Context) error

func (*StateTree) Version

func (st *StateTree) Version() types.StateTreeVersion

Version returns the version of the StateTree data structure in use.

Jump to

Keyboard shortcuts

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