Documentation ¶
Index ¶
- func CheckActorExports(t *testing.T, act interface{ ... })
- type ReturnWrapper
- type Runtime
- func (rt *Runtime) AbortStateMsg(msg string)
- func (rt *Runtime) Abortf(errExitCode exitcode.ExitCode, msg string, args ...interface{})
- func (rt *Runtime) AddIDAddress(src addr.Address, target addr.Address)
- func (rt *Runtime) AdtStore() adt.Store
- func (rt *Runtime) Balance() abi.TokenAmount
- func (rt *Runtime) BatchVerifySeals(vis map[address.Address][]abi.SealVerifyInfo) (map[address.Address][]bool, error)
- func (rt *Runtime) BlockMiner() addr.Address
- func (rt *Runtime) Call(method interface{}, params interface{}) interface{}
- func (rt *Runtime) Caller() addr.Address
- func (rt *Runtime) ComputeUnsealedSectorCID(reg abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error)
- func (rt *Runtime) Context() context.Context
- func (rt *Runtime) Create(obj runtime.CBORMarshaler)
- func (rt *Runtime) CreateActor(codeId cid.Cid, address addr.Address)
- func (rt *Runtime) CurrEpoch() abi.ChainEpoch
- func (rt *Runtime) CurrentBalance() abi.TokenAmount
- func (rt *Runtime) DeleteActor(_ addr.Address)
- func (rt *Runtime) Epoch() abi.ChainEpoch
- func (rt *Runtime) ExpectAbort(expected exitcode.ExitCode, f func())
- func (rt *Runtime) ExpectAssertionFailure(expected string, f func())
- func (rt *Runtime) ExpectCreateActor(codeId cid.Cid, address addr.Address)
- func (rt *Runtime) ExpectGetRandomness(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, ...)
- func (rt *Runtime) ExpectSend(toAddr addr.Address, methodNum abi.MethodNum, params runtime.CBORMarshaler, ...)
- func (rt *Runtime) ExpectValidateCallerAddr(addrs ...addr.Address)
- func (rt *Runtime) ExpectValidateCallerAny()
- func (rt *Runtime) ExpectValidateCallerType(types ...cid.Cid)
- func (rt *Runtime) ExpectVerifyPoSt(post abi.WindowPoStVerifyInfo, result error)
- func (rt *Runtime) ExpectVerifySeal(seal abi.SealVerifyInfo, result error)
- func (rt *Runtime) ExpectVerifySignature(sig crypto.Signature, signer addr.Address, plaintext []byte, result error)
- func (rt *Runtime) Get(c cid.Cid, o runtime.CBORUnmarshaler) bool
- func (rt *Runtime) GetActorCodeCID(addr addr.Address) (ret cid.Cid, ok bool)
- func (rt *Runtime) GetRandomness(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
- func (rt *Runtime) GetState(o runtime.CBORUnmarshaler)
- func (rt *Runtime) HashBlake2b(data []byte) [32]byte
- func (rt *Runtime) Message() runtime.Message
- func (rt *Runtime) NewActorAddress() addr.Address
- func (rt *Runtime) Put(o runtime.CBORMarshaler) cid.Cid
- func (rt *Runtime) Readonly(st runtime.CBORUnmarshaler)
- func (rt *Runtime) Receiver() addr.Address
- func (rt *Runtime) Reset()
- func (rt *Runtime) ResolveAddress(address addr.Address) (ret addr.Address, ok bool)
- func (rt *Runtime) Send(toAddr addr.Address, methodNum abi.MethodNum, params runtime.CBORMarshaler, ...) (runtime.SendReturn, exitcode.ExitCode)
- func (rt *Runtime) SetBalance(amt abi.TokenAmount)
- func (rt *Runtime) SetCaller(address addr.Address, actorType cid.Cid)
- func (rt *Runtime) SetEpoch(epoch abi.ChainEpoch)
- func (rt *Runtime) SetHasher(f func(data []byte) [32]byte)
- func (rt *Runtime) SetNewActorAddress(actAddr addr.Address)
- func (rt *Runtime) SetReceived(amt abi.TokenAmount)
- func (rt *Runtime) StartSpan(_ string) runtime.TraceSpan
- func (rt *Runtime) State() runtime.StateHandle
- func (rt *Runtime) StateRoot() cid.Cid
- func (rt *Runtime) Store() runtime.Store
- func (rt *Runtime) Syscalls() runtime.Syscalls
- func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
- func (rt *Runtime) Transaction(st runtime.CBORer, f func() interface{}) interface{}
- func (rt *Runtime) ValidateImmediateCallerAcceptAny()
- func (rt *Runtime) ValidateImmediateCallerIs(addrs ...addr.Address)
- func (rt *Runtime) ValidateImmediateCallerType(types ...cid.Cid)
- func (rt *Runtime) ValueReceived() abi.TokenAmount
- func (rt *Runtime) Verify()
- func (rt *Runtime) VerifyConsensusFault(h1, h2, extra []byte) (*runtime.ConsensusFault, error)
- func (rt *Runtime) VerifyPoSt(vi abi.WindowPoStVerifyInfo) error
- func (rt *Runtime) VerifySeal(seal abi.SealVerifyInfo) error
- func (rt *Runtime) VerifySignature(sig crypto.Signature, signer addr.Address, plaintext []byte) error
- type RuntimeBuilder
- func (b *RuntimeBuilder) Build(t testing.TB) *Runtime
- func (b *RuntimeBuilder) WithActorType(addr addr.Address, code cid.Cid) *RuntimeBuilder
- func (b *RuntimeBuilder) WithBalance(balance, received abi.TokenAmount) *RuntimeBuilder
- func (b *RuntimeBuilder) WithCaller(address addr.Address, code cid.Cid) *RuntimeBuilder
- func (b *RuntimeBuilder) WithEpoch(epoch abi.ChainEpoch) *RuntimeBuilder
- func (b *RuntimeBuilder) WithHasher(f func(data []byte) [32]byte) *RuntimeBuilder
- func (b *RuntimeBuilder) WithMiner(miner addr.Address) *RuntimeBuilder
- type TraceSpan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckActorExports ¶
Types ¶
type ReturnWrapper ¶
type ReturnWrapper struct {
V runtime.CBORMarshaler
}
func (ReturnWrapper) Into ¶
func (r ReturnWrapper) Into(o runtime.CBORUnmarshaler) error
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
A mock runtime for unit testing of actors in isolation. The mock allows direct specification of the runtime context as observable by an actor, supports the storage interface, and mocks out side-effect-inducing calls.
func (*Runtime) AbortStateMsg ¶
func (*Runtime) AddIDAddress ¶
func (*Runtime) Balance ¶
func (rt *Runtime) Balance() abi.TokenAmount
func (*Runtime) BatchVerifySeals ¶ added in v0.5.4
func (rt *Runtime) BatchVerifySeals(vis map[address.Address][]abi.SealVerifyInfo) (map[address.Address][]bool, error)
func (*Runtime) BlockMiner ¶
func (*Runtime) ComputeUnsealedSectorCID ¶
func (*Runtime) Create ¶
func (rt *Runtime) Create(obj runtime.CBORMarshaler)
func (*Runtime) CurrEpoch ¶
func (rt *Runtime) CurrEpoch() abi.ChainEpoch
func (*Runtime) CurrentBalance ¶
func (rt *Runtime) CurrentBalance() abi.TokenAmount
func (*Runtime) DeleteActor ¶
func (*Runtime) Epoch ¶
func (rt *Runtime) Epoch() abi.ChainEpoch
func (*Runtime) ExpectAbort ¶
Calls f() expecting it to invoke Runtime.Abortf() with a specified exit code.
func (*Runtime) ExpectAssertionFailure ¶
func (*Runtime) ExpectCreateActor ¶
func (*Runtime) ExpectGetRandomness ¶
func (rt *Runtime) ExpectGetRandomness(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, out abi.Randomness)
func (*Runtime) ExpectSend ¶
func (rt *Runtime) ExpectSend(toAddr addr.Address, methodNum abi.MethodNum, params runtime.CBORMarshaler, value abi.TokenAmount, ret runtime.CBORMarshaler, exitCode exitcode.ExitCode)
func (*Runtime) ExpectValidateCallerAddr ¶
func (*Runtime) ExpectValidateCallerAny ¶
func (rt *Runtime) ExpectValidateCallerAny()
func (*Runtime) ExpectValidateCallerType ¶
func (*Runtime) ExpectVerifyPoSt ¶ added in v0.5.1
func (rt *Runtime) ExpectVerifyPoSt(post abi.WindowPoStVerifyInfo, result error)
func (*Runtime) ExpectVerifySeal ¶ added in v0.5.1
func (rt *Runtime) ExpectVerifySeal(seal abi.SealVerifyInfo, result error)
func (*Runtime) ExpectVerifySignature ¶
func (*Runtime) GetActorCodeCID ¶
func (*Runtime) GetRandomness ¶
func (rt *Runtime) GetRandomness(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) GetState ¶
func (rt *Runtime) GetState(o runtime.CBORUnmarshaler)
func (*Runtime) HashBlake2b ¶
func (*Runtime) NewActorAddress ¶
func (*Runtime) Readonly ¶
func (rt *Runtime) Readonly(st runtime.CBORUnmarshaler)
func (*Runtime) ResolveAddress ¶
func (*Runtime) Send ¶
func (rt *Runtime) Send(toAddr addr.Address, methodNum abi.MethodNum, params runtime.CBORMarshaler, value abi.TokenAmount) (runtime.SendReturn, exitcode.ExitCode)
func (*Runtime) SetBalance ¶
func (rt *Runtime) SetBalance(amt abi.TokenAmount)
func (*Runtime) SetEpoch ¶
func (rt *Runtime) SetEpoch(epoch abi.ChainEpoch)
func (*Runtime) SetNewActorAddress ¶
func (*Runtime) SetReceived ¶
func (rt *Runtime) SetReceived(amt abi.TokenAmount)
func (*Runtime) State ¶
func (rt *Runtime) State() runtime.StateHandle
func (*Runtime) TotalFilCircSupply ¶
func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
func (*Runtime) Transaction ¶
func (*Runtime) ValidateImmediateCallerAcceptAny ¶
func (rt *Runtime) ValidateImmediateCallerAcceptAny()
func (*Runtime) ValidateImmediateCallerIs ¶
func (*Runtime) ValidateImmediateCallerType ¶
func (*Runtime) ValueReceived ¶
func (rt *Runtime) ValueReceived() abi.TokenAmount
func (*Runtime) Verify ¶
func (rt *Runtime) Verify()
Verifies that expected calls were received, and resets all expectations.
func (*Runtime) VerifyConsensusFault ¶
func (rt *Runtime) VerifyConsensusFault(h1, h2, extra []byte) (*runtime.ConsensusFault, error)
func (*Runtime) VerifyPoSt ¶
func (rt *Runtime) VerifyPoSt(vi abi.WindowPoStVerifyInfo) error
func (*Runtime) VerifySeal ¶
func (rt *Runtime) VerifySeal(seal abi.SealVerifyInfo) error
type RuntimeBuilder ¶
type RuntimeBuilder struct {
// contains filtered or unexported fields
}
Build for fluent initialization of a mock runtime.
func NewBuilder ¶
func NewBuilder(ctx context.Context, receiver addr.Address) *RuntimeBuilder
Initializes a new builder with a receiving actor address.
func (*RuntimeBuilder) Build ¶
func (b *RuntimeBuilder) Build(t testing.TB) *Runtime
Builds a new runtime object with the configured values.
func (*RuntimeBuilder) WithActorType ¶
func (b *RuntimeBuilder) WithActorType(addr addr.Address, code cid.Cid) *RuntimeBuilder
func (*RuntimeBuilder) WithBalance ¶
func (b *RuntimeBuilder) WithBalance(balance, received abi.TokenAmount) *RuntimeBuilder
func (*RuntimeBuilder) WithCaller ¶
func (b *RuntimeBuilder) WithCaller(address addr.Address, code cid.Cid) *RuntimeBuilder
func (*RuntimeBuilder) WithEpoch ¶
func (b *RuntimeBuilder) WithEpoch(epoch abi.ChainEpoch) *RuntimeBuilder
func (*RuntimeBuilder) WithHasher ¶
func (b *RuntimeBuilder) WithHasher(f func(data []byte) [32]byte) *RuntimeBuilder
func (*RuntimeBuilder) WithMiner ¶
func (b *RuntimeBuilder) WithMiner(miner addr.Address) *RuntimeBuilder
Click to show internal directories.
Click to hide internal directories.