init

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0, MIT Imports: 13 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAddressNotFound = errors.New("address not found")

Functions

This section is empty.

Types

type Actor

type Actor struct{}

The init actor uniquely has the power to create new actors. It maintains a table resolving pubkey and temporary actor addresses to the canonical ID-addresses.

func (Actor) Constructor

func (a Actor) Constructor(rt runtime.Runtime, params *ConstructorParams) *adt.EmptyValue

func (Actor) Exec

func (a Actor) Exec(rt runtime.Runtime, params *ExecParams) *ExecReturn

func (Actor) Exports

func (a Actor) Exports() []interface{}

type AddrKey

type AddrKey = adt.AddrKey

type ConstructorParams

type ConstructorParams struct {
	NetworkName string
}

func (*ConstructorParams) MarshalCBOR

func (t *ConstructorParams) MarshalCBOR(w io.Writer) error

func (*ConstructorParams) UnmarshalCBOR

func (t *ConstructorParams) UnmarshalCBOR(r io.Reader) error

type ExecParams

type ExecParams struct {
	CodeCID           cid.Cid
	ConstructorParams []byte
}

func (*ExecParams) MarshalCBOR

func (t *ExecParams) MarshalCBOR(w io.Writer) error

func (*ExecParams) UnmarshalCBOR

func (t *ExecParams) UnmarshalCBOR(r io.Reader) error

type ExecReturn

type ExecReturn struct {
	IDAddress     addr.Address // The canonical ID-based address for the actor.
	RobustAddress addr.Address // A more expensive but re-org-safe address for the newly created actor.
}

func (*ExecReturn) MarshalCBOR

func (t *ExecReturn) MarshalCBOR(w io.Writer) error

func (*ExecReturn) UnmarshalCBOR

func (t *ExecReturn) UnmarshalCBOR(r io.Reader) error

type State

type State struct {
	AddressMap  cid.Cid // HAMT[addr.Address]abi.ActorID
	NextID      abi.ActorID
	NetworkName string
}

func ConstructState

func ConstructState(addressMapRoot cid.Cid, networkName string) *State

func (*State) MapAddressToNewID

func (s *State) MapAddressToNewID(store adt.Store, address addr.Address) (addr.Address, error)

Allocates a new ID address and stores a mapping of the argument address to it. Returns the newly-allocated address.

func (*State) MarshalCBOR

func (t *State) MarshalCBOR(w io.Writer) error

func (*State) ResolveAddress

func (s *State) ResolveAddress(store adt.Store, address addr.Address) (addr.Address, error)

ResolveAddress resolves an address to an ID-address, if possible. If the provided address is an ID address, it is returned as-is. This means that ID-addresses (which should only appear as values, not keys) and singleton actor addresses pass through unchanged.

Post-condition: all addresses succesfully returned by this method satisfy `addr.Protocol() == addr.ID`.

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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