compile unit tests

This commit is contained in:
akildemir
2025-06-24 13:18:08 +03:00
parent ae02dcbe9a
commit 2b31c8ad69
6 changed files with 22 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ using namespace cryptonote;
void wallet_accessor_test::set_account(tools::wallet2 * wallet, cryptonote::account_base& account)
{
wallet->clear();
wallet->m_account = account;
// wallet->m_account = account;
wallet->m_key_device_type = account.get_device().get_type();
wallet->m_account_public_address = account.get_keys().m_account_address;

View File

@@ -158,6 +158,7 @@ static void subtest_multi_account_transfer_over_transaction(const unittest_trans
make_carrot_transaction_proposal_v1_transfer(normal_payment_proposals,
selfsend_payment_proposals,
tx_preproposal.fee_per_weight,
5,
tx_preproposal.extra_extra,
make_fake_input_selection_callback(),
ss_keys.carrot_account_spend_pubkey,

View File

@@ -57,7 +57,7 @@ namespace test
auto const& key = boost::get<cryptonote::txout_to_tagged_key>(input.value().target);
actual_sources.push_back(
{{}, 0, key_field.pub_key, {}, std::size_t(input.index()), input.value().amount, rct, rct::identity()}
{{}, 0, key_field.pub_key, {}, std::size_t(input.index()), input.value().amount, rct, false, false, rct::identity()}
);
for (unsigned ring = 0; ring < 10; ++ring)

View File

@@ -407,6 +407,7 @@ cryptonote::transaction construct_carrot_pruned_transaction_fake_inputs(
normal_payment_proposals,
selfsend_payment_proposals,
fake_fee_per_weight,
5,
/*extra=*/{},
std::move(select_inputs),
acc_keys.m_account_address.m_spend_public_key,

View File

@@ -159,9 +159,11 @@ TEST(wallet_scanning, view_scan_long_payment_id)
// call view_incoming_scan_transaction with no meaningful key nor subaddresses maps,
// just with the proper ECDH
std::vector<std::optional<tools::wallet::enote_view_incoming_scan_info_t>> enote_scan_infos(tx.vout.size());
tools::keystore keystore;
tools::wallet::view_incoming_scan_transaction(tx,
bob.get_keys(),
{{bob_main_spend_pubkey, {}}}, // use a fake subaddress map with just the provided address in it
// {{bob_main_spend_pubkey, {}}}, use a fake subaddress map with just the provided address in it
keystore,
epee::to_mut_span(enote_scan_infos));
bool matched = false;
@@ -236,9 +238,11 @@ TEST(wallet_scanning, view_scan_short_payment_id)
// call view_incoming_scan_transaction with no meaningful key nor subaddresses maps,
// just with the proper ECDH
std::vector<std::optional<tools::wallet::enote_view_incoming_scan_info_t>> enote_scan_infos(tx.vout.size());
tools::keystore keystore;
tools::wallet::view_incoming_scan_transaction(tx,
bob.get_keys(),
{{bob_main_spend_pubkey, {}}}, // use a fake subaddress map with just the provided address in it
// {{bob_main_spend_pubkey, {}}}, // use a fake subaddress map with just the provided address in it
keystore,
epee::to_mut_span(enote_scan_infos));
bool matched = false;

View File

@@ -160,16 +160,15 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_transfer_1)
const uint64_t top_block_index = std::max(transfers.front().m_block_height, transfers.back().m_block_height)
+ CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE;
tools::wallet2 w;
const std::vector<carrot::CarrotTransactionProposalV1> tx_proposals = tools::wallet::make_carrot_transaction_proposals_wallet2_transfer(
transfers,
{{alice.get_keys().m_account_address.m_spend_public_key, {}}},
w,
dsts,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
/*subaddr_account=*/0,
/*subaddr_indices=*/{},
/*ignore_above=*/MONEY_SUPPLY,
/*ignore_below=*/0,
{},
top_block_index);
@@ -223,16 +222,15 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_transfer_2)
carrot::mock::convert_destination_v1(bob.cryptonote_address(), out_amount)
};
tools::wallet2 w;
const std::vector<carrot::CarrotTransactionProposalV1> tx_proposals = tools::wallet::make_carrot_transaction_proposals_wallet2_transfer(
transfers,
alice.subaddress_map_cn(),
w,
dsts,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
/*subaddr_account=*/spending_subaddr_account,
/*subaddr_indices=*/{},
/*ignore_above=*/MONEY_SUPPLY,
/*ignore_below=*/0,
{},
top_block_index);
@@ -298,6 +296,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_1)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/1,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
transfers.front().m_block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE);
ASSERT_EQ(1, tx_proposals.size());
@@ -332,6 +331,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_2)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/FCMP_PLUS_PLUS_MAX_OUTPUTS - 1,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
transfers.front().m_block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE);
ASSERT_EQ(1, tx_proposals.size());
@@ -374,6 +374,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_3)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/FCMP_PLUS_PLUS_MAX_OUTPUTS,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
transfers.front().m_block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE);
ASSERT_EQ(1, tx_proposals.size());
@@ -449,6 +450,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_4)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/n_dests_per_tx,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
top_block_index);
ASSERT_EQ(4, tx_proposals.size());
@@ -530,6 +532,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_5)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/n_dests_per_tx,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
top_block_index);
ASSERT_EQ(8, tx_proposals.size());
@@ -614,6 +617,7 @@ TEST(wallet_tx_builder, make_carrot_transaction_proposals_wallet2_sweep_6)
/*is_subaddress=*/false,
/*n_dests_per_tx=*/n_dests_per_tx,
/*fee_per_weight=*/1,
5,
/*extra=*/{},
top_block_index);
ASSERT_EQ(1, tx_proposals.size());