From ee3eede5d20668c720c2fb86fd163f4ec0bfee9b Mon Sep 17 00:00:00 2001 From: Paul Shapiro Date: Tue, 23 Oct 2018 16:21:45 -0500 Subject: [PATCH] send step2 clarified arg sending_amount as final_total_wo_fee --- src/monero_transfer_utils.cpp | 4 ++-- src/monero_transfer_utils.hpp | 2 +- src/serial_bridge_index.cpp | 2 +- test/test_all.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/monero_transfer_utils.cpp b/src/monero_transfer_utils.cpp index 021a286..e26d51b 100644 --- a/src/monero_transfer_utils.cpp +++ b/src/monero_transfer_utils.cpp @@ -377,7 +377,7 @@ void monero_transfer_utils::send_step2__try_create_transaction( string sec_spendKey_string, string to_address_string, optional payment_id_string, - uint64_t sending_amount, + uint64_t final_total_wo_fee, uint64_t change_amount, uint64_t fee_amount, uint32_t simple_priority, @@ -396,7 +396,7 @@ void monero_transfer_utils::send_step2__try_create_transaction( from_address_string, sec_viewKey_string, sec_spendKey_string, to_address_string, payment_id_string, - sending_amount, change_amount, fee_amount, + final_total_wo_fee, change_amount, fee_amount, using_outs, mix_outs, use_fork_rules_fn, unlock_time, diff --git a/src/monero_transfer_utils.hpp b/src/monero_transfer_utils.hpp index 6f4fe45..a5bf77e 100644 --- a/src/monero_transfer_utils.hpp +++ b/src/monero_transfer_utils.hpp @@ -216,7 +216,7 @@ namespace monero_transfer_utils string sec_spendKey_string, string to_address_string, optional payment_id_string, - uint64_t sending_amount, + uint64_t final_total_wo_fee, // this gets passed to create_transaction's 'sending_amount' uint64_t change_amount, uint64_t fee_amount, uint32_t simple_priority, diff --git a/src/serial_bridge_index.cpp b/src/serial_bridge_index.cpp index dad6cfe..8463599 100644 --- a/src/serial_bridge_index.cpp +++ b/src/serial_bridge_index.cpp @@ -587,7 +587,7 @@ string serial_bridge::send_step2__try_create_transaction(const string &args_stri json_root.get("sec_spendKey_string"), json_root.get("to_address_string"), json_root.get_optional("payment_id_string"), - stoull(json_root.get("sending_amount")), + stoull(json_root.get("final_total_wo_fee")), stoull(json_root.get("change_amount")), stoull(json_root.get("fee_amount")), stoul(json_root.get("priority")), diff --git a/test/test_all.cpp b/test/test_all.cpp index 95ff0a0..4931ceb 100644 --- a/test/test_all.cpp +++ b/test/test_all.cpp @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(bridge__transfers__send__sweepDust) } { boost::property_tree::ptree root; - root.put("sending_amount", *final_total_wo_fee_string); // NOTE: one must use this as the final total - for ex during a sweep we dont know sending_amount until reading this value + root.put("final_total_wo_fee", *final_total_wo_fee_string); root.put("change_amount", *change_amount_string); // from step1 root.put("fee_amount", *using_fee_string); // from step1 root.add_child("using_outs", using_outs); // from step1 @@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(bridge__transfers__send__sweepDust) BOOST_REQUIRE((*fee_actually_needed_string).size() > 0); // // This means we must go back through step1 to re-pick using_outs - BOOST_REQUIRE(construction_attempt_n < 2); // not generally expecting to have to do this more than once + BOOST_REQUIRE(construction_attempt_n < 3); // not generally expecting to have to do this more than once or twice continue; // proceed to next iteration (re-enter tx construction at step1(II) with fee_actually_needed_string from step2(I)) } optional tx_hash = ret_tree.get_optional(ret_json_key__send__tx_hash()); @@ -447,7 +447,7 @@ BOOST_AUTO_TEST_CASE(bridge__transfers__send__amount) } { boost::property_tree::ptree root; - root.put("sending_amount", *final_total_wo_fee_string); // NOTE: one must use this as the final total - for ex during a sweep we dont know sending_amount until reading this value + root.put("final_total_wo_fee", *final_total_wo_fee_string); root.put("change_amount", *change_amount_string); // from step1 root.put("fee_amount", *using_fee_string); // from step1 root.add_child("using_outs", using_outs); // from step1 @@ -483,7 +483,7 @@ BOOST_AUTO_TEST_CASE(bridge__transfers__send__amount) BOOST_REQUIRE((*fee_actually_needed_string).size() > 0); // // This means we must go back through step1 to re-pick using_outs - BOOST_REQUIRE(construction_attempt_n < 2); // not generally expecting to have to do this more than once + BOOST_REQUIRE(construction_attempt_n < 3); // not generally expecting to have to do this more than once or twice continue; // proceed to next iteration (re-enter tx construction at step1(II) with fee_actually_needed_string from step2(I)) } optional tx_hash = ret_tree.get_optional(ret_json_key__send__tx_hash());