Monero
Loading...
Searching...
No Matches
long_term_block_weight.cpp File Reference
#include "gtest/gtest.h"
#include "cryptonote_core/blockchain.h"
#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
#include "blockchain_db/testdb.h"
Include dependency graph for long_term_block_weight.cpp:

Classes

struct  BlockchainAndPool

Macros

#define IN_UNIT_TESTS
#define TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW   5000
#define PREFIX_WINDOW(hf_version, window)
#define PREFIX(hf_version)

Functions

 TEST (long_term_block_weight, empty_short)
 TEST (long_term_block_weight, identical_before_fork)
 TEST (long_term_block_weight, identical_after_fork_before_long_term_window)
 TEST (long_term_block_weight, ceiling_at_30000000)
 TEST (long_term_block_weight, multi_pop)
 TEST (long_term_block_weight, multiple_updates)
 TEST (long_term_block_weight, pop_invariant_max)
 TEST (long_term_block_weight, pop_invariant_random)
 TEST (long_term_block_weight, long_growth_spike_and_drop)
 TEST (long_term_block_weight, cache_matches_true_value)

Macro Definition Documentation

◆ IN_UNIT_TESTS

#define IN_UNIT_TESTS

◆ PREFIX

#define PREFIX ( hf_version)
Value:
#define PREFIX_WINDOW(hf_version, window)
Definition block_weight.cpp:112
#define TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW
Definition long_term_block_weight.cpp:37

◆ PREFIX_WINDOW

#define PREFIX_WINDOW ( hf_version,
window )
Value:
struct get_test_options { \
const std::pair<uint8_t, uint64_t> hard_forks[3]; \
const cryptonote::test_options test_options = { \
hard_forks, \
window, \
}; \
get_test_options(): hard_forks{std::make_pair(1, (uint64_t)0), std::make_pair((uint8_t)hf_version, (uint64_t)1), std::make_pair((uint8_t)0, (uint64_t)0)} {} \
} opts; \
bool r = bc->init(new TestDB(), cryptonote::FAKECHAIN, true, &opts.test_options, 0, NULL); \
Definition blockchain.h:103
bool init(BlockchainDB *db, const network_type nettype=MAINNET, bool offline=false, const cryptonote::test_options *test_options=NULL, difficulty_type fixed_difficulty=0, const GetCheckpointsCallback &get_checkpoints=nullptr)
Initialize the Blockchain state.
Definition blockchain.cpp:283
#define ASSERT_TRUE(condition)
Definition gtest.h:1865
@ FAKECHAIN
Definition cryptonote_config.h:306
Definition enums.h:68
r
Definition testupnpigd.py:61
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Definition long_term_block_weight.cpp:110
cryptonote::Blockchain bc
Definition long_term_block_weight.cpp:112
Definition cryptonote_core.h:61
Definition chaingen.h:725

◆ TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW

#define TEST_LONG_TERM_BLOCK_WEIGHT_WINDOW   5000

Function Documentation

◆ TEST() [1/10]

TEST ( long_term_block_weight ,
cache_matches_true_value  )

◆ TEST() [2/10]

TEST ( long_term_block_weight ,
ceiling_at_30000000  )

◆ TEST() [3/10]

TEST ( long_term_block_weight ,
empty_short  )

◆ TEST() [4/10]

TEST ( long_term_block_weight ,
identical_after_fork_before_long_term_window  )

◆ TEST() [5/10]

TEST ( long_term_block_weight ,
identical_before_fork  )

◆ TEST() [6/10]

TEST ( long_term_block_weight ,
long_growth_spike_and_drop  )

◆ TEST() [7/10]

TEST ( long_term_block_weight ,
multi_pop  )

◆ TEST() [8/10]

TEST ( long_term_block_weight ,
multiple_updates  )

◆ TEST() [9/10]

TEST ( long_term_block_weight ,
pop_invariant_max  )

◆ TEST() [10/10]

TEST ( long_term_block_weight ,
pop_invariant_random  )