Monero
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
block_weight.cpp File Reference
#include <stdio.h>
#include <math.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 block_weight.cpp:

Macros

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

Enumerations

enum  test_t { test_max = 0 , test_lcg = 1 , test_min = 2 }
 

Functions

static uint32_t lcg ()
 
static void test (test_t t, uint64_t blocks)
 
int main ()
 

Variables

static uint32_t lcg_seed = 0
 

Macro Definition Documentation

◆ IN_UNIT_TESTS

#define IN_UNIT_TESTS

◆ LONG_TERM_BLOCK_WEIGHT_WINDOW

#define LONG_TERM_BLOCK_WEIGHT_WINDOW   5000

◆ PREFIX

#define PREFIX ( hf_version)    PREFIX_WINDOW(hf_version, LONG_TERM_BLOCK_WEIGHT_WINDOW)

◆ PREFIX_WINDOW

#define PREFIX_WINDOW ( hf_version,
window )
Value:
std::unique_ptr<cryptonote::Blockchain> bc; \
bc.reset(new cryptonote::Blockchain(txpool)); \
struct get_test_options { \
const std::pair<uint8_t, uint64_t> hard_forks[3]; \
window, \
}; \
get_test_options(): hard_forks{std::make_pair(1, (uint64_t)0), std::make_pair((uint8_t)hf_version, (uint64_t)LONG_TERM_BLOCK_WEIGHT_WINDOW), std::make_pair((uint8_t)0, (uint64_t)0)} {} \
} opts; \
bool r = blockchain->init(new TestDB(), cryptonote::FAKECHAIN, true, &opts.test_options, 0, NULL); \
if (!r) \
{ \
fprintf(stderr, "Failed to init blockchain\n"); \
exit(1); \
}
#define LONG_TERM_BLOCK_WEIGHT_WINDOW
Definition block_weight.cpp:38
Definition blockchain.h:103
Transaction pool, handles transactions which are not part of a block.
Definition tx_pool.h:99
Definition blockchain.py:1
@ FAKECHAIN
Definition cryptonote_config.h:306
Definition enums.h:68
r
Definition testupnpigd.py:61
Definition txpool.py:1
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Definition cryptonote_core.h:61
Definition chaingen.h:725
const std::pair< uint8_t, uint64_t > hard_forks[2]
Definition chaingen.h:726
const cryptonote::test_options test_options
Definition chaingen.h:727

Enumeration Type Documentation

◆ test_t

enum test_t
Enumerator
test_max 
test_lcg 
test_min 

Function Documentation

◆ lcg()

static uint32_t lcg ( )
static

◆ main()

int main ( void )

◆ test()

static void test ( test_t t,
uint64_t blocks )
static

Variable Documentation

◆ lcg_seed

uint32_t lcg_seed = 0
static