1
0
Fork 0
forked from lthn/blockchain

code clean-up and ionic_swap_basic_test fixed

This commit is contained in:
sowle 2023-10-04 18:18:11 +02:00
parent 42cd6a8875
commit 6bd09626b1
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
4 changed files with 3 additions and 20 deletions

View file

@ -2116,10 +2116,7 @@ bool simple_wallet::generate_ionic_swap_proposal(const std::vector<std::string>
fail_msg_writer() << "Failed to load json file with asset specification: " << args[0];
return true;
}
// if (proposal_info.expiration_time == 0)
// {
// proposal_info.expiration_time = m_wallet->get_core_runtime_config().get_core_time() + 10 * 60;
// }
currency::account_public_address destination_addr = AUTO_VAL_INIT(destination_addr);
currency::payment_id_t integrated_payment_id;
if (!m_wallet->get_transfer_address(args[1], destination_addr, integrated_payment_id))

View file

@ -5381,10 +5381,6 @@ bool wallet2::build_ionic_swap_template(const wallet_public::ionic_swap_proposal
ctp.mark_tx_as_complete = false;
ctp.crypt_address = destination_addr;
//etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
//t.v = 0;//proposal_detais.expiration_time;
//ctp.extra.push_back(t);
ctp.dsts.resize(proposal_detais.to_bob.size() + proposal_detais.to_alice.size());
size_t i = 0;
// Here is an proposed for exchange funds
@ -5416,7 +5412,6 @@ bool wallet2::build_ionic_swap_template(const wallet_public::ionic_swap_proposal
selected_transfers = ftp.selected_transfers;
currency::finalized_tx finalize_result = AUTO_VAL_INIT(finalize_result);
finalize_transaction(ftp, finalize_result, false);
//add_transfers_to_expiration_list(selected_transfers, for_expiration_list, this->get_core_runtime_config().get_core_time() + proposal_detais.expiration_time, currency::null_hash);
//wrap it all
proposal.tx_template = finalize_result.tx;
@ -5572,13 +5567,6 @@ bool wallet2::get_ionic_swap_proposal_info(const wallet_public::ionic_swap_propo
proposal_info.to_alice.push_back(view::asset_funds{ a.first, a.second - amounts_provided_by_a[a.first] });
}
//etc_tx_details_expiration_time t = AUTO_VAL_INIT(t);
//if (!get_type_in_variant_container(tx.extra, t))
//{
// return false;
//}
//proposal_info.expiration_time = t.v;
return true;
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2014-2022 Zano Project
// Copyright (c) 2014-2023 Zano Project
// Copyright (c) 2014-2018 The Louisdor Project
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@ -140,7 +140,6 @@ bool ionic_swap_basic_test::c1(currency::core& c, size_t ev_index, const std::ve
{
//alice_wlt want to trade with bob_wlt, to exchange 10.0 TCT to 1.0 ZANO
view::ionic_swap_proposal_info proposal_details = AUTO_VAL_INIT(proposal_details);
proposal_details.expiration_time = alice_wlt->get_core_runtime_config().get_core_time() + 10 * 60;
proposal_details.fee_paid_by_a = TESTS_DEFAULT_FEE;
proposal_details.mixins = 10;
proposal_details.to_bob.push_back(view::asset_funds{ asset_id , assets_to_exchange });
@ -198,7 +197,6 @@ bool ionic_swap_basic_test::c1(currency::core& c, size_t ev_index, const std::ve
{
//now alice_wlt want to trade with bob_wlt, to send 1.0 ZANO and get 10.0 TCT in exchange
view::ionic_swap_proposal_info proposal_details = AUTO_VAL_INIT(proposal_details);
proposal_details.expiration_time = alice_wlt->get_core_runtime_config().get_core_time() + 10 * 60;
proposal_details.fee_paid_by_a = TESTS_DEFAULT_FEE;
proposal_details.mixins = 10;
proposal_details.to_bob.push_back(view::asset_funds{ currency::native_coin_asset_id , native_tokens_to_exchange });

View file

@ -1,4 +1,4 @@
// Copyright (c) 2014-2022 Zano Project
// Copyright (c) 2014-2023 Zano Project
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once