1
0
Fork 0
forked from lthn/blockchain

Merge branch 'release' into develop

# Conflicts:
#	src/version.h.in
#	src/wallet/wallet_rpc_server.cpp
This commit is contained in:
sowle 2025-07-23 13:22:24 +03:00
commit 4618c240f2
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
7 changed files with 39 additions and 31 deletions

View file

@ -925,9 +925,9 @@ namespace currency
if (crc.is_hardfork_active_for_height(2, top_block_height))
{
// after hardfork 2
tx_payer result = AUTO_VAL_INIT(result);
result.acc_addr = addr;
container.push_back(result);
//tx_payer result = AUTO_VAL_INIT(result);
//result.acc_addr = addr;
//container.push_back(result);
}
else
{
@ -947,9 +947,9 @@ namespace currency
if (crc.is_hardfork_active_for_height(2, top_block_height))
{
// after hardfork 2
tx_receiver result = AUTO_VAL_INIT(result);
result.acc_addr = addr;
container.push_back(result);
//tx_receiver result = AUTO_VAL_INIT(result);
//result.acc_addr = addr;
//container.push_back(result);
}
else
{

View file

@ -8,6 +8,10 @@
#define PROJECT_REVISION "8"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
<<<<<<< HEAD
#define PROJECT_VERSION_BUILD_NO 421
=======
#define PROJECT_VERSION_BUILD_NO 422
>>>>>>> release
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"

View file

@ -529,9 +529,10 @@ namespace tools
if (!req.comment.empty())
{
currency::tx_comment comment = AUTO_VAL_INIT(comment);
comment.comment = req.comment;
extra.push_back(comment);
// tx_comment is temporary disabled -- sowle
//currency::tx_comment comment = AUTO_VAL_INIT(comment);
//comment.comment = req.comment;
//extra.push_back(comment);
}
if (req.push_payer && !wrap)

View file

@ -1615,9 +1615,10 @@ std::string wallets_manager::transfer(uint64_t wallet_id, const view::transfer_p
//process attachments
if (tp.comment.size())
{
currency::tx_comment tc = AUTO_VAL_INIT(tc);
tc.comment = tp.comment;
extra.push_back(tc);
// tx_comment is temporary disabled -- sowle
//currency::tx_comment tc = AUTO_VAL_INIT(tc);
//tc.comment = tp.comment;
//extra.push_back(tc);
}
if (tp.push_payer && !wrap)
{

View file

@ -1263,8 +1263,8 @@ int main(int argc, char* argv[])
GENERATE_AND_PLAY(hard_fork_1_pos_and_locked_coins);
// Hardfork 2 tests
GENERATE_AND_PLAY(hard_fork_2_tx_payer_in_wallet);
GENERATE_AND_PLAY(hard_fork_2_tx_receiver_in_wallet);
//GENERATE_AND_PLAY(hard_fork_2_tx_payer_in_wallet);
//GENERATE_AND_PLAY(hard_fork_2_tx_receiver_in_wallet);
GENERATE_AND_PLAY(hard_fork_2_tx_extra_alias_entry_in_wallet);
GENERATE_AND_PLAY_HF(hard_fork_2_auditable_addresses_basics, "2-*");
GENERATE_AND_PLAY(hard_fork_2_no_new_structures_before_hf);

View file

@ -324,8 +324,8 @@ bool wallet_rpc_transfer::c1(currency::core& c, size_t ev_index, const std::vect
// make sure tx_received is set by default, but tx_payer is not
std::shared_ptr<const transaction_chain_entry> pche = c.get_blockchain_storage().get_tx_chain_entry(td.tx_hash());
CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_receiver>(pche->tx.extra) == 1, false, "tx_receiver: incorrect count of items");
CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_payer>(pche->tx.extra) == 0, false, "tx_payer: incorrect count of items");
//CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_receiver>(pche->tx.extra) == 1, false, "tx_receiver: incorrect count of items");
//CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_payer>(pche->tx.extra) == 0, false, "tx_payer: incorrect count of items");
// 2. check tx_receiver and tx_payer non-default
@ -357,8 +357,8 @@ bool wallet_rpc_transfer::c1(currency::core& c, size_t ev_index, const std::vect
// make sure tx_received is set by default, but tx_payer is not
pche = c.get_blockchain_storage().get_tx_chain_entry(td.tx_hash());
CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_receiver>(pche->tx.extra) == 0, false, "tx_receiver: incorrect count of items");
CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_payer>(pche->tx.extra) == 1, false, "tx_payer: incorrect count of items");
//CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_receiver>(pche->tx.extra) == 0, false, "tx_receiver: incorrect count of items");
//CHECK_AND_ASSERT_MES(currency::count_type_in_variant_container<tx_payer>(pche->tx.extra) == 1, false, "tx_payer: incorrect count of items");
return true;
@ -633,37 +633,38 @@ bool wallet_rpc_exchange_suite::c1(currency::core& c, size_t ev_index, const std
CHECK_RESPONSE_EQUAL(resp.pi.transfers_count == 6);
CHECK_RESPONSE_EQUAL(resp.total_transfers == 6);
CHECK_RESPONSE_EQUAL(resp.transfers.size() == 6);
CHECK_RESPONSE_EQUAL(resp.transfers[0].comment == TRANSFER_COMMENT);
// below: tx_comment is temporary disabled, @#@#TODO -- sowle
//CHECK_RESPONSE_EQUAL(resp.transfers[0].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[0].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[0].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[0].payment_id) == carol_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[0].tx_hash) == carol_tx3);
CHECK_RESPONSE_EQUAL(resp.transfers[1].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[1].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[1].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[1].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[1].payment_id) == carol_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[1].tx_hash) == carol_tx2);
CHECK_RESPONSE_EQUAL(resp.transfers[2].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[2].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[2].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[2].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[2].payment_id) == carol_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[2].tx_hash) == carol_tx1);
CHECK_RESPONSE_EQUAL(resp.transfers[3].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[3].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[3].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[3].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[3].payment_id) == bob_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[3].tx_hash) == bob_tx2);
CHECK_RESPONSE_EQUAL(resp.transfers[4].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[4].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[4].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[4].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[4].payment_id) == bob_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[4].tx_hash) == bob_tx1);
CHECK_RESPONSE_EQUAL(resp.transfers[5].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[5].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[5].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[5].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[5].payment_id) == alice_payment_id);
@ -680,25 +681,25 @@ bool wallet_rpc_exchange_suite::c1(currency::core& c, size_t ev_index, const std
CHECK_RESPONSE_EQUAL(resp.pi.transfers_count == 6);
CHECK_RESPONSE_EQUAL(resp.total_transfers == 6);
CHECK_RESPONSE_EQUAL(resp.transfers.size() == 4);
CHECK_RESPONSE_EQUAL(resp.transfers[0].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[0].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[0].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[0].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[0].payment_id) == carol_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[0].tx_hash) == carol_tx1);
CHECK_RESPONSE_EQUAL(resp.transfers[1].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[1].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[1].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[1].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[1].payment_id) == bob_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[1].tx_hash) == bob_tx2);
CHECK_RESPONSE_EQUAL(resp.transfers[2].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[2].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[2].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[2].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[2].payment_id) == bob_payment_id);
CHECK_RESPONSE_EQUAL(boost::lexical_cast<std::string>(resp.transfers[2].tx_hash) == bob_tx1);
CHECK_RESPONSE_EQUAL(resp.transfers[3].comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(resp.transfers[3].comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(resp.transfers[3].amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(resp.transfers[3].is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(resp.transfers[3].payment_id) == alice_payment_id);
@ -737,7 +738,7 @@ bool wallet_rpc_exchange_suite::c1(currency::core& c, size_t ev_index, const std
CHECK_RESPONSE_EQUAL(st_resp.in.size() == 1);
CHECK_RESPONSE_EQUAL(st_resp.in.begin()->comment == TRANSFER_COMMENT);
//CHECK_RESPONSE_EQUAL(st_resp.in.begin()->comment == TRANSFER_COMMENT);
CHECK_RESPONSE_EQUAL(st_resp.in.begin()->amount == TRANSFER_AMOUNT);
CHECK_RESPONSE_EQUAL(st_resp.in.begin()->is_income == true);
CHECK_RESPONSE_EQUAL(epee::string_tools::buff_to_hex_nodelimer(st_resp.in.begin()->payment_id) == bob_payment_id);

View file

@ -3547,8 +3547,9 @@ bool wallet_sending_to_integrated_address::c1(currency::core& c, size_t ev_index
if (wti.payment_id.empty())
return true; // skip another outputs
CHECK_AND_ASSERT_MES(wti.payment_id == payment_id, false, "incorrect payment id");
CHECK_AND_ASSERT_MES(wti.remote_addresses.size() == 1, false, "remote_addressed.size() = " << wti.remote_addresses.size());
CHECK_AND_ASSERT_MES(wti.remote_addresses[0] == alice_integrated_address, false, "incorrect remote address");
// below: tx_payer and tx_receiver are temporary disabled, @#@#TODO -- sowle
//CHECK_AND_ASSERT_MES(wti.remote_addresses.size() == 1, false, "remote_addressed.size() = " << wti.remote_addresses.size());
//CHECK_AND_ASSERT_MES(wti.remote_addresses[0] == alice_integrated_address, false, "incorrect remote address");
callback_succeded = true;
return true;
}