state

package
v1.29.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0, MIT Imports: 21 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff added in v0.7.2

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

func VersionForNetwork added in v0.9.0

func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error)

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

Types

type AdtStore added in v0.3.0

type AdtStore struct{ cbor.IpldStore }

func (*AdtStore) Context added in v0.3.0

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 added in v0.3.0

func (st *StateTree) ClearSnapshot()

func (*StateTree) DeleteActor added in v0.3.0

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

func (*StateTree) Flush

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

func (*StateTree) ForEach added in v0.5.0

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) LookupIDAddress added in v1.27.0

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

LookupIDAddress 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 added in v0.8.0

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