builtin

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: 8 Imported by: 1

README

Actors

This package contains shims for abstracting over different actor versions.

Design

Shims in this package follow a few common design principles.

Structure Agnostic

Shims interfaces defined in this package should (ideally) not change even if the structure of the underlying data changes. For example:

  • All shims store an internal "store" object. That way, state can be moved into a separate object without needing to add a store to the function signature.
  • All functions must return an error, even if unused for now.
Minimal

These interfaces should be expanded only as necessary to reduce maintenance burden.

Queries, not field assessors.

When possible, functions should query the state instead of simply acting as field assessors. These queries are more likely to remain stable across specs-actor upgrades than specific state fields.

Note: there is a trade-off here. Avoid implementing complicated query logic inside these shims, as it will need to be replicated in every shim.

Documentation

Index

Constants

View Source
const (
	EpochDurationSeconds = builtin.EpochDurationSeconds
	EpochsInDay          = builtin.EpochsInDay
	SecondsInDay         = builtin.SecondsInDay
)
View Source
const (
	MethodSend        = builtin.MethodSend
	MethodConstructor = builtin.MethodConstructor
)

Variables

View Source
var (
	FoundationIDAddress      = makeAddress("f080")
	InvestorIDAddress        = makeAddress("f081")
	TeamIDAddress            = makeAddress("f082")
	DefaultGovernorIDAddress = makeAddress("f083")
)
View Source
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
View Source
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
View Source
var CronActorAddr = builtin.CronActorAddr
View Source
var (
	ExpectedLeadersPerEpoch = builtin.ExpectedLeadersPerEpoch
)
View Source
var SystemActorAddr = builtin.SystemActorAddr

Functions

func ActorNameByCode

func ActorNameByCode(c cid.Cid) string

func IsAccountActor

func IsAccountActor(c cid.Cid) bool

func IsBuiltinActor

func IsBuiltinActor(c cid.Cid) bool

func IsExpertActor

func IsExpertActor(c cid.Cid) bool

func IsFlowChannelActor

func IsFlowChannelActor(c cid.Cid) bool

func IsMultisigActor

func IsMultisigActor(c cid.Cid) bool

func IsPaymentChannelActor

func IsPaymentChannelActor(c cid.Cid) bool

func IsStorageMarketActor

func IsStorageMarketActor(c cid.Cid) bool

func IsStorageMinerActor

func IsStorageMinerActor(c cid.Cid) bool

func Load

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

func RegisterActorState

func RegisterActorState(code cid.Cid, loader ActorStateLoader)

Types

type ActorStateLoader

type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)

type PoStProof

type PoStProof = proof.PoStProof

type SectorInfo

type SectorInfo = proof.SectorInfo

TODO: Why does actors have 2 different versions of this?

Jump to

Keyboard shortcuts

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