Wire Sysio Wire Sysion 1.0.0
|
#include <tester.hpp>
Public Types | |
typedef string | action_result |
Static Public Member Functions | |
template<typename KeyType = fc::ecc::private_key_shim> | |
static auto | get_private_key (name keyname, string role="owner") |
template<typename KeyType = fc::ecc::private_key_shim> | |
static auto | get_public_key (name keyname, string role="owner") |
static vector< uint8_t > | to_uint8_vector (const string &s) |
static vector< uint8_t > | to_uint8_vector (uint64_t x) |
static uint64_t | to_uint64 (fc::variant x) |
static string | to_string (fc::variant x) |
static action_result | success () |
static action_result | error (const string &msg) |
static action_result | wasm_assert_msg (const string &msg) |
static action_result | wasm_assert_code (uint64_t error_code) |
static genesis_state | default_genesis () |
static std::pair< controller::config, genesis_state > | default_config (const fc::temp_directory &tempdir, std::optional< uint32_t > genesis_max_inline_action_size=std::optional< uint32_t >{}, std::optional< uint32_t > config_max_nonprivileged_inline_action_size=std::optional< uint32_t >{}) |
Public Attributes | |
unique_ptr< controller > | control |
std::map< chain::public_key_type, chain::private_key_type > | block_signing_private_keys |
vector< digest_type > | protocol_features_to_be_activated_wo_preactivation |
Static Public Attributes | |
static const uint32_t | DEFAULT_EXPIRATION_DELTA = 6 |
static const uint32_t | DEFAULT_BILLED_CPU_TIME_US = 2000 |
static const fc::microseconds | abi_serializer_max_time {1000*1000} |
Protected Member Functions | |
signed_block_ptr | _produce_block (fc::microseconds skip_time, bool skip_pending_trxs) |
signed_block_ptr | _produce_block (fc::microseconds skip_time, bool skip_pending_trxs, bool no_throw, std::vector< transaction_trace_ptr > &traces) |
void | _start_block (fc::time_point block_time) |
signed_block_ptr | _finish_block () |
Definition at line 146 of file tester.hpp.
Definition at line 148 of file tester.hpp.
|
inlinevirtual |
Definition at line 155 of file tester.hpp.
|
protected |
Definition at line 416 of file tester.cpp.
|
protected |
Definition at line 338 of file tester.cpp.
|
protected |
Definition at line 343 of file tester.cpp.
|
protected |
Definition at line 383 of file tester.cpp.
bool sysio::testing::base_tester::chain_has_transaction | ( | const transaction_id_type & | txid | ) | const |
Definition at line 953 of file tester.cpp.
void sysio::testing::base_tester::close | ( | ) |
Definition at line 255 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::create_account | ( | account_name | name, |
account_name | creator = config::system_account_name, | ||
bool | multisig = false, | ||
bool | include_code = true ) |
Definition at line 516 of file tester.cpp.
|
inline |
Definition at line 234 of file tester.hpp.
|
inlinestatic |
Definition at line 396 of file tester.hpp.
|
inlinestatic |
Definition at line 388 of file tester.hpp.
void sysio::testing::base_tester::delete_authority | ( | account_name | account, |
permission_name | perm ) |
Definition at line 903 of file tester.cpp.
void sysio::testing::base_tester::delete_authority | ( | account_name | account, |
permission_name | perm, | ||
const vector< permission_level > & | auths, | ||
const vector< private_key_type > & | keys ) |
Definition at line 886 of file tester.cpp.
|
inlinestatic |
Definition at line 333 of file tester.hpp.
void sysio::testing::base_tester::execute_setup_policy | ( | const setup_policy | policy | ) |
Definition at line 192 of file tester.cpp.
|
inline |
Definition at line 288 of file tester.hpp.
const table_id_object * sysio::testing::base_tester::find_table | ( | name | code, |
name | scope, | ||
name | table ) |
Definition at line 1125 of file tester.cpp.
|
pure virtual |
Implemented in sysio::testing::tester, and sysio::testing::validating_tester.
|
inline |
Definition at line 283 of file tester.hpp.
|
inline |
Definition at line 278 of file tester.hpp.
action sysio::testing::base_tester::get_action | ( | account_name | code, |
action_name | acttype, | ||
vector< permission_level > | auths, | ||
const variant_object & | data ) const |
Definition at line 680 of file tester.cpp.
|
inline |
Definition at line 379 of file tester.hpp.
asset sysio::testing::base_tester::get_currency_balance | ( | const account_name & | code, |
const symbol & | asset_symbol, | ||
const account_name & | account ) const |
Reads balance as stored by generic_currency contract
Definition at line 966 of file tester.cpp.
|
inline |
Definition at line 320 of file tester.hpp.
|
inlinestatic |
Definition at line 293 of file tester.hpp.
vector< producer_authority > sysio::testing::base_tester::get_producer_authorities | ( | const vector< account_name > & | producer_names | ) | const |
Definition at line 1079 of file tester.cpp.
|
inlinestatic |
Definition at line 303 of file tester.hpp.
|
inline |
Definition at line 339 of file tester.hpp.
vector< char > sysio::testing::base_tester::get_row_by_account | ( | name | code, |
name | scope, | ||
name | table, | ||
const account_name & | act ) const |
Definition at line 986 of file tester.cpp.
vector< transaction_id_type > sysio::testing::base_tester::get_scheduled_transactions | ( | ) | const |
These transaction IDs represent transactions available in the head chain state as scheduled or otherwise generated transactions.
calling push_scheduled_transaction with these IDs will remove the associated transaction from the chain state IFF it succeeds or objectively fails
Definition at line 461 of file tester.cpp.
|
inline |
Definition at line 358 of file tester.hpp.
const transaction_receipt & sysio::testing::base_tester::get_transaction_receipt | ( | const transaction_id_type & | txid | ) | const |
Definition at line 958 of file tester.cpp.
|
inline |
Definition at line 199 of file tester.hpp.
void sysio::testing::base_tester::init | ( | const setup_policy | policy = setup_policy::full, |
db_read_mode | read_mode = db_read_mode::SPECULATIVE, | ||
std::optional< uint32_t > | genesis_max_inline_action_size = std::optional<uint32_t>{}, | ||
std::optional< uint32_t > | config_max_nonprivileged_inline_action_size = std::optional<uint32_t>{} ) |
Definition at line 153 of file tester.cpp.
void sysio::testing::base_tester::init | ( | controller::config | config | ) |
Definition at line 172 of file tester.cpp.
void sysio::testing::base_tester::init | ( | controller::config | config, |
const genesis_state & | genesis ) |
void sysio::testing::base_tester::init | ( | controller::config | config, |
const snapshot_reader_ptr & | snapshot ) |
void sysio::testing::base_tester::init | ( | controller::config | config, |
protocol_feature_set && | pfs ) |
void sysio::testing::base_tester::init | ( | controller::config | config, |
protocol_feature_set && | pfs, | ||
const genesis_state & | genesis ) |
void sysio::testing::base_tester::init | ( | controller::config | config, |
protocol_feature_set && | pfs, | ||
const snapshot_reader_ptr & | snapshot ) |
bool sysio::testing::base_tester::is_same_chain | ( | base_tester & | other | ) |
Definition at line 149 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::issue | ( | account_name | to, |
string | amount, | ||
account_name | currency, | ||
string | memo ) |
Definition at line 800 of file tester.cpp.
void sysio::testing::base_tester::link_authority | ( | account_name | account, |
account_name | code, | ||
permission_name | req, | ||
action_name | type = {} ) |
Definition at line 828 of file tester.cpp.
void sysio::testing::base_tester::open | ( | const genesis_state & | genesis | ) |
Definition at line 264 of file tester.cpp.
void sysio::testing::base_tester::open | ( | const snapshot_reader_ptr & | snapshot | ) |
void sysio::testing::base_tester::open | ( | protocol_feature_set && | pfs, |
const genesis_state & | genesis ) |
Definition at line 311 of file tester.cpp.
void sysio::testing::base_tester::open | ( | protocol_feature_set && | pfs, |
const snapshot_reader_ptr & | snapshot ) |
Definition at line 303 of file tester.cpp.
void sysio::testing::base_tester::open | ( | protocol_feature_set && | pfs, |
std::optional< chain_id_type > | expected_chain_id, | ||
Lambda | lambda ) |
Definition at line 273 of file tester.cpp.
void sysio::testing::base_tester::open | ( | protocol_feature_set && | pfs, |
std::optional< chain_id_type > | expected_chain_id = {} ) |
void sysio::testing::base_tester::open | ( | std::optional< chain_id_type > | expected_chain_id = {} | ) |
void sysio::testing::base_tester::preactivate_all_builtin_protocol_features | ( | ) |
Definition at line 1158 of file tester.cpp.
void sysio::testing::base_tester::preactivate_builtin_protocol_features | ( | const std::vector< builtin_protocol_feature_t > & | features | ) |
Definition at line 1145 of file tester.cpp.
void sysio::testing::base_tester::preactivate_protocol_features | ( | const vector< digest_type > | feature_digests | ) |
Definition at line 1138 of file tester.cpp.
|
pure virtual |
Implemented in sysio::testing::tester, and sysio::testing::validating_tester.
signed_block_ptr sysio::testing::base_tester::produce_block | ( | std::vector< transaction_trace_ptr > & | traces | ) |
void sysio::testing::base_tester::produce_blocks | ( | uint32_t | n = 1, |
bool | empty = false ) |
Definition at line 451 of file tester.cpp.
void sysio::testing::base_tester::produce_blocks_for_n_rounds | ( | const uint32_t | num_of_rounds = 1 | ) |
Definition at line 483 of file tester.cpp.
void sysio::testing::base_tester::produce_blocks_until_end_of_round | ( | ) |
Definition at line 474 of file tester.cpp.
|
pure virtual |
Implemented in sysio::testing::tester, and sysio::testing::validating_tester.
void sysio::testing::base_tester::produce_min_num_of_blocks_to_spend_time_wo_inactive_prod | ( | const fc::microseconds | target_elapsed_time = fc::microseconds() | ) |
Definition at line 489 of file tester.cpp.
|
nodiscard |
Definition at line 609 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_action | ( | const account_name & | code, |
const action_name & | acttype, | ||
const account_name & | actor, | ||
const variant_object & | data, | ||
uint32_t | expiration = DEFAULT_EXPIRATION_DELTA, | ||
uint32_t | delay_sec = 0 ) |
Definition at line 631 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_action | ( | const account_name & | code, |
const action_name & | acttype, | ||
const vector< account_name > & | actors, | ||
const variant_object & | data, | ||
uint32_t | expiration = DEFAULT_EXPIRATION_DELTA, | ||
uint32_t | delay_sec = 0 ) |
Definition at line 645 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_action | ( | const account_name & | code, |
const action_name & | acttype, | ||
const vector< permission_level > & | auths, | ||
const variant_object & | data, | ||
uint32_t | expiration = DEFAULT_EXPIRATION_DELTA, | ||
uint32_t | delay_sec = 0 ) |
Definition at line 661 of file tester.cpp.
void sysio::testing::base_tester::push_block | ( | signed_block_ptr | b | ) |
Definition at line 323 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_dummy | ( | account_name | from, |
const string & | v = "blah", | ||
uint32_t | billed_cpu_time_us = DEFAULT_BILLED_CPU_TIME_US ) |
Definition at line 731 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_reqauth | ( | account_name | from, |
const vector< permission_level > & | auths, | ||
const vector< private_key_type > & | keys ) |
Definition at line 698 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_reqauth | ( | account_name | from, |
string | role, | ||
bool | multi_sig = false ) |
Definition at line 720 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_transaction | ( | packed_transaction & | trx, |
fc::time_point | deadline = fc::time_point::maximum(), | ||
uint32_t | billed_cpu_time_us = DEFAULT_BILLED_CPU_TIME_US ) |
Definition at line 562 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::push_transaction | ( | signed_transaction & | trx, |
fc::time_point | deadline = fc::time_point::maximum(), | ||
uint32_t | billed_cpu_time_us = DEFAULT_BILLED_CPU_TIME_US, | ||
bool | no_throw = false ) |
Definition at line 581 of file tester.cpp.
void sysio::testing::base_tester::schedule_protocol_features_wo_preactivation | ( | const vector< digest_type > | feature_digests | ) |
Definition at line 1130 of file tester.cpp.
void sysio::testing::base_tester::set_abi | ( | account_name | name, |
const char * | abi_json, | ||
const private_key_type * | signer = nullptr ) |
void sysio::testing::base_tester::set_authority | ( | account_name | account, |
permission_name | perm, | ||
authority | auth, | ||
permission_name | parent, | ||
const vector< permission_level > & | auths, | ||
const vector< private_key_type > & | keys ) |
Definition at line 852 of file tester.cpp.
void sysio::testing::base_tester::set_authority | ( | account_name | account, |
permission_name | perm, | ||
authority | auth, | ||
permission_name | parent = config::owner_name ) |
Definition at line 877 of file tester.cpp.
void sysio::testing::base_tester::set_before_preactivate_bios_contract | ( | ) |
Definition at line 1063 of file tester.cpp.
void sysio::testing::base_tester::set_before_producer_authority_bios_contract | ( | ) |
Definition at line 1068 of file tester.cpp.
void sysio::testing::base_tester::set_bios_contract | ( | ) |
Definition at line 1073 of file tester.cpp.
void sysio::testing::base_tester::set_code | ( | account_name | name, |
const char * | wast, | ||
const private_key_type * | signer = nullptr ) |
Definition at line 909 of file tester.cpp.
void sysio::testing::base_tester::set_code | ( | account_name | name, |
const vector< uint8_t > | wasm, | ||
const private_key_type * | signer = nullptr ) |
|
inline |
Definition at line 321 of file tester.hpp.
transaction_trace_ptr sysio::testing::base_tester::set_producer_schedule | ( | const vector< producer_authority > & | schedule | ) |
Definition at line 1094 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::set_producers | ( | const vector< account_name > & | producer_names | ) |
Definition at line 1088 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::set_producers_legacy | ( | const vector< account_name > & | producer_names | ) |
Definition at line 1107 of file tester.cpp.
void sysio::testing::base_tester::set_transaction_headers | ( | transaction & | trx, |
uint32_t | expiration = DEFAULT_EXPIRATION_DELTA, | ||
uint32_t | delay_sec = 0 ) const |
Definition at line 506 of file tester.cpp.
|
inlinestatic |
Definition at line 331 of file tester.hpp.
void sysio::testing::base_tester::sync_with | ( | base_tester & | other | ) |
Definition at line 1039 of file tester.cpp.
|
static |
Definition at line 1030 of file tester.cpp.
|
static |
Definition at line 1022 of file tester.cpp.
Definition at line 1015 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::transfer | ( | account_name | from, |
account_name | to, | ||
asset | amount, | ||
string | memo, | ||
account_name | currency ) |
Definition at line 771 of file tester.cpp.
transaction_trace_ptr sysio::testing::base_tester::transfer | ( | account_name | from, |
account_name | to, | ||
string | amount, | ||
string | memo, | ||
account_name | currency ) |
Definition at line 766 of file tester.cpp.
void sysio::testing::base_tester::unlink_authority | ( | account_name | account, |
account_name | code, | ||
action_name | type = {} ) |
Definition at line 840 of file tester.cpp.
|
inlinestatic |
Definition at line 337 of file tester.hpp.
|
inlinestatic |
Definition at line 335 of file tester.hpp.
|
static |
Definition at line 153 of file tester.hpp.
std::map<chain::public_key_type, chain::private_key_type> sysio::testing::base_tester::block_signing_private_keys |
Definition at line 437 of file tester.hpp.
|
protected |
Definition at line 439 of file tester.hpp.
|
protected |
Definition at line 440 of file tester.hpp.
unique_ptr<controller> sysio::testing::base_tester::control |
Definition at line 436 of file tester.hpp.
|
static |
Definition at line 152 of file tester.hpp.
|
static |
Definition at line 150 of file tester.hpp.
|
protected |
Definition at line 441 of file tester.hpp.
vector<digest_type> sysio::testing::base_tester::protocol_features_to_be_activated_wo_preactivation |
Definition at line 445 of file tester.hpp.
|
protected |
Definition at line 434 of file tester.hpp.
|
protected |
Definition at line 442 of file tester.hpp.