1
0
Fork 0
forked from lthn/blockchain

unit_tests & performance_tests: fixed compilation error

This commit is contained in:
sowle 2023-07-14 01:30:26 +02:00
parent e2d84bfc3b
commit 5ff0f93027
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 6 additions and 3 deletions

View file

@ -17,7 +17,8 @@ public:
m_bob.generate();
if (!construct_miner_tx(0, 0, 0, 2, 0, m_bob.get_keys().account_address, m_bob.get_keys().account_address, m_tx, TRANSACTION_VERSION_PRE_HF4, blobdata(), CURRENCY_MINER_TX_MAX_OUTS))
uint64_t block_reward_without_fee = 0;
if (!construct_miner_tx(0, 0, 0, 2, 0, m_bob.get_keys().account_address, m_bob.get_keys().account_address, m_tx, block_reward_without_fee, TRANSACTION_VERSION_PRE_HF4, blobdata(), CURRENCY_MINER_TX_MAX_OUTS))
return false;
m_tx_pub_key = get_tx_pub_key_from_extra(m_tx);

View file

@ -14,7 +14,8 @@ TEST(parse_and_validate_tx_extra, is_correct_parse_and_validate_tx_extra)
currency::account_base acc;
acc.generate();
currency::blobdata b = "dsdsdfsdfsf";
bool r = currency::construct_miner_tx(0, 0, 10000000000000, 1000, TESTS_DEFAULT_FEE, acc.get_keys().account_address, acc.get_keys().account_address, tx, TRANSACTION_VERSION_PRE_HF4, b, 1);
uint64_t block_reward_without_fee = 0;
bool r = currency::construct_miner_tx(0, 0, 10000000000000, 1000, TESTS_DEFAULT_FEE, acc.get_keys().account_address, acc.get_keys().account_address, tx, block_reward_without_fee, TRANSACTION_VERSION_PRE_HF4, b, 1);
ASSERT_TRUE(r);
crypto::public_key tx_pub_key;
r = currency::parse_and_validate_tx_extra(tx, tx_pub_key);
@ -26,7 +27,8 @@ TEST(parse_and_validate_tx_extra, is_correct_extranonce_too_big)
currency::account_base acc;
acc.generate();
currency::blobdata b(260, 0);
bool r = currency::construct_miner_tx(0, 0, 10000000000000, 1000, TESTS_DEFAULT_FEE, acc.get_keys().account_address, acc.get_keys().account_address, tx, TRANSACTION_VERSION_PRE_HF4, b, 1);
uint64_t block_reward_without_fee = 0;
bool r = currency::construct_miner_tx(0, 0, 10000000000000, 1000, TESTS_DEFAULT_FEE, acc.get_keys().account_address, acc.get_keys().account_address, tx, block_reward_without_fee, TRANSACTION_VERSION_PRE_HF4, b, 1);
ASSERT_FALSE(r);
}