Electroneum
gen_double_spend_in_different_blocks< txs_keeped_by_block > Struct Template Reference

#include <double_spend.h>

Inheritance diagram for gen_double_spend_in_different_blocks< txs_keeped_by_block >:
Collaboration diagram for gen_double_spend_in_different_blocks< txs_keeped_by_block >:

Public Member Functions

bool generate (std::vector< test_event_entry > &events) const
 
- Public Member Functions inherited from gen_double_spend_base< gen_double_spend_in_different_blocks< txs_keeped_by_block > >
 gen_double_spend_base ()
 
bool check_tx_verification_context (const cryptonote::tx_verification_context &tvc, bool tx_added, size_t event_idx, const cryptonote::transaction &tx)
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &block)
 
bool mark_last_valid_block (cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
bool mark_invalid_tx (cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
bool mark_invalid_block (cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
bool check_double_spend (cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
- Public Member Functions inherited from test_chain_unit_base
void register_callback (const std::string &cb_name, verify_callback cb)
 
bool verify (const std::string &cb_name, cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)
 
bool check_block_verification_context (const cryptonote::block_verification_context &bvc, size_t event_idx, const cryptonote::block &)
 
bool check_tx_verification_context (const cryptonote::tx_verification_context &tvc, bool, size_t, const cryptonote::transaction &)
 
bool check_tx_verification_context_array (const std::vector< cryptonote::tx_verification_context > &tvcs, size_t, size_t, const std::vector< cryptonote::transaction > &)
 

Static Public Attributes

static const uint64_t send_amount = FIRST_BLOCK_REWARD - TESTS_DEFAULT_FEE
 
static const bool has_invalid_tx = !txs_keeped_by_block
 
static const size_t expected_pool_txs_count = has_invalid_tx ? 0 : 1
 
static const uint64_t expected_bob_balance = 0
 
static const uint64_t expected_alice_balance = send_amount - TESTS_DEFAULT_FEE
 
- Static Public Attributes inherited from gen_double_spend_base< gen_double_spend_in_different_blocks< txs_keeped_by_block > >
static const uint64_t send_amount
 

Additional Inherited Members

- Public Types inherited from test_chain_unit_base
typedef boost::function< bool(cryptonote::core &c, size_t ev_index, const std::vector< test_event_entry > &events)> verify_callback
 
typedef std::map< std::string, verify_callbackcallbacks_map
 

Detailed Description

template<bool txs_keeped_by_block>
struct gen_double_spend_in_different_blocks< txs_keeped_by_block >

Definition at line 89 of file double_spend.h.

Member Function Documentation

◆ generate()

template<bool txs_keeped_by_block>
bool gen_double_spend_in_different_blocks< txs_keeped_by_block >::generate ( std::vector< test_event_entry > &  events) const

Member Data Documentation

◆ expected_alice_balance

template<bool txs_keeped_by_block>
const uint64_t gen_double_spend_in_different_blocks< txs_keeped_by_block >::expected_alice_balance = send_amount - TESTS_DEFAULT_FEE
static

Definition at line 95 of file double_spend.h.

◆ expected_bob_balance

template<bool txs_keeped_by_block>
const uint64_t gen_double_spend_in_different_blocks< txs_keeped_by_block >::expected_bob_balance = 0
static

Definition at line 94 of file double_spend.h.

◆ expected_pool_txs_count

template<bool txs_keeped_by_block>
const size_t gen_double_spend_in_different_blocks< txs_keeped_by_block >::expected_pool_txs_count = has_invalid_tx ? 0 : 1
static

Definition at line 93 of file double_spend.h.

◆ has_invalid_tx

template<bool txs_keeped_by_block>
const bool gen_double_spend_in_different_blocks< txs_keeped_by_block >::has_invalid_tx = !txs_keeped_by_block
static

Definition at line 92 of file double_spend.h.

◆ send_amount

template<bool txs_keeped_by_block>
const uint64_t gen_double_spend_in_different_blocks< txs_keeped_by_block >::send_amount = FIRST_BLOCK_REWARD - TESTS_DEFAULT_FEE
static

Definition at line 91 of file double_spend.h.


The documentation for this struct was generated from the following file: