Documentation ¶
Index ¶
- func CheckActorExports(t *testing.T, act interface{ ... })
- type Runtime
- 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[addr.Address][]proof.SealVerifyInfo) (map[addr.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) ChargeGas(_ string, gas, _ int64)
- func (rt *Runtime) ClearLogs()
- func (rt *Runtime) ComputeUnsealedSectorCID(reg abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error)
- func (rt *Runtime) Context() context.Context
- 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 addr.Address)
- func (rt *Runtime) Epoch() abi.ChainEpoch
- func (rt *Runtime) ExpectAbort(expected exitcode.ExitCode, f func())
- func (rt *Runtime) ExpectAbortContainsMessage(expected exitcode.ExitCode, substr string, f func())
- func (rt *Runtime) ExpectAssertionFailure(expected string, f func())
- func (rt *Runtime) ExpectBatchVerifySeals(in map[addr.Address][]proof.SealVerifyInfo, out map[addr.Address][]bool, ...)
- func (rt *Runtime) ExpectComputeUnsealedSectorCID(reg abi.RegisteredSealProof, pieces []abi.PieceInfo, cid cid.Cid, err error)
- func (rt *Runtime) ExpectCreateActor(codeId cid.Cid, address addr.Address)
- func (rt *Runtime) ExpectDeleteActor(beneficiary addr.Address)
- func (rt *Runtime) ExpectGasCharged(gas int64)
- func (rt *Runtime) ExpectGetRandomnessBeacon(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, ...)
- func (rt *Runtime) ExpectGetRandomnessTickets(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, ...)
- func (rt *Runtime) ExpectLogsContain(substr string)
- func (rt *Runtime) ExpectSend(toAddr addr.Address, methodNum abi.MethodNum, params cbor.Marshaler, ...)
- func (rt *Runtime) ExpectValidateCallerAddr(addrs ...addr.Address)
- func (rt *Runtime) ExpectValidateCallerAny()
- func (rt *Runtime) ExpectValidateCallerType(types ...cid.Cid)
- func (rt *Runtime) ExpectVerifyConsensusFault(h1, h2, extra []byte, result *runtime.ConsensusFault, resultErr error)
- func (rt *Runtime) ExpectVerifyPoSt(post proof.WindowPoStVerifyInfo, result error)
- func (rt *Runtime) ExpectVerifySeal(seal proof.SealVerifyInfo, result error)
- func (rt *Runtime) ExpectVerifySignature(sig crypto.Signature, signer addr.Address, plaintext []byte, result error)
- func (rt *Runtime) GetActorCodeCID(addr addr.Address) (ret cid.Cid, ok bool)
- func (rt *Runtime) GetIdAddr(raw addr.Address) (addr.Address, bool)
- func (rt *Runtime) GetRandomnessFromBeacon(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
- func (rt *Runtime) GetRandomnessFromTickets(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
- func (rt *Runtime) GetState(o cbor.Unmarshaler)
- func (rt *Runtime) HashBlake2b(data []byte) [32]byte
- func (rt *Runtime) Log(level rt.LogLevel, msg string, args ...interface{})
- func (rt *Runtime) NetworkVersion() network.Version
- func (rt *Runtime) NewActorAddress() addr.Address
- func (rt *Runtime) Receiver() addr.Address
- func (rt *Runtime) ReplaceState(o cbor.Marshaler)
- 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 cbor.Marshaler, ...) exitcode.ExitCode
- func (rt *Runtime) SetAddressActorType(address addr.Address, actorType cid.Cid)
- func (rt *Runtime) SetBalance(amt abi.TokenAmount)
- func (rt *Runtime) SetCaller(address addr.Address, actorType cid.Cid)
- func (rt *Runtime) SetCirculatingSupply(amt abi.TokenAmount)
- func (rt *Runtime) SetEpoch(epoch abi.ChainEpoch)
- func (rt *Runtime) SetHasher(f func(data []byte) [32]byte)
- func (rt *Runtime) SetNetworkVersion(v network.Version)
- func (rt *Runtime) SetNewActorAddress(actAddr addr.Address)
- func (rt *Runtime) SetReceived(amt abi.TokenAmount)
- func (rt *Runtime) StartSpan(_ string) func()
- func (rt *Runtime) StateCreate(obj cbor.Marshaler)
- func (rt *Runtime) StateReadonly(st cbor.Unmarshaler)
- func (rt *Runtime) StateRoot() cid.Cid
- func (rt *Runtime) StateTransaction(st cbor.Er, f func())
- func (rt *Runtime) StoreGet(c cid.Cid, o cbor.Unmarshaler) bool
- func (rt *Runtime) StorePut(o cbor.Marshaler) cid.Cid
- func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
- 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 proof.WindowPoStVerifyInfo) error
- func (rt *Runtime) VerifySeal(seal proof.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
- func (b *RuntimeBuilder) WithNetworkVersion(version network.Version) *RuntimeBuilder
- type TraceSpan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckActorExports ¶
Types ¶
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) AddIDAddress ¶
func (*Runtime) Balance ¶
func (rt *Runtime) Balance() abi.TokenAmount
func (*Runtime) BatchVerifySeals ¶
func (*Runtime) BlockMiner ¶
func (*Runtime) ComputeUnsealedSectorCID ¶
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) ExpectAbortContainsMessage ¶
Calls f() expecting it to invoke Runtime.Abortf() with a specified exit code and message.
func (*Runtime) ExpectAssertionFailure ¶
func (*Runtime) ExpectBatchVerifySeals ¶
func (*Runtime) ExpectComputeUnsealedSectorCID ¶
func (*Runtime) ExpectCreateActor ¶
func (*Runtime) ExpectDeleteActor ¶
func (*Runtime) ExpectGasCharged ¶
func (*Runtime) ExpectGetRandomnessBeacon ¶
func (rt *Runtime) ExpectGetRandomnessBeacon(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, out abi.Randomness)
func (*Runtime) ExpectGetRandomnessTickets ¶
func (rt *Runtime) ExpectGetRandomnessTickets(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte, out abi.Randomness)
func (*Runtime) ExpectLogsContain ¶
func (*Runtime) ExpectSend ¶
func (*Runtime) ExpectValidateCallerAddr ¶
func (*Runtime) ExpectValidateCallerAny ¶
func (rt *Runtime) ExpectValidateCallerAny()
func (*Runtime) ExpectValidateCallerType ¶
func (*Runtime) ExpectVerifyConsensusFault ¶
func (rt *Runtime) ExpectVerifyConsensusFault(h1, h2, extra []byte, result *runtime.ConsensusFault, resultErr error)
func (*Runtime) ExpectVerifyPoSt ¶
func (rt *Runtime) ExpectVerifyPoSt(post proof.WindowPoStVerifyInfo, result error)
func (*Runtime) ExpectVerifySeal ¶
func (rt *Runtime) ExpectVerifySeal(seal proof.SealVerifyInfo, result error)
func (*Runtime) ExpectVerifySignature ¶
func (*Runtime) GetActorCodeCID ¶
func (*Runtime) GetRandomnessFromBeacon ¶
func (rt *Runtime) GetRandomnessFromBeacon(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) GetRandomnessFromTickets ¶
func (rt *Runtime) GetRandomnessFromTickets(tag crypto.DomainSeparationTag, epoch abi.ChainEpoch, entropy []byte) abi.Randomness
func (*Runtime) GetState ¶
func (rt *Runtime) GetState(o cbor.Unmarshaler)
func (*Runtime) HashBlake2b ¶
func (*Runtime) NetworkVersion ¶
func (*Runtime) NewActorAddress ¶
func (*Runtime) ReplaceState ¶
func (*Runtime) ResolveAddress ¶
func (*Runtime) SetAddressActorType ¶
func (*Runtime) SetBalance ¶
func (rt *Runtime) SetBalance(amt abi.TokenAmount)
func (*Runtime) SetCirculatingSupply ¶
func (rt *Runtime) SetCirculatingSupply(amt abi.TokenAmount)
func (*Runtime) SetEpoch ¶
func (rt *Runtime) SetEpoch(epoch abi.ChainEpoch)
func (*Runtime) SetNetworkVersion ¶
func (*Runtime) SetNewActorAddress ¶
func (*Runtime) SetReceived ¶
func (rt *Runtime) SetReceived(amt abi.TokenAmount)
func (*Runtime) StateCreate ¶
func (*Runtime) StateReadonly ¶
func (rt *Runtime) StateReadonly(st cbor.Unmarshaler)
func (*Runtime) StateTransaction ¶
func (*Runtime) TotalFilCircSupply ¶
func (rt *Runtime) TotalFilCircSupply() abi.TokenAmount
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 proof.WindowPoStVerifyInfo) error
func (*Runtime) VerifySeal ¶
func (rt *Runtime) VerifySeal(seal proof.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
func (*RuntimeBuilder) WithNetworkVersion ¶ added in v2.3.0
func (b *RuntimeBuilder) WithNetworkVersion(version network.Version) *RuntimeBuilder
Click to show internal directories.
Click to hide internal directories.