[][src]Module language_e2e_tests::account_universe

A model to test properties of common Libra transactions.

The structs and functions in this module together form a simplified model of how common Libra transactions should behave. This model is then used as an oracle for property-based tests -- the results of executing transactions through the VM should match the results computed using this model.

For examples of property-based tests written against this model, see the tests/account_universe directory.

Structs

AccountCurrent

Represents the current state of account in a universe, possibly after its state has been updated by running transactions against the universe.

AccountPair

Mutable references to a pair of distinct accounts picked from a universe.

AccountPairGen

Allows pairs of accounts to be uniformly randomly selected from an account universe.

AccountUniverse

A set of accounts that has been set up and can now be used to conduct transactions on.

AccountUniverseGen

A set of accounts which can be used to construct an initial state.

CreateAccountGen

Represents a create-account transaction performed in the account universe.

CreateExistingAccountGen

Represents a create-account transaction in the account universe where the destination already exists.

InsufficientBalanceGen

Represents a insufficient balance transaction

InvalidAuthkeyGen

Represents a authkey mismatch transaction

P2PTransferGen

Represents a peer-to-peer transaction performed in the account universe.

RotateKeyGen

Represents a rotate-key transaction performed in the account universe.

SequenceNumberMismatchGen

Represents a sequence number mismatch transaction

Enums

AccountPickStyle

Determines the sampling algorithm used to pick accounts from the universe.

Traits

AUTransactionGen

Represents any sort of transaction that can be done in an account universe.

Functions

all_transactions_strategy

A strategy that returns a random transaction.

assert_accounts_match

Verify that the account information in the universe matches the information in the executor.

bad_txn_strategy
create_account_strategy
default_num_accounts

The number of accounts to run universe-based proptests with. Set with the UNIVERSE_SIZE environment variable.

default_num_transactions

The number of transactions to run universe-based proptests with. Set with the UNIVERSE_SIZE environment variable (this function will return twice that).

log_balance_strategy

Returns a [Strategy] that provides a variety of balances (or transfer amounts) over a roughly logarithmic distribution.

p2p_strategy
run_and_assert_gas_cost_stability

Run these transactions and make sure that they all cost the same amount of gas.

run_and_assert_universe

Run these transactions and verify the expected output.

txn_one_account_result

Computes the result for running a transfer out of one account. Also updates the account to reflect this transaction.