init

package
v0.16.0-dev Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Methods = map[abi.MethodNum]builtin.MethodMeta{
	1: builtin.NewMethodMeta("Constructor", *new(func(*ConstructorParams) *abi.EmptyValue)),
	2: builtin.NewMethodMeta("Exec", *new(func(*ExecParams) *ExecReturn)),

	3: builtin.NewMethodMeta("Exec4", *new(func(*Exec4Params) *ExecReturn)),
}

Functions

This section is empty.

Types

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) (err error)

type Exec4Params

type Exec4Params struct {
	CodeCID           cid.Cid `checked:"true"` // invalid CIDs won't get committed to the state tree
	ConstructorParams []byte
	SubAddress        []byte
}

func (*Exec4Params) MarshalCBOR

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

func (*Exec4Params) UnmarshalCBOR

func (t *Exec4Params) UnmarshalCBOR(r io.Reader) (err error)

type Exec4Return

type Exec4Return = ExecReturn

type ExecParams

type ExecParams struct {
	CodeCID           cid.Cid `checked:"true"` // invalid CIDs won't get committed to the state tree
	ConstructorParams []byte
}

func (*ExecParams) MarshalCBOR

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

func (*ExecParams) UnmarshalCBOR

func (t *ExecParams) UnmarshalCBOR(r io.Reader) (err 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) (err error)

type State

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

func ConstructState

func ConstructState(store adt.Store, networkName string) (*State, error)

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, bool, 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 mapped ID-addresses (which should only appear as values, not keys) and singleton actor addresses (which are not in the map) pass through unchanged.

Returns an ID-address and `true` if the address was already an ID-address or was resolved in the mapping. Returns an undefined address and `false` if the address was not an ID-address and not found in the mapping. Returns an error only if state was inconsistent.

func (*State) UnmarshalCBOR

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

type StateSummary

type StateSummary struct {
	AddrIDs map[addr.Address]abi.ActorID
	NextID  abi.ActorID
}

func CheckStateInvariants

func CheckStateInvariants(st *State, tree *builtin.ActorTree, actorCodes map[string]cid.Cid) (*StateSummary, *builtin.MessageAccumulator)

Checks internal invariants of init state.

Jump to

Keyboard shortcuts

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