Documentation ¶
Index ¶
- Constants
- func AddToCounterTransaction(counter, signer flow.Address) *flow.TransactionBody
- func BytesToCadenceArray(l []byte) cadence.Array
- func ComputationResultFixture(t *testing.T) *execution.ComputationResult
- func CreateAccountCreationTransaction(t testing.TB, chain flow.Chain) (flow.AccountPrivateKey, *flow.TransactionBody)
- func CreateAccounts(vm fvm.VM, snapshotTree snapshot.SnapshotTree, ...) (snapshot.SnapshotTree, []flow.Address, error)
- func CreateAccountsWithSimpleAddresses(vm fvm.VM, snapshotTree snapshot.SnapshotTree, ...) (snapshot.SnapshotTree, []flow.Address, error)
- func CreateAddAccountKeyTransaction(t *testing.T, accountKey *flow.AccountPrivateKey) *flow.TransactionBody
- func CreateAddAnAccountKeyMultipleTimesTransaction(t *testing.T, accountKey *flow.AccountPrivateKey, counts int) *flow.TransactionBody
- func CreateContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address, ...) *flow.TransactionBody
- func CreateCounterPanicTransaction(counter, signer flow.Address) *flow.TransactionBody
- func CreateCounterTransaction(counter, signer flow.Address) *flow.TransactionBody
- func CreateEmitEventTransaction(contractAccount, signer flow.Address) *flow.TransactionBody
- func CreateMultiAccountCreationTransaction(t *testing.T, chain flow.Chain, n int) (flow.AccountPrivateKey, *flow.TransactionBody)
- func CreateTokenTransferTransaction(chain flow.Chain, amount int, to flow.Address, signer flow.Address) *flow.TransactionBody
- func CreateUnauthorizedContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address) *flow.TransactionBody
- func DeployCounterContractTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody
- func DeployEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody
- func DeployGlobalReplayLimitedTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody
- func DeployLocalReplayLimitedTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody
- func DeployUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
- func EntropyProviderFixture(source []byte) environment.EntropyProvider
- func GenerateAccountPrivateKey() (flow.AccountPrivateKey, error)
- func GenerateAccountPrivateKeys(numberOfPrivateKeys int) ([]flow.AccountPrivateKey, error)
- func ProtocolStateWithSourceFixture(source []byte) protocol.State
- func RemoveContractDeploymentTransaction(contractName string, authorizer flow.Address, chain flow.Chain) *flow.TransactionBody
- func RemoveContractUnathorizedDeploymentTransaction(contractName string, authorizer flow.Address) *flow.TransactionBody
- func RemoveCounterContractTransaction(authorizer flow.Address, chain flow.Chain) *flow.TransactionBody
- func RemoveUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
- func RootBootstrappedLedger(vm fvm.VM, ctx fvm.Context, additionalOptions ...fvm.BootstrapProcedureOption) snapshot.SnapshotTree
- func SignEnvelope(tx *flow.TransactionBody, account flow.Address, ...) error
- func SignPayload(tx *flow.TransactionBody, account flow.Address, ...) error
- func SignTransaction(tx *flow.TransactionBody, address flow.Address, ...) error
- func SignTransactionAsServiceAccount(tx *flow.TransactionBody, seqNum uint64, chain flow.Chain) error
- func UnauthorizedDeployEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody
- func UpdateContractDeploymentTransaction(contractName string, contract string, authorizer flow.Address, ...) *flow.TransactionBody
- func UpdateContractUnathorizedDeploymentTransaction(contractName string, contract string, authorizer flow.Address) *flow.TransactionBody
- func UpdateEventContractTransaction(authorizer flow.Address, chain flow.Chain, eventValue int) *flow.TransactionBody
- func UpdateUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
- type MockFinalizedReader
Constants ¶
const CounterContract = `` /* 304-byte string literal not displayed */
const CounterContractV2 = `` /* 391-byte string literal not displayed */
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 ComputationResultFixture ¶ added in v0.31.0
func ComputationResultFixture(t *testing.T) *execution.ComputationResult
TODO(ramtin): when we get rid of BlockExecutionData, this could move to the global unittest fixtures TrieUpdates are internal data to the ledger package and should not have leaked into packages like uploader in the first place
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, snapshotTree snapshot.SnapshotTree, privateKeys []flow.AccountPrivateKey, chain flow.Chain, ) ( snapshot.SnapshotTree, []flow.Address, error, )
CreateAccounts inserts accounts into the ledger using the provided private keys.
func CreateAccountsWithSimpleAddresses ¶
func CreateAccountsWithSimpleAddresses( vm fvm.VM, snapshotTree snapshot.SnapshotTree, privateKeys []flow.AccountPrivateKey, chain flow.Chain, ) ( snapshot.SnapshotTree, []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 ¶ added in v0.21.0
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 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 ¶ added in v0.14.6
func CreateEmitEventTransaction(contractAccount, signer flow.Address) *flow.TransactionBody
func CreateMultiAccountCreationTransaction ¶ added in v0.23.1
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 ¶ added in v0.27.0
func DeployEventContractTransaction ¶ added in v0.14.6
func DeployGlobalReplayLimitedTransaction ¶ added in v0.30.0
func DeployLocalReplayLimitedTransaction ¶ added in v0.30.0
func DeployUnauthorizedCounterContractTransaction ¶
func DeployUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
func EntropyProviderFixture ¶ added in v0.32.0
func EntropyProviderFixture(source []byte) environment.EntropyProvider
EntropyProviderFixture returns an entropy provider mock that supports RandomSource(). If input is nil, a random source fixture is generated.
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 ProtocolStateWithSourceFixture ¶ added in v0.32.0
ProtocolStateWithSourceFixture returns a protocol state mock that only supports AtBlockID to return a snapshot mock. The snapshot mock only supports RandomSource(). If input is nil, a random source fixture is generated.
func RemoveContractDeploymentTransaction ¶ added in v0.26.5
func RemoveContractUnathorizedDeploymentTransaction ¶ added in v0.26.5
func RemoveContractUnathorizedDeploymentTransaction(contractName string, authorizer flow.Address) *flow.TransactionBody
func RemoveCounterContractTransaction ¶ added in v0.26.5
func RemoveUnauthorizedCounterContractTransaction ¶ added in v0.26.5
func RemoveUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
func RootBootstrappedLedger ¶
func RootBootstrappedLedger( vm fvm.VM, ctx fvm.Context, additionalOptions ...fvm.BootstrapProcedureOption, ) snapshot.SnapshotTree
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 UnauthorizedDeployEventContractTransaction ¶ added in v0.14.6
func UpdateContractDeploymentTransaction ¶ added in v0.14.6
func UpdateContractUnathorizedDeploymentTransaction ¶ added in v0.26.0
func UpdateEventContractTransaction ¶ added in v0.14.6
func UpdateUnauthorizedCounterContractTransaction ¶ added in v0.26.0
func UpdateUnauthorizedCounterContractTransaction(authorizer flow.Address) *flow.TransactionBody
Types ¶
type MockFinalizedReader ¶ added in v0.33.1
type MockFinalizedReader struct {
// contains filtered or unexported fields
}
func NewMockFinalizedReader ¶ added in v0.33.1
func (*MockFinalizedReader) BlockAtHeight ¶ added in v0.33.1
func (r *MockFinalizedReader) BlockAtHeight(height uint64) *flow.Block
func (*MockFinalizedReader) FinalizedBlockIDAtHeight ¶ added in v0.33.1
func (r *MockFinalizedReader) FinalizedBlockIDAtHeight(height uint64) (flow.Identifier, error)
func (*MockFinalizedReader) FinalizedCalled ¶ added in v0.33.1
func (r *MockFinalizedReader) FinalizedCalled() int
func (*MockFinalizedReader) MockFinal ¶ added in v0.33.1
func (r *MockFinalizedReader) MockFinal(height uint64) error