testutil

package
v0.29.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CheckerHeavyTransaction = `` /* 156001-byte string literal not displayed */
View Source
const CounterContract = `` /* 280-byte string literal not displayed */
View Source
const CounterContractV2 = `` /* 359-byte string literal not displayed */
View Source
const EventContract = `` /* 147-byte string literal not displayed */

Variables

This section is empty.

Functions

func AddToCounterTransaction

func AddToCounterTransaction(counter, signer flow.Address) *flow.TransactionBody

func BytesToCadenceArray

func BytesToCadenceArray(l []byte) cadence.Array

func CreateAccountCreationTransaction

func CreateAccountCreationTransaction(t testing.TB, chain flow.Chain) (flow.AccountPrivateKey, *flow.TransactionBody)

CreateAccountCreationTransaction creates a transaction which will create a new account.

This function returns a randomly generated private key and the transaction.

func CreateAccounts

func CreateAccounts(
	vm fvm.VM,
	view state.View,
	derivedBlockData *derived.DerivedBlockData,
	privateKeys []flow.AccountPrivateKey,
	chain flow.Chain,
) ([]flow.Address, error)

CreateAccounts inserts accounts into the ledger using the provided private keys.

func CreateAccountsWithSimpleAddresses

func CreateAccountsWithSimpleAddresses(
	vm fvm.VM,
	view state.View,
	derivedBlockData *derived.DerivedBlockData,
	privateKeys []flow.AccountPrivateKey,
	chain flow.Chain,
) ([]flow.Address, error)

func CreateAddAccountKeyTransaction

func CreateAddAccountKeyTransaction(t *testing.T, accountKey *flow.AccountPrivateKey) *flow.TransactionBody

CreateAddAccountKeyTransaction generates a tx that adds a key to an account.

func CreateAddAnAccountKeyMultipleTimesTransaction

func CreateAddAnAccountKeyMultipleTimesTransaction(t *testing.T, accountKey *flow.AccountPrivateKey, counts int) *flow.TransactionBody

CreateAddAnAccountKeyMultipleTimesTransaction generates a tx that adds a key several times to an account. this can be used to exhaust an account's storage.

func CreateContractDeploymentTransaction

func CreateContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func CreateCounterPanicTransaction

func CreateCounterPanicTransaction(counter, signer flow.Address) *flow.TransactionBody

CreateCounterPanicTransaction returns a transaction that will manipulate state by writing a new counter into storage and then panic. It can be used to test whether execution state stays untouched/will revert

func CreateCounterTransaction

func CreateCounterTransaction(counter, signer flow.Address) *flow.TransactionBody

func CreateEmitEventTransaction

func CreateEmitEventTransaction(contractAccount, signer flow.Address) *flow.TransactionBody

func CreateMultiAccountCreationTransaction

func CreateMultiAccountCreationTransaction(t *testing.T, chain flow.Chain, n int) (flow.AccountPrivateKey, *flow.TransactionBody)

CreateMultiAccountCreationTransaction creates a transaction which will create many (n) new account.

This function returns a randomly generated private key and the transaction.

func CreateTokenTransferTransaction

func CreateTokenTransferTransaction(chain flow.Chain, amount int, to flow.Address, signer flow.Address) *flow.TransactionBody

func CreateUnauthorizedContractDeploymentTransaction

func CreateUnauthorizedContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address) *flow.TransactionBody

func DeployCheckerHeavyTransaction

func DeployCheckerHeavyTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func DeployCounterContractTransaction

func DeployCounterContractTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func DeployEventContractTransaction

func DeployEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody

func DeployUnauthorizedCounterContractTransaction

func DeployUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody

func GenerateAccountPrivateKey

func GenerateAccountPrivateKey() (flow.AccountPrivateKey, error)

GenerateAccountPrivateKey generates a private key.

func GenerateAccountPrivateKeys

func GenerateAccountPrivateKeys(numberOfPrivateKeys int) ([]flow.AccountPrivateKey, error)

GenerateAccountPrivateKeys generates a number of private keys.

func RemoveContractDeploymentTransaction

func RemoveContractDeploymentTransaction(contractName string, authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func RemoveContractUnathorizedDeploymentTransaction

func RemoveContractUnathorizedDeploymentTransaction(contractName string, authorizer flow.Address) *flow.TransactionBody

func RemoveCounterContractTransaction

func RemoveCounterContractTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func RemoveUnauthorizedCounterContractTransaction

func RemoveUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody

func RootBootstrappedLedger

func RootBootstrappedLedger(vm fvm.VM, ctx fvm.Context, additionalOptions ...fvm.BootstrapProcedureOption) state.View

func SignEnvelope

func SignEnvelope(tx *flow.TransactionBody, account flow.Address, privateKey flow.AccountPrivateKey) error

func SignPayload

func SignPayload(
	tx *flow.TransactionBody,
	account flow.Address,
	privateKey flow.AccountPrivateKey,
) error

func SignTransaction

func SignTransaction(
	tx *flow.TransactionBody,
	address flow.Address,
	privateKey flow.AccountPrivateKey,
	seqNum uint64,
) error

func SignTransactionAsServiceAccount

func SignTransactionAsServiceAccount(tx *flow.TransactionBody, seqNum uint64, chain flow.Chain) error

func UnauthorizedDeployEventContractTransaction

func UnauthorizedDeployEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody

func UpdateContractDeploymentTransaction

func UpdateContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address, chain flow.Chain) *flow.TransactionBody

func UpdateContractUnathorizedDeploymentTransaction

func UpdateContractUnathorizedDeploymentTransaction(contractName string, contract string, authorizer flow.Address) *flow.TransactionBody

func UpdateEventContractTransaction

func UpdateEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody

func UpdateUnauthorizedCounterContractTransaction

func UpdateUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody

Types

This section is empty.

Jump to

Keyboard shortcuts

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