aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorjeffro256 <jeffro256@tutanota.com>2023-06-02 01:07:30 -0500
committerjeffro256 <jeffro256@tutanota.com>2023-06-02 22:06:49 -0500
commitaa139f0334f0ecffa6c755c4b124dac9c462edb2 (patch)
tree23746fb41ee6e6a03e3ea55e8a6ae780e3accc4d /src/wallet
parentMerge pull request #8846 (diff)
downloadmonero-aa139f0334f0ecffa6c755c4b124dac9c462edb2.tar.xz
wallet_rpc_server: dedup transfer RPC responses [RELEASE]
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h216
1 files changed, 59 insertions, 157 deletions
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index 60df6296f..74c3862cb 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -530,6 +530,33 @@ namespace wallet_rpc
END_KV_SERIALIZE_MAP()
};
+ struct single_transfer_response
+ {
+ std::string tx_hash;
+ std::string tx_key;
+ uint64_t amount;
+ uint64_t fee;
+ uint64_t weight;
+ std::string tx_blob;
+ std::string tx_metadata;
+ std::string multisig_txset;
+ std::string unsigned_txset;
+ key_image_list spent_key_images;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(tx_hash)
+ KV_SERIALIZE(tx_key)
+ KV_SERIALIZE(amount)
+ KV_SERIALIZE(fee)
+ KV_SERIALIZE(weight)
+ KV_SERIALIZE(tx_blob)
+ KV_SERIALIZE(tx_metadata)
+ KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
+ KV_SERIALIZE(spent_key_images)
+ END_KV_SERIALIZE_MAP()
+ };
+
struct COMMAND_RPC_TRANSFER
{
struct request_t
@@ -562,35 +589,37 @@ namespace wallet_rpc
};
typedef epee::misc_utils::struct_init<request_t> request;
- struct response_t
- {
- std::string tx_hash;
- std::string tx_key;
- uint64_t amount;
- uint64_t fee;
- uint64_t weight;
- std::string tx_blob;
- std::string tx_metadata;
- std::string multisig_txset;
- std::string unsigned_txset;
- key_image_list spent_key_images;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(tx_hash)
- KV_SERIALIZE(tx_key)
- KV_SERIALIZE(amount)
- KV_SERIALIZE(fee)
- KV_SERIALIZE(weight)
- KV_SERIALIZE(tx_blob)
- KV_SERIALIZE(tx_metadata)
- KV_SERIALIZE(multisig_txset)
- KV_SERIALIZE(unsigned_txset)
- KV_SERIALIZE(spent_key_images)
- END_KV_SERIALIZE_MAP()
- };
+ typedef single_transfer_response response_t;
typedef epee::misc_utils::struct_init<response_t> response;
};
+ struct split_transfer_response
+ {
+ std::list<std::string> tx_hash_list;
+ std::list<std::string> tx_key_list;
+ std::list<uint64_t> amount_list;
+ std::list<uint64_t> fee_list;
+ std::list<uint64_t> weight_list;
+ std::list<std::string> tx_blob_list;
+ std::list<std::string> tx_metadata_list;
+ std::string multisig_txset;
+ std::string unsigned_txset;
+ std::list<key_image_list> spent_key_images_list;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(tx_hash_list)
+ KV_SERIALIZE(tx_key_list)
+ KV_SERIALIZE(amount_list)
+ KV_SERIALIZE(fee_list)
+ KV_SERIALIZE(weight_list)
+ KV_SERIALIZE(tx_blob_list)
+ KV_SERIALIZE(tx_metadata_list)
+ KV_SERIALIZE(multisig_txset)
+ KV_SERIALIZE(unsigned_txset)
+ KV_SERIALIZE(spent_key_images_list)
+ END_KV_SERIALIZE_MAP()
+ };
+
struct COMMAND_RPC_TRANSFER_SPLIT
{
struct request_t
@@ -623,41 +652,7 @@ namespace wallet_rpc
};
typedef epee::misc_utils::struct_init<request_t> request;
- struct key_list
- {
- std::list<std::string> keys;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(keys)
- END_KV_SERIALIZE_MAP()
- };
-
- struct response_t
- {
- std::list<std::string> tx_hash_list;
- std::list<std::string> tx_key_list;
- std::list<uint64_t> amount_list;
- std::list<uint64_t> fee_list;
- std::list<uint64_t> weight_list;
- std::list<std::string> tx_blob_list;
- std::list<std::string> tx_metadata_list;
- std::string multisig_txset;
- std::string unsigned_txset;
- std::list<key_image_list> spent_key_images_list;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(tx_hash_list)
- KV_SERIALIZE(tx_key_list)
- KV_SERIALIZE(amount_list)
- KV_SERIALIZE(fee_list)
- KV_SERIALIZE(weight_list)
- KV_SERIALIZE(tx_blob_list)
- KV_SERIALIZE(tx_metadata_list)
- KV_SERIALIZE(multisig_txset)
- KV_SERIALIZE(unsigned_txset)
- KV_SERIALIZE(spent_key_images_list)
- END_KV_SERIALIZE_MAP()
- };
+ typedef split_transfer_response response_t;
typedef epee::misc_utils::struct_init<response_t> response;
};
@@ -821,41 +816,7 @@ namespace wallet_rpc
};
typedef epee::misc_utils::struct_init<request_t> request;
- struct key_list
- {
- std::list<std::string> keys;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(keys)
- END_KV_SERIALIZE_MAP()
- };
-
- struct response_t
- {
- std::list<std::string> tx_hash_list;
- std::list<std::string> tx_key_list;
- std::list<uint64_t> amount_list;
- std::list<uint64_t> fee_list;
- std::list<uint64_t> weight_list;
- std::list<std::string> tx_blob_list;
- std::list<std::string> tx_metadata_list;
- std::string multisig_txset;
- std::string unsigned_txset;
- std::list<key_image_list> spent_key_images_list;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(tx_hash_list)
- KV_SERIALIZE(tx_key_list)
- KV_SERIALIZE(amount_list)
- KV_SERIALIZE(fee_list)
- KV_SERIALIZE(weight_list)
- KV_SERIALIZE(tx_blob_list)
- KV_SERIALIZE(tx_metadata_list)
- KV_SERIALIZE(multisig_txset)
- KV_SERIALIZE(unsigned_txset)
- KV_SERIALIZE(spent_key_images_list)
- END_KV_SERIALIZE_MAP()
- };
+ typedef split_transfer_response response_t;
typedef epee::misc_utils::struct_init<response_t> response;
};
@@ -897,41 +858,7 @@ namespace wallet_rpc
};
typedef epee::misc_utils::struct_init<request_t> request;
- struct key_list
- {
- std::list<std::string> keys;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(keys)
- END_KV_SERIALIZE_MAP()
- };
-
- struct response_t
- {
- std::list<std::string> tx_hash_list;
- std::list<std::string> tx_key_list;
- std::list<uint64_t> amount_list;
- std::list<uint64_t> fee_list;
- std::list<uint64_t> weight_list;
- std::list<std::string> tx_blob_list;
- std::list<std::string> tx_metadata_list;
- std::string multisig_txset;
- std::string unsigned_txset;
- std::list<key_image_list> spent_key_images_list;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(tx_hash_list)
- KV_SERIALIZE(tx_key_list)
- KV_SERIALIZE(amount_list)
- KV_SERIALIZE(fee_list)
- KV_SERIALIZE(weight_list)
- KV_SERIALIZE(tx_blob_list)
- KV_SERIALIZE(tx_metadata_list)
- KV_SERIALIZE(multisig_txset)
- KV_SERIALIZE(unsigned_txset)
- KV_SERIALIZE(spent_key_images_list)
- END_KV_SERIALIZE_MAP()
- };
+ typedef split_transfer_response response_t;
typedef epee::misc_utils::struct_init<response_t> response;
};
@@ -967,32 +894,7 @@ namespace wallet_rpc
};
typedef epee::misc_utils::struct_init<request_t> request;
- struct response_t
- {
- std::string tx_hash;
- std::string tx_key;
- uint64_t amount;
- uint64_t fee;
- uint64_t weight;
- std::string tx_blob;
- std::string tx_metadata;
- std::string multisig_txset;
- std::string unsigned_txset;
- key_image_list spent_key_images;
-
- BEGIN_KV_SERIALIZE_MAP()
- KV_SERIALIZE(tx_hash)
- KV_SERIALIZE(tx_key)
- KV_SERIALIZE(amount)
- KV_SERIALIZE(fee)
- KV_SERIALIZE(weight)
- KV_SERIALIZE(tx_blob)
- KV_SERIALIZE(tx_metadata)
- KV_SERIALIZE(multisig_txset)
- KV_SERIALIZE(unsigned_txset)
- KV_SERIALIZE(spent_key_images)
- END_KV_SERIALIZE_MAP()
- };
+ typedef single_transfer_response response_t;
typedef epee::misc_utils::struct_init<response_t> response;
};