15#include <boost/test/unit_test.hpp>
25 std::vector<CAmount> feeV;
29 for (
int j = 0; j < 10; j++) {
30 feeV.push_back(basefee * (j+1));
37 std::list<CTxMemPoolEntry> mempool_txs[10];
41 for (
unsigned int i = 0; i < 128; i++)
45 tx.
vin[0].scriptSig = garbage;
47 tx.
vout[0].nValue=0LL;
51 std::vector<RemovedMempoolTransactionInfo> block_txs;
57 while (blocknum < 200) {
58 for (
int j = 0; j < 10; j++) {
59 for (
int k = 0;
k < 4;
k++) {
60 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
76 for (
int h = 0; h <= blocknum%10; h++) {
80 while (mempool_txs[9 - h].size()) {
81 auto& tx_entry = mempool_txs[9 - h].back();
82 block_txs.emplace_back(tx_entry);
83 mempool_txs[9 - h].pop_back();
100 std::vector<CAmount> origFeeEst;
107 for (
int i = 1; i < 10;i++) {
119 for (
int i = 10; i <= 48; i++) {
125 while (blocknum < 250) {
130 for (
int i = 2; i < 10;i++) {
138 while (blocknum < 265) {
139 for (
int j = 0; j < 10; j++) {
140 for (
int k = 0;
k < 4;
k++) {
141 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
159 for (
int i = 1; i < 10;i++) {
165 for (
int j = 0; j < 10; j++) {
166 while (mempool_txs[j].size()) {
167 auto& tx_entry = mempool_txs[j].back();
168 block_txs.emplace_back(tx_entry);
169 mempool_txs[j].pop_back();
177 for (
int i = 2; i < 10;i++) {
183 while (blocknum < 665) {
184 for (
int j = 0; j < 10; j++) {
185 for (
int k = 0;
k < 4;
k++) {
186 tx.
vin[0].prevout.n = 10000*blocknum+100*j+
k;
201 block_txs.emplace_back(tx_entry);
209 for (
int i = 2; i < 9; i++) {
int64_t CAmount
Amount in satoshis (Can be negative).
constexpr bool DEFAULT_ACCEPT_STALE_FEE_ESTIMATES
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
void processTransaction(const NewMempoolTransactionInfo &tx) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Process a transaction accepted to the mempool.
CFeeRate estimateFee(int confTarget) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
DEPRECATED.
void processBlock(const std::vector< RemovedMempoolTransactionInfo > &txs_removed_for_block, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(!m_cs_fee_estimator)
Process all the transactions that have been included in a block.
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
CAmount GetFeePerK() const
Return the fee in satoshis for a vsize of 1000 vbytes.
Serialized script, used inside transaction inputs and outputs.
CTransaction(const CMutableTransaction &tx)
Convert a CMutableTransaction into a CTransaction.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool...
void push_back(const T &value)
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
fs::path BlockPolicyFeeEstPath(const ArgsManager &argsman)
BOOST_AUTO_TEST_CASE(ipc_tests)
#define BOOST_CHECK(expr)
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
Compute the virtual transaction size (weight reinterpreted as bytes).
A mutable version of CTransaction.
std::vector< CTxOut > vout
Testing setup that performs all steps up until right before ChainstateManager gets initialized.
NewMempoolTransactionInfo(const CTransactionRef &tx, const CAmount &fee, const int64_t vsize, const unsigned int height, const bool mempool_limit_bypassed, const bool submitted_in_package, const bool chainstate_is_current, const bool has_no_mempool_parents)
TestMemPoolEntryHelper & Time(NodeSeconds tp)
CTxMemPoolEntry FromTx(const CMutableTransaction &tx) const
TestMemPoolEntryHelper & Height(unsigned int _height)
TestMemPoolEntryHelper & Fee(CAmount _fee)
T Now()
Return the current time point cast to the given precision.