Fixed inconsistent types causing error when compiling core tests (#457)

This commit is contained in:
Maxim Shishmarev 2019-03-04 13:50:08 +11:00 committed by Doyle
parent f60bd59faf
commit 2eaeb3b6fd
3 changed files with 7 additions and 7 deletions

View File

@ -37,7 +37,7 @@ using namespace cryptonote;
namespace
{
bool construct_miner_tx_by_weight(transaction& miner_tx, uint64_t height, uint64_t already_generated_coins,
const account_public_address& miner_address, std::vector<size_t>& block_weights, size_t target_tx_weight,
const account_public_address& miner_address, std::vector<uint64_t>& block_weights, size_t target_tx_weight,
size_t target_block_weight, uint64_t fee = 0)
{
if (!construct_miner_tx(height, misc_utils::median(block_weights), already_generated_coins, target_block_weight, fee, miner_address, miner_tx))

View File

@ -408,7 +408,7 @@ uint64_t test_generator::get_already_generated_coins(const cryptonote::block& bl
return get_already_generated_coins(blk_hash);
}
void test_generator::add_block(const cryptonote::block& blk, size_t txs_weight, std::vector<size_t>& block_weights, uint64_t already_generated_coins)
void test_generator::add_block(const cryptonote::block& blk, size_t txs_weight, std::vector<uint64_t>& block_weights, uint64_t already_generated_coins)
{
const size_t block_weight = txs_weight + get_transaction_weight(blk.miner_tx);
@ -454,7 +454,7 @@ static void manual_calc_batched_governance(const test_generator &generator, cons
bool test_generator::construct_block(cryptonote::block& blk, uint64_t height, const crypto::hash& prev_id,
const cryptonote::account_base& miner_acc, uint64_t timestamp, uint64_t already_generated_coins,
std::vector<size_t>& block_weights, const std::list<cryptonote::transaction>& tx_list,
std::vector<uint64_t>& block_weights, const std::list<cryptonote::transaction>& tx_list,
const crypto::public_key& sn_pub_key /* = crypto::null_key */, const std::vector<sn_contributor_t>& sn_infos)
{
/// a temporary workaround
@ -545,7 +545,7 @@ bool test_generator::construct_block(cryptonote::block& blk, uint64_t height, co
bool test_generator::construct_block(cryptonote::block& blk, const cryptonote::account_base& miner_acc, uint64_t timestamp)
{
std::vector<size_t> block_weights;
std::vector<uint64_t> block_weights;
std::list<cryptonote::transaction> tx_list;
return construct_block(blk, 0, null_hash, miner_acc, timestamp, 0, block_weights, tx_list);
}
@ -560,7 +560,7 @@ bool test_generator::construct_block(cryptonote::block& blk, const cryptonote::b
// Keep difficulty unchanged
uint64_t timestamp = blk_prev.timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN;
uint64_t already_generated_coins = get_already_generated_coins(prev_id);
std::vector<size_t> block_weights;
std::vector<uint64_t> block_weights;
get_last_n_block_weights(block_weights, prev_id, CRYPTONOTE_REWARD_BLOCKS_WINDOW);
return construct_block(blk, height, prev_id, miner_acc, timestamp, already_generated_coins, block_weights, tx_list, sn_pub_key, sn_infos);

View File

@ -208,10 +208,10 @@ public:
uint64_t get_already_generated_coins(const crypto::hash& blk_id) const;
uint64_t get_already_generated_coins(const cryptonote::block& blk) const;
void add_block(const cryptonote::block& blk, size_t tsx_size, std::vector<size_t>& block_weights, uint64_t already_generated_coins);
void add_block(const cryptonote::block& blk, size_t tsx_size, std::vector<uint64_t>& block_weights, uint64_t already_generated_coins);
bool construct_block(cryptonote::block& blk, uint64_t height, const crypto::hash& prev_id,
const cryptonote::account_base& miner_acc, uint64_t timestamp, uint64_t already_generated_coins,
std::vector<size_t>& block_weights, const std::list<cryptonote::transaction>& tx_list, const crypto::public_key& sn_pub_key = crypto::null_pkey,
std::vector<uint64_t>& block_weights, const std::list<cryptonote::transaction>& tx_list, const crypto::public_key& sn_pub_key = crypto::null_pkey,
const std::vector<sn_contributor_t>& = {{{crypto::null_pkey, crypto::null_pkey}, STAKING_PORTIONS}});
bool construct_block(cryptonote::block& blk, const cryptonote::account_base& miner_acc, uint64_t timestamp);
bool construct_block(cryptonote::block& blk, const cryptonote::block& blk_prev, const cryptonote::account_base& miner_acc,