init

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0, MIT Imports: 43 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AllCodes added in v1.20.0

func AllCodes() []cid.Cid

Types

type AddressChange added in v1.2.0

type AddressChange struct {
	From AddressPair
	To   AddressPair
}

type AddressMapChanges added in v1.2.0

type AddressMapChanges struct {
	Added    []AddressPair
	Modified []AddressChange
	Removed  []AddressPair
}

func DiffAddressMap added in v1.2.0

func DiffAddressMap(pre, cur State) (*AddressMapChanges, error)

type AddressPair added in v1.2.0

type AddressPair struct {
	ID address.Address
	PK address.Address
}

type State

type State interface {
	cbor.Marshaler

	Code() cid.Cid
	ActorKey() string
	ActorVersion() actorstypes.Version

	ResolveAddress(address address.Address) (address.Address, bool, error)
	MapAddressToNewID(address address.Address) (address.Address, error)
	NetworkName() (dtypes.NetworkName, error)

	ForEachActor(func(id abi.ActorID, address address.Address) error) error

	// Remove exists to support tooling that manipulates state for testing.
	// It should not be used in production code, as init actor entries are
	// immutable.
	Remove(addrs ...address.Address) error

	// Sets the network's name. This should only be used on upgrade/fork.
	SetNetworkName(name string) error

	// Sets the next ID for the init actor. This should only be used for testing.
	SetNextID(id abi.ActorID) error

	// Sets the address map for the init actor. This should only be used for testing.
	SetAddressMap(mcid cid.Cid) error

	GetState() interface{}

	AddressMap() (adt.Map, error)
	AddressMapBitWidth() int
	AddressMapHashFunction() func(input []byte) []byte
}

func Load

func Load(store adt.Store, act *types.Actor) (State, error)

func MakeState added in v1.11.0

func MakeState(store adt.Store, av actorstypes.Version, networkName string) (State, error)

Jump to

Keyboard shortcuts

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