Documentation ¶
Index ¶
- Constants
- Variables
- func COAOwnershipProofFixture(t testing.TB) *types.COAOwnershipProof
- func COAOwnershipProofInContextFixture(t testing.TB) *types.COAOwnershipProofInContext
- func CheckCadenceEventTypes(t testing.TB, events []cadence.Event, expectedTypes []string)
- func ConvertToCadence(data []byte) []cadence.Value
- func DeployContract(t testing.TB, caller types.Address, tc *TestContract, led atree.Ledger, ...)
- func EncodeArgs(argValues []cadence.Value) [][]byte
- func GetRandomLogFixture(t testing.TB) *gethTypes.Log
- func LocationResolver(identifiers []ast.Identifier, location common.Location) (result []sema.ResolvedLocation, err error)
- func MakeCallData(t testing.TB, abiString string, name string, args ...interface{}) []byte
- func NewScriptLocationGenerator() func() common.ScriptLocation
- func NewTransactionLocationGenerator() func() common.TransactionLocation
- func RandomAddress(t testing.TB) types.Address
- func RandomBigInt(limit int64) *big.Int
- func RandomCommonAddress(t testing.TB) gethCommon.Address
- func RandomCommonHash(t testing.TB) gethCommon.Hash
- func RandomData(t testing.TB) []byte
- func RandomGas(limit int64) uint64
- func RunWithDeployedContract(t testing.TB, tc *TestContract, led atree.Ledger, ...)
- func RunWithEOATestAccount(t testing.TB, led atree.Ledger, flowEVMRootAddress flow.Address, ...)
- func RunWithTestBackend(t testing.TB, f func(*TestBackend))
- func RunWithTestFlowEVMRootAddress(t testing.TB, backend atree.Ledger, f func(flow.Address))
- type EOATestAccount
- func (a *EOATestAccount) Address() types.Address
- func (a *EOATestAccount) Nonce() uint64
- func (a *EOATestAccount) PrepareAndSignTx(t testing.TB, to gethCommon.Address, data []byte, amount *big.Int, ...) *gethTypes.Transaction
- func (a *EOATestAccount) PrepareSignAndEncodeTx(t testing.TB, to gethCommon.Address, data []byte, amount *big.Int, ...) []byte
- func (a *EOATestAccount) SetNonce(nonce uint64)
- func (a *EOATestAccount) SignTx(t testing.TB, tx *gethTypes.Transaction) *gethTypes.Transaction
- type TestBackend
- func (m TestBackend) ComputationAvailable(kind common.ComputationKind, intensity uint) bool
- func (m TestBackend) ComputationIntensities() meter.MeteredComputationIntensities
- func (m TestBackend) ComputationUsed() (uint64, error)
- func (vs TestBackend) ConvertedServiceEvents() flow.ServiceEventList
- func (tb *TestBackend) DropEvents()
- func (vs TestBackend) EmitEvent(event cadence.Event) error
- func (vs TestBackend) Events() flow.EventsList
- func (t TestBackend) GenerateUUID() (uint64, error)
- func (tb *TestBackend) Get(id flow.RegisterID) (flow.RegisterValue, error)
- func (m TestBackend) InteractionUsed() (uint64, error)
- func (m TestBackend) MemoryUsed() (uint64, error)
- func (m TestBackend) MeterComputation(kind common.ComputationKind, intensity uint) error
- func (m TestBackend) MeterEmittedEvent(byteSize uint64) error
- func (m TestBackend) MeterMemory(usage common.MemoryUsage) error
- func (vs TestBackend) Reset()
- func (vs TestBackend) ServiceEvents() flow.EventsList
- func (m TestBackend) TotalEmittedEventBytes() uint64
- func (tb *TestBackend) TotalStorageSize() int
- type TestBlockInfo
- type TestContract
- type TestContractFunctionInvoker
- type TestEmulator
- func (em *TestEmulator) BalanceOf(address types.Address) (*big.Int, error)
- func (em *TestEmulator) BatchRunTransactions(txs []*gethTypes.Transaction) ([]*types.Result, error)
- func (em *TestEmulator) CodeHashOf(address types.Address) ([]byte, error)
- func (em *TestEmulator) CodeOf(address types.Address) (types.Code, error)
- func (em *TestEmulator) DirectCall(call *types.DirectCall) (*types.Result, error)
- func (em *TestEmulator) DryRunTransaction(tx *gethTypes.Transaction, address gethCommon.Address) (*types.Result, error)
- func (em *TestEmulator) NewBlockView(_ types.BlockContext) (types.BlockView, error)
- func (em *TestEmulator) NewReadOnlyBlockView(_ types.BlockContext) (types.ReadOnlyBlockView, error)
- func (em *TestEmulator) NonceOf(address types.Address) (uint64, error)
- func (em *TestEmulator) RunTransaction(tx *gethTypes.Transaction) (*types.Result, error)
- type TestLedger
- func (s TestLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (s TestLedger) Dump()
- func (s TestLedger) GetValue(owner, key []byte) (value []byte, err error)
- func (s TestLedger) SetValue(owner, key, value []byte) (err error)
- func (s TestLedger) ValueExists(owner, key []byte) (exists bool, err error)
- type TestRandomGenerator
- type TestRuntimeInterface
- func (i *TestRuntimeInterface) AccountKeysCount(address runtime.Address) (uint64, error)
- func (i *TestRuntimeInterface) AddAccountKey(address runtime.Address, publicKey *cadenceStdlib.PublicKey, ...) (*cadenceStdlib.AccountKey, error)
- func (i *TestRuntimeInterface) AddEncodedAccountKey(address runtime.Address, publicKey []byte) error
- func (i *TestRuntimeInterface) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (i *TestRuntimeInterface) BLSAggregatePublicKeys(keys []*cadenceStdlib.PublicKey) (*cadenceStdlib.PublicKey, error)
- func (i *TestRuntimeInterface) BLSAggregateSignatures(sigs [][]byte) ([]byte, error)
- func (i *TestRuntimeInterface) BLSVerifyPOP(key *cadenceStdlib.PublicKey, s []byte) (bool, error)
- func (i *TestRuntimeInterface) ComputationUsed() (uint64, error)
- func (i *TestRuntimeInterface) CreateAccount(payer runtime.Address) (address runtime.Address, err error)
- func (i *TestRuntimeInterface) DecodeArgument(b []byte, t cadence.Type) (cadence.Value, error)
- func (i *TestRuntimeInterface) EmitEvent(event cadence.Event) error
- func (i *TestRuntimeInterface) GenerateAccountID(address common.Address) (uint64, error)
- func (i *TestRuntimeInterface) GenerateUUID() (uint64, error)
- func (i *TestRuntimeInterface) GetAccountAvailableBalance(address runtime.Address) (uint64, error)
- func (i *TestRuntimeInterface) GetAccountBalance(address runtime.Address) (uint64, error)
- func (i *TestRuntimeInterface) GetAccountContractCode(location common.AddressLocation) (code []byte, err error)
- func (i *TestRuntimeInterface) GetAccountContractNames(address runtime.Address) ([]string, error)
- func (i *TestRuntimeInterface) GetAccountKey(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error)
- func (i *TestRuntimeInterface) GetBlockAtHeight(height uint64) (block cadenceStdlib.Block, exists bool, err error)
- func (i *TestRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
- func (i *TestRuntimeInterface) GetCurrentBlockHeight() (uint64, error)
- func (i *TestRuntimeInterface) GetInterpreterSharedState() *interpreter.SharedState
- func (i *TestRuntimeInterface) GetOrLoadProgram(location runtime.Location, load func() (*interpreter.Program, error)) (program *interpreter.Program, err error)
- func (i *TestRuntimeInterface) GetSigningAccounts() ([]runtime.Address, error)
- func (i *TestRuntimeInterface) GetStorageCapacity(address runtime.Address) (uint64, error)
- func (i *TestRuntimeInterface) GetStorageUsed(address runtime.Address) (uint64, error)
- func (i *TestRuntimeInterface) GetValue(owner, key []byte) (value []byte, err error)
- func (i *TestRuntimeInterface) Hash(data []byte, tag string, hashAlgorithm runtime.HashAlgorithm) ([]byte, error)
- func (i *TestRuntimeInterface) ImplementationDebugLog(message string) error
- func (i *TestRuntimeInterface) InteractionUsed() (uint64, error)
- func (i *TestRuntimeInterface) MemoryUsed() (uint64, error)
- func (i *TestRuntimeInterface) MeterComputation(compKind common.ComputationKind, intensity uint) error
- func (i *TestRuntimeInterface) MeterMemory(usage common.MemoryUsage) error
- func (i *TestRuntimeInterface) ProgramChecked(location runtime.Location, duration time.Duration)
- func (i *TestRuntimeInterface) ProgramInterpreted(location runtime.Location, duration time.Duration)
- func (i *TestRuntimeInterface) ProgramLog(message string) error
- func (i *TestRuntimeInterface) ProgramParsed(location runtime.Location, duration time.Duration)
- func (i *TestRuntimeInterface) ReadRandom(buffer []byte) error
- func (i *TestRuntimeInterface) RecordTrace(operation string, location runtime.Location, duration time.Duration, ...)
- func (i *TestRuntimeInterface) RemoveAccountContractCode(location common.AddressLocation) (err error)
- func (i *TestRuntimeInterface) ResolveLocation(identifiers []runtime.Identifier, location runtime.Location) ([]runtime.ResolvedLocation, error)
- func (i *TestRuntimeInterface) ResourceOwnerChanged(interpreter *interpreter.Interpreter, resource *interpreter.CompositeValue, ...)
- func (i *TestRuntimeInterface) RevokeAccountKey(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error)
- func (i *TestRuntimeInterface) RevokeEncodedAccountKey(address runtime.Address, index int) ([]byte, error)
- func (i *TestRuntimeInterface) SetCadenceValue(owner common.Address, key string, value cadence.Value) (err error)
- func (i *TestRuntimeInterface) SetInterpreterSharedState(state *interpreter.SharedState)
- func (i *TestRuntimeInterface) SetValue(owner, key, value []byte) (err error)
- func (i *TestRuntimeInterface) UpdateAccountContractCode(location common.AddressLocation, code []byte) (err error)
- func (i *TestRuntimeInterface) ValidatePublicKey(key *cadenceStdlib.PublicKey) error
- func (i *TestRuntimeInterface) ValueExists(owner, key []byte) (exists bool, err error)
- func (i *TestRuntimeInterface) VerifySignature(signature []byte, tag string, signedData []byte, publicKey []byte, ...) (bool, error)
- type TestValueStore
- func (vs *TestValueStore) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (vs *TestValueStore) GetValue(owner, key []byte) ([]byte, error)
- func (vs *TestValueStore) ResetStats()
- func (vs *TestValueStore) SetValue(owner, key, value []byte) error
- func (vs *TestValueStore) TotalBytesRead() int
- func (vs *TestValueStore) TotalBytesWritten() int
- func (vs *TestValueStore) TotalStorageItems() int
- func (vs *TestValueStore) TotalStorageSize() int
- func (vs *TestValueStore) ValueExists(owner, key []byte) (bool, error)
Constants ¶
const EOATestAccount1KeyHex = "9c647b8b7c4e7c3490668fb6c11473619db80c93704c70893d3813af4090c39c"
address: 658bdf435d810c91414ec09147daa6db62406379
Variables ¶
var TestComputationLimit = uint(100_000_000)
var TestFlowEVMRootAddress = flow.BytesToAddress([]byte("FlowEVM"))
Functions ¶
func COAOwnershipProofFixture ¶ added in v0.33.30
func COAOwnershipProofFixture(t testing.TB) *types.COAOwnershipProof
func COAOwnershipProofInContextFixture ¶ added in v0.33.30
func COAOwnershipProofInContextFixture(t testing.TB) *types.COAOwnershipProofInContext
func CheckCadenceEventTypes ¶ added in v0.33.30
func ConvertToCadence ¶
func DeployContract ¶
func EncodeArgs ¶
func LocationResolver ¶ added in v0.33.30
func LocationResolver( identifiers []ast.Identifier, location common.Location, ) ( result []sema.ResolvedLocation, err error, )
LocationResolver is a location Cadence runtime interface location resolver very similar to ContractReader.ResolveLocation, but it does not look up available contract names
func MakeCallData ¶ added in v0.33.30
func NewScriptLocationGenerator ¶
func NewScriptLocationGenerator() func() common.ScriptLocation
func NewTransactionLocationGenerator ¶
func NewTransactionLocationGenerator() func() common.TransactionLocation
func RandomBigInt ¶
func RandomCommonAddress ¶
func RandomCommonAddress(t testing.TB) gethCommon.Address
func RandomCommonHash ¶
func RandomCommonHash(t testing.TB) gethCommon.Hash
func RandomData ¶
func RunWithDeployedContract ¶
func RunWithDeployedContract(t testing.TB, tc *TestContract, led atree.Ledger, flowEVMRootAddress flow.Address, f func(*TestContract))
func RunWithEOATestAccount ¶
func RunWithTestBackend ¶
func RunWithTestBackend(t testing.TB, f func(*TestBackend))
Types ¶
type EOATestAccount ¶
type EOATestAccount struct {
// contains filtered or unexported fields
}
func GetTestEOAAccount ¶
func GetTestEOAAccount(t testing.TB, keyHex string) *EOATestAccount
func (*EOATestAccount) Address ¶
func (a *EOATestAccount) Address() types.Address
func (*EOATestAccount) Nonce ¶ added in v0.33.30
func (a *EOATestAccount) Nonce() uint64
func (*EOATestAccount) PrepareAndSignTx ¶
func (a *EOATestAccount) PrepareAndSignTx( t testing.TB, to gethCommon.Address, data []byte, amount *big.Int, gasLimit uint64, gasPrice *big.Int, ) *gethTypes.Transaction
func (*EOATestAccount) PrepareSignAndEncodeTx ¶
func (*EOATestAccount) SetNonce ¶
func (a *EOATestAccount) SetNonce(nonce uint64)
func (*EOATestAccount) SignTx ¶
func (a *EOATestAccount) SignTx( t testing.TB, tx *gethTypes.Transaction, ) *gethTypes.Transaction
type TestBackend ¶
type TestBackend struct { *TestValueStore *TestBlockInfo *TestRandomGenerator *TestContractFunctionInvoker // contains filtered or unexported fields }
func (TestBackend) ComputationAvailable ¶
func (m TestBackend) ComputationAvailable( kind common.ComputationKind, intensity uint, ) bool
func (TestBackend) ComputationIntensities ¶
func (m TestBackend) ComputationIntensities() meter.MeteredComputationIntensities
func (TestBackend) ComputationUsed ¶
func (TestBackend) ConvertedServiceEvents ¶
func (vs TestBackend) ConvertedServiceEvents() flow.ServiceEventList
func (*TestBackend) DropEvents ¶
func (tb *TestBackend) DropEvents()
func (TestBackend) Events ¶
func (vs TestBackend) Events() flow.EventsList
func (TestBackend) GenerateUUID ¶ added in v0.33.30
func (*TestBackend) Get ¶ added in v0.33.30
func (tb *TestBackend) Get(id flow.RegisterID) (flow.RegisterValue, error)
func (TestBackend) InteractionUsed ¶
func (TestBackend) MemoryUsed ¶
func (TestBackend) MeterComputation ¶
func (m TestBackend) MeterComputation( kind common.ComputationKind, intensity uint, ) error
func (TestBackend) MeterEmittedEvent ¶
func (TestBackend) MeterMemory ¶
func (m TestBackend) MeterMemory(usage common.MemoryUsage) error
func (TestBackend) ServiceEvents ¶
func (vs TestBackend) ServiceEvents() flow.EventsList
func (TestBackend) TotalEmittedEventBytes ¶
func (m TestBackend) TotalEmittedEventBytes() uint64
func (*TestBackend) TotalStorageSize ¶
func (tb *TestBackend) TotalStorageSize() int
type TestBlockInfo ¶ added in v0.33.30
type TestBlockInfo struct { GetCurrentBlockHeightFunc func() (uint64, error) GetBlockAtHeightFunc func(height uint64) (runtime.Block, bool, error) }
func (*TestBlockInfo) GetBlockAtHeight ¶ added in v0.33.30
GetBlockAtHeight returns the block at the given height.
func (*TestBlockInfo) GetCurrentBlockHeight ¶ added in v0.33.30
func (tb *TestBlockInfo) GetCurrentBlockHeight() (uint64, error)
GetCurrentBlockHeight returns the current block height.
type TestContract ¶
func GetDummyKittyTestContract ¶
func GetDummyKittyTestContract(t testing.TB) *TestContract
func GetStorageTestContract ¶
func GetStorageTestContract(tb testing.TB) *TestContract
func (*TestContract) MakeCallData ¶
func (tc *TestContract) MakeCallData(t testing.TB, name string, args ...interface{}) []byte
func (*TestContract) SetDeployedAt ¶
func (tc *TestContract) SetDeployedAt(deployedAt types.Address)
type TestContractFunctionInvoker ¶ added in v0.33.30
type TestContractFunctionInvoker struct { InvokeFunc func( spec environment.ContractFunctionSpec, arguments []cadence.Value, ) ( cadence.Value, error, ) }
func (*TestContractFunctionInvoker) Invoke ¶ added in v0.33.30
func (t *TestContractFunctionInvoker) Invoke( spec environment.ContractFunctionSpec, arguments []cadence.Value, ) ( cadence.Value, error, )
type TestEmulator ¶
type TestEmulator struct { BalanceOfFunc func(address types.Address) (*big.Int, error) NonceOfFunc func(address types.Address) (uint64, error) CodeOfFunc func(address types.Address) (types.Code, error) CodeHashOfFunc func(address types.Address) ([]byte, error) DirectCallFunc func(call *types.DirectCall) (*types.Result, error) RunTransactionFunc func(tx *gethTypes.Transaction) (*types.Result, error) DryRunTransactionFunc func(tx *gethTypes.Transaction, address gethCommon.Address) (*types.Result, error) BatchRunTransactionFunc func(txs []*gethTypes.Transaction) ([]*types.Result, error) }
func (*TestEmulator) BatchRunTransactions ¶ added in v0.33.30
func (em *TestEmulator) BatchRunTransactions(txs []*gethTypes.Transaction) ([]*types.Result, error)
BatchRunTransactions batch runs transactions and collect gas fees to the coinbase account
func (*TestEmulator) CodeHashOf ¶ added in v0.33.30
func (em *TestEmulator) CodeHashOf(address types.Address) ([]byte, error)
CodeHashOf returns the code hash for this address
func (*TestEmulator) DirectCall ¶
func (em *TestEmulator) DirectCall(call *types.DirectCall) (*types.Result, error)
DirectCall executes a direct call
func (*TestEmulator) DryRunTransaction ¶ added in v0.33.30
func (em *TestEmulator) DryRunTransaction(tx *gethTypes.Transaction, address gethCommon.Address) (*types.Result, error)
DryRunTransaction simulates transaction execution
func (*TestEmulator) NewBlockView ¶
func (em *TestEmulator) NewBlockView(_ types.BlockContext) (types.BlockView, error)
NewBlock returns a new block
func (*TestEmulator) NewReadOnlyBlockView ¶
func (em *TestEmulator) NewReadOnlyBlockView(_ types.BlockContext) (types.ReadOnlyBlockView, error)
NewBlock returns a new block view
func (*TestEmulator) NonceOf ¶
func (em *TestEmulator) NonceOf(address types.Address) (uint64, error)
NonceOfFunc returns the nonce for this address
func (*TestEmulator) RunTransaction ¶
func (em *TestEmulator) RunTransaction(tx *gethTypes.Transaction) (*types.Result, error)
RunTransaction runs a transaction and collect gas fees to the coinbase account
type TestLedger ¶
type TestLedger struct { StoredValues map[string][]byte OnValueExists func(owner, key []byte) (exists bool, err error) OnGetValue func(owner, key []byte) (value []byte, err error) OnSetValue func(owner, key, value []byte) (err error) OnAllocateStorageIndex func(owner []byte) (atree.StorageIndex, error) }
func NewTestLedger ¶
func NewTestLedger( onRead func(owner, key, value []byte), onWrite func(owner, key, value []byte), ) TestLedger
func (TestLedger) AllocateStorageIndex ¶
func (s TestLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
func (TestLedger) Dump ¶
func (s TestLedger) Dump()
func (TestLedger) GetValue ¶
func (s TestLedger) GetValue(owner, key []byte) (value []byte, err error)
func (TestLedger) SetValue ¶
func (s TestLedger) SetValue(owner, key, value []byte) (err error)
func (TestLedger) ValueExists ¶
func (s TestLedger) ValueExists(owner, key []byte) (exists bool, err error)
type TestRandomGenerator ¶ added in v0.33.30
func (*TestRandomGenerator) ReadRandom ¶ added in v0.33.30
func (t *TestRandomGenerator) ReadRandom(buffer []byte) error
type TestRuntimeInterface ¶
type TestRuntimeInterface struct { Storage atree.Ledger OnResolveLocation func( identifiers []runtime.Identifier, location runtime.Location, ) ( []runtime.ResolvedLocation, error, ) OnGetCode func(_ runtime.Location) ([]byte, error) OnGetAndSetProgram func( location runtime.Location, load func() (*interpreter.Program, error), ) (*interpreter.Program, error) OnCreateAccount func(payer runtime.Address) (address runtime.Address, err error) OnAddEncodedAccountKey func(address runtime.Address, publicKey []byte) error OnRemoveEncodedAccountKey func(address runtime.Address, index int) (publicKey []byte, err error) OnAddAccountKey func( address runtime.Address, publicKey *cadenceStdlib.PublicKey, hashAlgo runtime.HashAlgorithm, weight int, ) (*cadenceStdlib.AccountKey, error) OnGetAccountKey func(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error) OnRemoveAccountKey func(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error) OnAccountKeysCount func(address runtime.Address) (uint64, error) OnUpdateAccountContractCode func(location common.AddressLocation, code []byte) error OnGetAccountContractCode func(location common.AddressLocation) (code []byte, err error) OnRemoveAccountContractCode func(location common.AddressLocation) (err error) OnGetSigningAccounts func() ([]runtime.Address, error) OnProgramLog func(string) OnEmitEvent func(cadence.Event) error OnResourceOwnerChanged func( interpreter *interpreter.Interpreter, resource *interpreter.CompositeValue, oldAddress common.Address, newAddress common.Address, ) OnGenerateUUID func() (uint64, error) OnMeterComputation func(compKind common.ComputationKind, intensity uint) error OnDecodeArgument func(b []byte, t cadence.Type) (cadence.Value, error) OnProgramParsed func(location runtime.Location, duration time.Duration) OnProgramChecked func(location runtime.Location, duration time.Duration) OnProgramInterpreted func(location runtime.Location, duration time.Duration) OnReadRandom func([]byte) error OnVerifySignature func( signature []byte, tag string, signedData []byte, publicKey []byte, signatureAlgorithm runtime.SignatureAlgorithm, hashAlgorithm runtime.HashAlgorithm, ) (bool, error) OnHash func( data []byte, tag string, hashAlgorithm runtime.HashAlgorithm, ) ([]byte, error) OnSetCadenceValue func(owner runtime.Address, key string, value cadence.Value) (err error) OnGetAccountBalance func(_ runtime.Address) (uint64, error) OnGetAccountAvailableBalance func(_ runtime.Address) (uint64, error) OnGetStorageUsed func(_ runtime.Address) (uint64, error) OnGetStorageCapacity func(_ runtime.Address) (uint64, error) Programs map[runtime.Location]*interpreter.Program OnImplementationDebugLog func(message string) error OnValidatePublicKey func(publicKey *cadenceStdlib.PublicKey) error OnBLSVerifyPOP func(pk *cadenceStdlib.PublicKey, s []byte) (bool, error) OnBLSAggregateSignatures func(sigs [][]byte) ([]byte, error) OnBLSAggregatePublicKeys func(keys []*cadenceStdlib.PublicKey) (*cadenceStdlib.PublicKey, error) OnGetAccountContractNames func(address runtime.Address) ([]string, error) OnRecordTrace func( operation string, location runtime.Location, duration time.Duration, attrs []attribute.KeyValue, ) OnMeterMemory func(usage common.MemoryUsage) error OnComputationUsed func() (uint64, error) OnMemoryUsed func() (uint64, error) OnInteractionUsed func() (uint64, error) OnGenerateAccountID func(address common.Address) (uint64, error) // contains filtered or unexported fields }
func (*TestRuntimeInterface) AccountKeysCount ¶
func (i *TestRuntimeInterface) AccountKeysCount(address runtime.Address) (uint64, error)
func (*TestRuntimeInterface) AddAccountKey ¶
func (i *TestRuntimeInterface) AddAccountKey( address runtime.Address, publicKey *cadenceStdlib.PublicKey, hashAlgo runtime.HashAlgorithm, weight int, ) (*cadenceStdlib.AccountKey, error)
func (*TestRuntimeInterface) AddEncodedAccountKey ¶
func (i *TestRuntimeInterface) AddEncodedAccountKey(address runtime.Address, publicKey []byte) error
func (*TestRuntimeInterface) AllocateStorageIndex ¶
func (i *TestRuntimeInterface) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
func (*TestRuntimeInterface) BLSAggregatePublicKeys ¶
func (i *TestRuntimeInterface) BLSAggregatePublicKeys(keys []*cadenceStdlib.PublicKey) (*cadenceStdlib.PublicKey, error)
func (*TestRuntimeInterface) BLSAggregateSignatures ¶
func (i *TestRuntimeInterface) BLSAggregateSignatures(sigs [][]byte) ([]byte, error)
func (*TestRuntimeInterface) BLSVerifyPOP ¶
func (i *TestRuntimeInterface) BLSVerifyPOP(key *cadenceStdlib.PublicKey, s []byte) (bool, error)
func (*TestRuntimeInterface) ComputationUsed ¶
func (i *TestRuntimeInterface) ComputationUsed() (uint64, error)
func (*TestRuntimeInterface) CreateAccount ¶
func (*TestRuntimeInterface) DecodeArgument ¶
func (*TestRuntimeInterface) EmitEvent ¶
func (i *TestRuntimeInterface) EmitEvent(event cadence.Event) error
func (*TestRuntimeInterface) GenerateAccountID ¶
func (i *TestRuntimeInterface) GenerateAccountID(address common.Address) (uint64, error)
func (*TestRuntimeInterface) GenerateUUID ¶
func (i *TestRuntimeInterface) GenerateUUID() (uint64, error)
func (*TestRuntimeInterface) GetAccountAvailableBalance ¶
func (i *TestRuntimeInterface) GetAccountAvailableBalance(address runtime.Address) (uint64, error)
func (*TestRuntimeInterface) GetAccountBalance ¶
func (i *TestRuntimeInterface) GetAccountBalance(address runtime.Address) (uint64, error)
func (*TestRuntimeInterface) GetAccountContractCode ¶
func (i *TestRuntimeInterface) GetAccountContractCode(location common.AddressLocation) (code []byte, err error)
func (*TestRuntimeInterface) GetAccountContractNames ¶
func (i *TestRuntimeInterface) GetAccountContractNames(address runtime.Address) ([]string, error)
func (*TestRuntimeInterface) GetAccountKey ¶
func (i *TestRuntimeInterface) GetAccountKey(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error)
func (*TestRuntimeInterface) GetBlockAtHeight ¶
func (i *TestRuntimeInterface) GetBlockAtHeight(height uint64) (block cadenceStdlib.Block, exists bool, err error)
func (*TestRuntimeInterface) GetCode ¶
func (i *TestRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
func (*TestRuntimeInterface) GetCurrentBlockHeight ¶
func (i *TestRuntimeInterface) GetCurrentBlockHeight() (uint64, error)
func (*TestRuntimeInterface) GetInterpreterSharedState ¶
func (i *TestRuntimeInterface) GetInterpreterSharedState() *interpreter.SharedState
func (*TestRuntimeInterface) GetOrLoadProgram ¶
func (i *TestRuntimeInterface) GetOrLoadProgram( location runtime.Location, load func() (*interpreter.Program, error), ) ( program *interpreter.Program, err error, )
func (*TestRuntimeInterface) GetSigningAccounts ¶
func (i *TestRuntimeInterface) GetSigningAccounts() ([]runtime.Address, error)
func (*TestRuntimeInterface) GetStorageCapacity ¶
func (i *TestRuntimeInterface) GetStorageCapacity(address runtime.Address) (uint64, error)
func (*TestRuntimeInterface) GetStorageUsed ¶
func (i *TestRuntimeInterface) GetStorageUsed(address runtime.Address) (uint64, error)
func (*TestRuntimeInterface) GetValue ¶
func (i *TestRuntimeInterface) GetValue(owner, key []byte) (value []byte, err error)
func (*TestRuntimeInterface) Hash ¶
func (i *TestRuntimeInterface) Hash(data []byte, tag string, hashAlgorithm runtime.HashAlgorithm) ([]byte, error)
func (*TestRuntimeInterface) ImplementationDebugLog ¶
func (i *TestRuntimeInterface) ImplementationDebugLog(message string) error
func (*TestRuntimeInterface) InteractionUsed ¶
func (i *TestRuntimeInterface) InteractionUsed() (uint64, error)
func (*TestRuntimeInterface) MemoryUsed ¶
func (i *TestRuntimeInterface) MemoryUsed() (uint64, error)
func (*TestRuntimeInterface) MeterComputation ¶
func (i *TestRuntimeInterface) MeterComputation(compKind common.ComputationKind, intensity uint) error
func (*TestRuntimeInterface) MeterMemory ¶
func (i *TestRuntimeInterface) MeterMemory(usage common.MemoryUsage) error
func (*TestRuntimeInterface) ProgramChecked ¶
func (i *TestRuntimeInterface) ProgramChecked(location runtime.Location, duration time.Duration)
func (*TestRuntimeInterface) ProgramInterpreted ¶
func (i *TestRuntimeInterface) ProgramInterpreted(location runtime.Location, duration time.Duration)
func (*TestRuntimeInterface) ProgramLog ¶
func (i *TestRuntimeInterface) ProgramLog(message string) error
func (*TestRuntimeInterface) ProgramParsed ¶
func (i *TestRuntimeInterface) ProgramParsed(location runtime.Location, duration time.Duration)
func (*TestRuntimeInterface) ReadRandom ¶
func (i *TestRuntimeInterface) ReadRandom(buffer []byte) error
func (*TestRuntimeInterface) RecordTrace ¶
func (*TestRuntimeInterface) RemoveAccountContractCode ¶
func (i *TestRuntimeInterface) RemoveAccountContractCode(location common.AddressLocation) (err error)
func (*TestRuntimeInterface) ResolveLocation ¶
func (i *TestRuntimeInterface) ResolveLocation( identifiers []runtime.Identifier, location runtime.Location, ) ([]runtime.ResolvedLocation, error)
func (*TestRuntimeInterface) ResourceOwnerChanged ¶
func (i *TestRuntimeInterface) ResourceOwnerChanged( interpreter *interpreter.Interpreter, resource *interpreter.CompositeValue, oldOwner common.Address, newOwner common.Address, )
func (*TestRuntimeInterface) RevokeAccountKey ¶
func (i *TestRuntimeInterface) RevokeAccountKey(address runtime.Address, index int) (*cadenceStdlib.AccountKey, error)
func (*TestRuntimeInterface) RevokeEncodedAccountKey ¶
func (*TestRuntimeInterface) SetCadenceValue ¶
func (*TestRuntimeInterface) SetInterpreterSharedState ¶
func (i *TestRuntimeInterface) SetInterpreterSharedState(state *interpreter.SharedState)
func (*TestRuntimeInterface) SetValue ¶
func (i *TestRuntimeInterface) SetValue(owner, key, value []byte) (err error)
func (*TestRuntimeInterface) UpdateAccountContractCode ¶
func (i *TestRuntimeInterface) UpdateAccountContractCode(location common.AddressLocation, code []byte) (err error)
func (*TestRuntimeInterface) ValidatePublicKey ¶
func (i *TestRuntimeInterface) ValidatePublicKey(key *cadenceStdlib.PublicKey) error
func (*TestRuntimeInterface) ValueExists ¶
func (i *TestRuntimeInterface) ValueExists(owner, key []byte) (exists bool, err error)
func (*TestRuntimeInterface) VerifySignature ¶
func (i *TestRuntimeInterface) VerifySignature( signature []byte, tag string, signedData []byte, publicKey []byte, signatureAlgorithm runtime.SignatureAlgorithm, hashAlgorithm runtime.HashAlgorithm, ) (bool, error)
type TestValueStore ¶
type TestValueStore struct { GetValueFunc func(owner, key []byte) ([]byte, error) SetValueFunc func(owner, key, value []byte) error ValueExistsFunc func(owner, key []byte) (bool, error) AllocateStorageIndexFunc func(owner []byte) (atree.StorageIndex, error) TotalStorageSizeFunc func() int TotalBytesReadFunc func() int TotalBytesWrittenFunc func() int TotalStorageItemsFunc func() int ResetStatsFunc func() }
func GetSimpleValueStore ¶
func GetSimpleValueStore() *TestValueStore
func (*TestValueStore) AllocateStorageIndex ¶
func (vs *TestValueStore) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
func (*TestValueStore) GetValue ¶
func (vs *TestValueStore) GetValue(owner, key []byte) ([]byte, error)
func (*TestValueStore) ResetStats ¶
func (vs *TestValueStore) ResetStats()
func (*TestValueStore) SetValue ¶
func (vs *TestValueStore) SetValue(owner, key, value []byte) error
func (*TestValueStore) TotalBytesRead ¶
func (vs *TestValueStore) TotalBytesRead() int
func (*TestValueStore) TotalBytesWritten ¶
func (vs *TestValueStore) TotalBytesWritten() int
func (*TestValueStore) TotalStorageItems ¶
func (vs *TestValueStore) TotalStorageItems() int
func (*TestValueStore) TotalStorageSize ¶
func (vs *TestValueStore) TotalStorageSize() int
func (*TestValueStore) ValueExists ¶
func (vs *TestValueStore) ValueExists(owner, key []byte) (bool, error)