From 554527118ea870267391ae508ccabf3d76a20119 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 15 Apr 2020 21:22:09 -0400 Subject: [PATCH] rename send_split() to send_txs() --- src/wallet/monero_wallet.h | 20 ++++++++++---------- src/wallet/monero_wallet_core.cpp | 26 +++++++++++++------------- src/wallet/monero_wallet_core.h | 8 ++++---- src/wallet/monero_wallet_model.h | 2 +- test/sample_code.cpp | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index e0f8cef..0a7c033 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -945,8 +945,8 @@ namespace monero { * @param request configures the transaction * @return a tx set with the requested transaction if possible */ - virtual monero_tx_set send(const monero_send_request& request) { - throw runtime_error("send() not supported"); + virtual monero_tx_set send_tx(const monero_send_request& request) { + throw runtime_error("send_tx() not supported"); } /** @@ -958,8 +958,8 @@ namespace monero { * @param amount is the amount being sent * @return a tx set with the requested transaction if possible */ - virtual monero_tx_set send(uint32_t account_index, string address, uint64_t amount) { - throw runtime_error("send() not supported"); + virtual monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount) { + throw runtime_error("send_tx() not supported"); } /** @@ -972,8 +972,8 @@ namespace monero { * @param priority is the send priority (default normal) * @return a tx set with the requested transaction if possible */ - virtual monero_tx_set send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) { - throw runtime_error("send() not supported"); + virtual monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) { + throw runtime_error("send_tx() not supported"); } /** @@ -983,8 +983,8 @@ namespace monero { * @param request configures the transaction * @return a tx set with the requested transactions if possible */ - virtual monero_tx_set send_split(const monero_send_request& request) { - throw runtime_error("send_split() not supported"); + virtual monero_tx_set send_txs(const monero_send_request& request) { + throw runtime_error("send_txs() not supported"); } // /** @@ -996,7 +996,7 @@ namespace monero { // * @param sendAmount is the amount being sent // * @return the resulting transactions // */ - // public List send_split(int account_index, string address, BigInteger sendAmount); + // public List send_txs(int account_index, string address, BigInteger sendAmount); // // /** // * Create and relay one or more transactions which transfer funds from this @@ -1008,7 +1008,7 @@ namespace monero { // * @param priority is the send priority (default normal) // * @return the resulting transactions // */ - // public List send_split(int account_index, string address, BigInteger sendAmount, monero_send_priority priority); + // public List send_txs(int account_index, string address, BigInteger sendAmount, monero_send_priority priority); /** * Sweep unlocked funds according to the given request. diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index 35e1e5c..3856244 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -1776,7 +1776,7 @@ namespace monero { request.m_do_not_relay = true; // invoke common method which doesn't relay - monero_tx_set tx_set = send_split(request); + monero_tx_set tx_set = send_txs(request); // restore doNotRelay of request and txs request.m_do_not_relay = requested_do_not_relay; @@ -1840,27 +1840,27 @@ namespace monero { return relay_txs(tx_hexes); } - monero_tx_set monero_wallet_core::send(const monero_send_request& request) { - if (request.m_can_split != boost::none && request.m_can_split.get()) throw runtime_error("Cannot request split transactions with send() which prevents splitting; use sendSplit() instead"); + monero_tx_set monero_wallet_core::send_tx(const monero_send_request& request) { + if (request.m_can_split != boost::none && request.m_can_split.get()) throw runtime_error("Cannot request split transactions with send_tx() which prevents splitting; use sendSplit() instead"); monero_send_request copy = request.copy(); copy.m_can_split = false; - return send_split(copy); + return send_txs(copy); } - monero_tx_set monero_wallet_core::send(uint32_t account_index, string address, uint64_t amount) { - return send(account_index, address, amount, monero_send_priority::NORMAL); + monero_tx_set monero_wallet_core::send_tx(uint32_t account_index, string address, uint64_t amount) { + return send_tx(account_index, address, amount, monero_send_priority::NORMAL); } - monero_tx_set monero_wallet_core::send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) { + monero_tx_set monero_wallet_core::send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority) { monero_send_request req; req.m_account_index = account_index; req.m_destinations.push_back(make_shared(address, amount)); req.m_priority = priority; - return send(req); + return send_tx(req); } - monero_tx_set monero_wallet_core::send_split(const monero_send_request& request) { - MTRACE("monero_wallet_core::send_split(request)"); + monero_tx_set monero_wallet_core::send_txs(const monero_send_request& request) { + MTRACE("monero_wallet_core::send_txs(request)"); MTRACE("monero_send_request: " << request.serialize()); // validate request @@ -1898,7 +1898,7 @@ namespace monero { // check if request cannot be fulfilled due to splitting if (request.m_can_split != boost::none && request.m_can_split.get() == false && ptx_vector.size() != 1) { - throw runtime_error("Transaction would be too large. Try send_split()"); + throw runtime_error("Transaction would be too large. Try send_txs()"); } // config for fill_response() @@ -2214,7 +2214,7 @@ namespace monero { throw runtime_error("need to handle error filling response!"); // TODO: return err message } - // build sent txs from results // TODO: use common utility with send_split() to avoid code duplication + // build sent txs from results // TODO: use common utility with send_txs() to avoid code duplication vector> txs; auto tx_hashes_iter = tx_hashes.begin(); auto tx_keys_iter = tx_keys.begin(); @@ -2301,7 +2301,7 @@ namespace monero { throw runtime_error("need to handle error filling response!"); // TODO: return err message } - // build sent txs from results // TODO: use common utility with send_split() to avoid code duplication + // build sent txs from results // TODO: use common utility with send_txs() to avoid code duplication vector> txs; auto tx_hashes_iter = tx_hashes.begin(); auto tx_keys_iter = tx_keys.begin(); diff --git a/src/wallet/monero_wallet_core.h b/src/wallet/monero_wallet_core.h index bb03810..c8b97d0 100644 --- a/src/wallet/monero_wallet_core.h +++ b/src/wallet/monero_wallet_core.h @@ -237,10 +237,10 @@ namespace monero { string relay_tx(const monero_tx_wallet& tx); vector relay_txs(const vector& tx_metadatas); vector relay_txs(const vector>& txs); - monero_tx_set send(const monero_send_request& request); - monero_tx_set send(uint32_t account_index, string address, uint64_t amount); - monero_tx_set send(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority); - monero_tx_set send_split(const monero_send_request& request); + monero_tx_set send_tx(const monero_send_request& request); + monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount); + monero_tx_set send_tx(uint32_t account_index, string address, uint64_t amount, monero_send_priority priority); + monero_tx_set send_txs(const monero_send_request& request); vector sweep_unlocked(const monero_send_request& request); monero_tx_set sweep_output(const monero_send_request& request); monero_tx_set sweep_dust(bool do_not_relay = false); diff --git a/src/wallet/monero_wallet_model.h b/src/wallet/monero_wallet_model.h index 980a682..2132f6e 100644 --- a/src/wallet/monero_wallet_model.h +++ b/src/wallet/monero_wallet_model.h @@ -297,7 +297,7 @@ namespace monero { * Groups transactions who share common hex data which is needed in order to * sign and submit the transactions. * - * For example, multisig transactions created from send_split() share a common + * For example, multisig transactions created from send_txs() share a common * hex string which is needed in order to sign and submit the multisig * transactions. */ diff --git a/test/sample_code.cpp b/test/sample_code.cpp index bb34419..f685380 100644 --- a/test/sample_code.cpp +++ b/test/sample_code.cpp @@ -100,7 +100,7 @@ int main(int argc, const char* argv[]) { wallet_random->add_listener(my_listener); // send funds from the restored wallet to the random wallet - shared_ptr sent_tx = wallet_restored->send(0, wallet_random->get_address(1, 0), 50000).m_txs[0]; + shared_ptr sent_tx = wallet_restored->send_tx(0, wallet_random->get_address(1, 0), 50000).m_txs[0]; bool in_pool = sent_tx->m_in_tx_pool.get(); // true // mine with 7 threads to push the network along