diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-18 01:05:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-04 22:38:03 +0000 |
commit | e396146aeebd61d6a26003045d554f6e94d5f028 (patch) | |
tree | d0abbc7b2feb1325435c149c9f9309063e9fc670 /src | |
parent | various: remove unused variables (diff) | |
download | monero-e396146aeebd61d6a26003045d554f6e94d5f028.tar.xz |
default initialize rpc structures
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_basic/cryptonote_stat_info.h | 3 | ||||
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_defs.h | 24 | ||||
-rw-r--r-- | src/p2p/net_node.h | 5 | ||||
-rw-r--r-- | src/p2p/p2p_protocol_defs.h | 44 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 399 | ||||
-rw-r--r-- | src/wallet/message_transporter.cpp | 6 | ||||
-rw-r--r-- | src/wallet/message_transporter.h | 3 | ||||
-rw-r--r-- | src/wallet/wallet_rpc_server_commands_defs.h | 460 |
8 files changed, 623 insertions, 321 deletions
diff --git a/src/cryptonote_basic/cryptonote_stat_info.h b/src/cryptonote_basic/cryptonote_stat_info.h index c0be2144e..a09fa850b 100644 --- a/src/cryptonote_basic/cryptonote_stat_info.h +++ b/src/cryptonote_basic/cryptonote_stat_info.h @@ -34,7 +34,7 @@ namespace cryptonote { - struct core_stat_info + struct core_stat_info_t { uint64_t tx_pool_size; uint64_t blockchain_height; @@ -50,4 +50,5 @@ namespace cryptonote KV_SERIALIZE(top_block_id_str) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<core_stat_info_t> core_stat_info; } diff --git a/src/cryptonote_protocol/cryptonote_protocol_defs.h b/src/cryptonote_protocol/cryptonote_protocol_defs.h index 2d5d10d67..23846dbf8 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_defs.h +++ b/src/cryptonote_protocol/cryptonote_protocol_defs.h @@ -128,7 +128,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 1; - struct request + struct request_t { block_complete_entry b; uint64_t current_blockchain_height; @@ -138,6 +138,7 @@ namespace cryptonote KV_SERIALIZE(current_blockchain_height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; /************************************************************************/ @@ -147,7 +148,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 2; - struct request + struct request_t { std::vector<blobdata> txs; std::string _; // padding @@ -157,6 +158,7 @@ namespace cryptonote KV_SERIALIZE(_) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; /************************************************************************/ /* */ @@ -165,7 +167,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 3; - struct request + struct request_t { std::vector<crypto::hash> txs; std::vector<crypto::hash> blocks; @@ -175,13 +177,14 @@ namespace cryptonote KV_SERIALIZE_CONTAINER_POD_AS_BLOB(blocks) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; struct NOTIFY_RESPONSE_GET_OBJECTS { const static int ID = BC_COMMANDS_POOL_BASE + 4; - struct request + struct request_t { std::vector<blobdata> txs; std::vector<block_complete_entry> blocks; @@ -195,6 +198,7 @@ namespace cryptonote KV_SERIALIZE(current_blockchain_height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; @@ -219,7 +223,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 6; - struct request + struct request_t { std::list<crypto::hash> block_ids; /*IDs of the first 10 blocks are sequential, next goes with pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */ @@ -227,13 +231,14 @@ namespace cryptonote KV_SERIALIZE_CONTAINER_POD_AS_BLOB(block_ids) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; struct NOTIFY_RESPONSE_CHAIN_ENTRY { const static int ID = BC_COMMANDS_POOL_BASE + 7; - struct request + struct request_t { uint64_t start_height; uint64_t total_height; @@ -247,6 +252,7 @@ namespace cryptonote KV_SERIALIZE_CONTAINER_POD_AS_BLOB(m_block_ids) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; /************************************************************************/ @@ -256,7 +262,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 8; - struct request + struct request_t { block_complete_entry b; uint64_t current_blockchain_height; @@ -266,6 +272,7 @@ namespace cryptonote KV_SERIALIZE(current_blockchain_height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; /************************************************************************/ @@ -275,7 +282,7 @@ namespace cryptonote { const static int ID = BC_COMMANDS_POOL_BASE + 9; - struct request + struct request_t { crypto::hash block_hash; uint64_t current_blockchain_height; @@ -287,6 +294,7 @@ namespace cryptonote KV_SERIALIZE_CONTAINER_POD_AS_BLOB(missing_tx_indices) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; }; } diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 58e3c8857..4c5f788c3 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -131,9 +131,9 @@ namespace nodetool struct network_zone; using connect_func = boost::optional<p2p_connection_context>(network_zone&, epee::net_utils::network_address const&, epee::net_utils::ssl_support_t); - struct config + struct config_t { - config() + config_t() : m_net_config(), m_peer_id(crypto::rand<uint64_t>()), m_support_flags(0) @@ -143,6 +143,7 @@ namespace nodetool uint64_t m_peer_id; uint32_t m_support_flags; }; + typedef epee::misc_utils::struct_init<config_t> config; struct network_zone { diff --git a/src/p2p/p2p_protocol_defs.h b/src/p2p/p2p_protocol_defs.h index e9449b950..bb4fb9da2 100644 --- a/src/p2p/p2p_protocol_defs.h +++ b/src/p2p/p2p_protocol_defs.h @@ -179,7 +179,7 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 1; - struct request + struct request_t { basic_node_data node_data; t_playload_type payload_data; @@ -189,8 +189,9 @@ namespace nodetool KV_SERIALIZE(payload_data) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { basic_node_data node_data; t_playload_type payload_data; @@ -230,7 +231,8 @@ namespace nodetool } END_KV_SERIALIZE_MAP() }; - }; + typedef epee::misc_utils::struct_init<response_t> response; + }; /************************************************************************/ @@ -241,15 +243,16 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 2; - struct request + struct request_t { t_playload_type payload_data; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(payload_data) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t local_time; t_playload_type payload_data; @@ -289,6 +292,7 @@ namespace nodetool } END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; /************************************************************************/ @@ -306,15 +310,16 @@ namespace nodetool #define PING_OK_RESPONSE_STATUS_TEXT "OK" - struct request + struct request_t { /*actually we don't need to send any real data*/ BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; peerid_type peer_id; @@ -324,6 +329,7 @@ namespace nodetool KV_SERIALIZE(peer_id) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; @@ -350,15 +356,16 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 4; - struct request + struct request_t { proof_of_trust tr; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(tr) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string version; std::string os_version; @@ -374,6 +381,7 @@ namespace nodetool KV_SERIALIZE(payload_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; @@ -384,15 +392,16 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 5; - struct request + struct request_t { proof_of_trust tr; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(tr) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<peerlist_entry> local_peerlist_white; std::vector<peerlist_entry> local_peerlist_gray; @@ -407,6 +416,7 @@ namespace nodetool KV_SERIALIZE(local_time) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; /************************************************************************/ @@ -416,13 +426,14 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 6; - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { peerid_type my_id; @@ -430,6 +441,7 @@ namespace nodetool KV_SERIALIZE(my_id) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; /************************************************************************/ @@ -439,13 +451,14 @@ namespace nodetool { const static int ID = P2P_COMMANDS_POOL_BASE + 7; - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint32_t support_flags; @@ -453,6 +466,7 @@ namespace nodetool KV_SERIALIZE(support_flags) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; #endif diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index e52e4fc67..88fa9b4e7 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -90,13 +90,14 @@ namespace cryptonote struct COMMAND_RPC_GET_HEIGHT { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t height; std::string status; @@ -108,12 +109,13 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCKS_FAST { - struct request + struct request_t { std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */ uint64_t start_height; @@ -126,6 +128,7 @@ namespace cryptonote KV_SERIALIZE_OPT(no_miner_tx, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct tx_output_indices { @@ -145,7 +148,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::vector<block_complete_entry> blocks; uint64_t start_height; @@ -163,19 +166,21 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCKS_BY_HEIGHT { - struct request + struct request_t { std::vector<uint64_t> heights; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(heights) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<block_complete_entry> blocks; std::string status; @@ -187,17 +192,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ALT_BLOCKS_HASHES { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<std::string> blks_hashes; std::string status; @@ -209,11 +216,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_HASHES_FAST { - struct request + struct request_t { std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */ uint64_t start_height; @@ -222,8 +230,9 @@ namespace cryptonote KV_SERIALIZE(start_height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<crypto::hash> m_block_ids; uint64_t start_height; @@ -239,12 +248,13 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_ADDRESS_TXS { - struct request + struct request_t { std::string address; std::string view_key; @@ -254,6 +264,7 @@ namespace cryptonote KV_SERIALIZE(view_key) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct spent_output { uint64_t amount; @@ -304,7 +315,7 @@ namespace cryptonote }; - struct response + struct response_t { //std::list<std::string> txs_as_json; uint64_t total_received; @@ -324,12 +335,13 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_ADDRESS_INFO { - struct request + struct request_t { std::string address; std::string view_key; @@ -339,6 +351,7 @@ namespace cryptonote KV_SERIALIZE(view_key) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct spent_output { @@ -356,10 +369,8 @@ namespace cryptonote KV_SERIALIZE(mixin) END_KV_SERIALIZE_MAP() }; - - - - struct response + + struct response_t { uint64_t locked_funds; uint64_t total_received; @@ -382,12 +393,13 @@ namespace cryptonote KV_SERIALIZE(spent_outputs) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_UNSPENT_OUTS { - struct request + struct request_t { std::string amount; std::string address; @@ -406,6 +418,7 @@ namespace cryptonote KV_SERIALIZE(dust_threshold) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct output { @@ -437,7 +450,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { uint64_t amount; std::list<output> outputs; @@ -452,12 +465,13 @@ namespace cryptonote KV_SERIALIZE(reason) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_RANDOM_OUTS { - struct request + struct request_t { std::vector<std::string> amounts; uint32_t count; @@ -467,6 +481,7 @@ namespace cryptonote KV_SERIALIZE(count) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct output { @@ -491,7 +506,7 @@ namespace cryptonote }; - struct response + struct response_t { std::vector<amount_out> amount_outs; std::string Error; @@ -500,11 +515,12 @@ namespace cryptonote KV_SERIALIZE(Error) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_SUBMIT_RAW_TX { - struct request + struct request_t { std::string address; std::string view_key; @@ -516,9 +532,10 @@ namespace cryptonote KV_SERIALIZE(tx) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::string error; @@ -528,11 +545,12 @@ namespace cryptonote KV_SERIALIZE(error) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_LOGIN { - struct request + struct request_t { std::string address; std::string view_key; @@ -544,9 +562,9 @@ namespace cryptonote KV_SERIALIZE(create_account) END_KV_SERIALIZE_MAP() }; - - - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { std::string status; std::string reason; @@ -558,11 +576,12 @@ namespace cryptonote KV_SERIALIZE(new_address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_IMPORT_WALLET_REQUEST { - struct request + struct request_t { std::string address; std::string view_key; @@ -572,9 +591,9 @@ namespace cryptonote KV_SERIALIZE(view_key) END_KV_SERIALIZE_MAP() }; - - - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { std::string payment_id; uint64_t import_fee; @@ -592,11 +611,12 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_TRANSACTIONS { - struct request + struct request_t { std::vector<std::string> txs_hashes; bool decode_as_json; @@ -610,6 +630,7 @@ namespace cryptonote KV_SERIALIZE_OPT(split, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct entry { @@ -640,7 +661,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { // older compatibility stuff std::vector<std::string> txs_as_hex; //transactions blobs as hex (old compat) @@ -663,6 +684,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- @@ -674,7 +696,7 @@ namespace cryptonote SPENT_IN_POOL = 2, }; - struct request + struct request_t { std::vector<std::string> key_images; @@ -682,9 +704,10 @@ namespace cryptonote KV_SERIALIZE(key_images) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<int> spent_status; std::string status; @@ -696,21 +719,23 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES { - struct request + struct request_t { crypto::hash txid; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE_VAL_POD_AS_BLOB(txid) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::vector<uint64_t> o_indexes; std::string status; @@ -721,6 +746,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct get_outputs_out @@ -736,7 +762,7 @@ namespace cryptonote struct COMMAND_RPC_GET_OUTPUTS_BIN { - struct request + struct request_t { std::vector<get_outputs_out> outputs; bool get_txid; @@ -746,6 +772,7 @@ namespace cryptonote KV_SERIALIZE_OPT(get_txid, true) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct outkey { @@ -764,7 +791,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::vector<outkey> outs; std::string status; @@ -776,11 +803,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_OUTPUTS { - struct request + struct request_t { std::vector<get_outputs_out> outputs; @@ -788,6 +816,7 @@ namespace cryptonote KV_SERIALIZE(outputs) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct outkey { @@ -806,7 +835,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::vector<outkey> outs; std::string status; @@ -818,11 +847,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_SEND_RAW_TX { - struct request + struct request_t { std::string tx_as_hex; bool do_not_relay; @@ -832,9 +862,10 @@ namespace cryptonote KV_SERIALIZE_OPT(do_not_relay, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::string reason; @@ -864,11 +895,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_START_MINING { - struct request + struct request_t { std::string miner_address; uint64_t threads_count; @@ -882,8 +914,9 @@ namespace cryptonote KV_SERIALIZE(ignore_battery) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -891,18 +924,20 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_GET_INFO { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint64_t height; @@ -974,21 +1009,23 @@ namespace cryptonote KV_SERIALIZE(version) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_STOP_MINING { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -996,20 +1033,22 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_MINING_STATUS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; bool active; @@ -1027,20 +1066,22 @@ namespace cryptonote KV_SERIALIZE(is_background_mining_enabled) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //----------------------------------------------- struct COMMAND_RPC_SAVE_BC { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1048,6 +1089,7 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; // @@ -1055,7 +1097,7 @@ namespace cryptonote { typedef std::list<std::string> request; - struct response + struct response_t { uint64_t count; std::string status; @@ -1065,7 +1107,7 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; - + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GETBLOCKHASH @@ -1078,7 +1120,7 @@ namespace cryptonote struct COMMAND_RPC_GETBLOCKTEMPLATE { - struct request + struct request_t { uint64_t reserve_size; //max 255 bytes std::string wallet_address; @@ -1088,8 +1130,9 @@ namespace cryptonote KV_SERIALIZE(wallet_address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t difficulty; uint64_t height; @@ -1113,13 +1156,14 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SUBMITBLOCK { typedef std::vector<std::string> request; - struct response + struct response_t { std::string status; @@ -1127,11 +1171,12 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GENERATEBLOCKS { - struct request + struct request_t { uint64_t amount_of_blocks; std::string wallet_address; @@ -1141,8 +1186,9 @@ namespace cryptonote KV_SERIALIZE(wallet_address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t height; std::string status; @@ -1152,6 +1198,7 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct block_header_response @@ -1197,7 +1244,7 @@ namespace cryptonote struct COMMAND_RPC_GET_LAST_BLOCK_HEADER { - struct request + struct request_t { bool fill_pow_hash; @@ -1205,8 +1252,9 @@ namespace cryptonote KV_SERIALIZE_OPT(fill_pow_hash, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; block_header_response block_header; @@ -1218,12 +1266,13 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HASH { - struct request + struct request_t { std::string hash; bool fill_pow_hash; @@ -1233,8 +1282,9 @@ namespace cryptonote KV_SERIALIZE_OPT(fill_pow_hash, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; block_header_response block_header; @@ -1246,12 +1296,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; - + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HEIGHT { - struct request + struct request_t { uint64_t height; bool fill_pow_hash; @@ -1261,8 +1311,9 @@ namespace cryptonote KV_SERIALIZE_OPT(fill_pow_hash, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; block_header_response block_header; @@ -1274,12 +1325,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; - + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCK { - struct request + struct request_t { std::string hash; uint64_t height; @@ -1291,8 +1342,9 @@ namespace cryptonote KV_SERIALIZE_OPT(fill_pow_hash, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; block_header_response block_header; @@ -1312,7 +1364,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; - + typedef epee::misc_utils::struct_init<response_t> response; }; struct peer { @@ -1344,13 +1396,14 @@ namespace cryptonote struct COMMAND_RPC_GET_PEER_LIST { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<peer> white_list; @@ -1362,11 +1415,12 @@ namespace cryptonote KV_SERIALIZE(gray_list) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_LOG_HASH_RATE { - struct request + struct request_t { bool visible; @@ -1374,19 +1428,21 @@ namespace cryptonote KV_SERIALIZE(visible) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_LOG_LEVEL { - struct request + struct request_t { int8_t level; @@ -1394,19 +1450,21 @@ namespace cryptonote KV_SERIALIZE(level) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_LOG_CATEGORIES { - struct request + struct request_t { std::string categories; @@ -1414,8 +1472,9 @@ namespace cryptonote KV_SERIALIZE(categories) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::string categories; @@ -1425,6 +1484,7 @@ namespace cryptonote KV_SERIALIZE(categories) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct tx_info @@ -1479,13 +1539,14 @@ namespace cryptonote struct COMMAND_RPC_GET_TRANSACTION_POOL { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<tx_info> transactions; @@ -1499,17 +1560,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TRANSACTION_POOL_HASHES_BIN { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<crypto::hash> tx_hashes; @@ -1521,17 +1584,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TRANSACTION_POOL_HASHES { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<std::string> tx_hashes; @@ -1543,6 +1608,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct tx_backlog_entry @@ -1554,13 +1620,14 @@ namespace cryptonote struct COMMAND_RPC_GET_TRANSACTION_POOL_BACKLOG { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<tx_backlog_entry> backlog; @@ -1572,6 +1639,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct txpool_histo @@ -1622,13 +1690,14 @@ namespace cryptonote struct COMMAND_RPC_GET_TRANSACTION_POOL_STATS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; txpool_stats pool_stats; @@ -1640,17 +1709,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_CONNECTIONS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::list<connection_info> connections; @@ -1660,12 +1731,12 @@ namespace cryptonote KV_SERIALIZE(connections) END_KV_SERIALIZE_MAP() }; - + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BLOCK_HEADERS_RANGE { - struct request + struct request_t { uint64_t start_height; uint64_t end_height; @@ -1677,8 +1748,9 @@ namespace cryptonote KV_SERIALIZE_OPT(fill_pow_hash, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<block_header_response> headers; @@ -1690,17 +1762,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_STOP_DAEMON { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1708,17 +1782,19 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_FAST_EXIT { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1726,17 +1802,19 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_LIMIT { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint64_t limit_up; @@ -1750,11 +1828,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_LIMIT { - struct request + struct request_t { int64_t limit_down; // all limits (for get and set) are kB/s int64_t limit_up; @@ -1764,8 +1843,9 @@ namespace cryptonote KV_SERIALIZE(limit_up) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; int64_t limit_up; @@ -1777,19 +1857,21 @@ namespace cryptonote KV_SERIALIZE(limit_down) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_OUT_PEERS { - struct request + struct request_t { uint64_t out_peers; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(out_peers) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1797,19 +1879,21 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_IN_PEERS { - struct request + struct request_t { uint64_t in_peers; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(in_peers) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1817,17 +1901,19 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_START_SAVE_GRAPH { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1835,17 +1921,19 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_STOP_SAVE_GRAPH { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1853,11 +1941,12 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_HARD_FORK_INFO { - struct request + struct request_t { uint8_t version; @@ -1865,8 +1954,9 @@ namespace cryptonote KV_SERIALIZE(version) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint8_t version; bool enabled; @@ -1892,6 +1982,7 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GETBANS @@ -1909,13 +2000,14 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; std::vector<ban> bans; @@ -1925,6 +2017,7 @@ namespace cryptonote KV_SERIALIZE(bans) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SETBANS @@ -1944,7 +2037,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct request + struct request_t { std::vector<ban> bans; @@ -1952,8 +2045,9 @@ namespace cryptonote KV_SERIALIZE(bans) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1961,11 +2055,12 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_FLUSH_TRANSACTION_POOL { - struct request + struct request_t { std::vector<std::string> txids; @@ -1973,8 +2068,9 @@ namespace cryptonote KV_SERIALIZE(txids) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -1982,11 +2078,12 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_OUTPUT_HISTOGRAM { - struct request + struct request_t { std::vector<uint64_t> amounts; uint64_t min_count; @@ -2002,6 +2099,7 @@ namespace cryptonote KV_SERIALIZE(recent_cutoff); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct entry { @@ -2022,7 +2120,7 @@ namespace cryptonote entry() {} }; - struct response + struct response_t { std::string status; std::vector<entry> histogram; @@ -2034,17 +2132,19 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_VERSION { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint32_t version; @@ -2056,11 +2156,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_COINBASE_TX_SUM { - struct request + struct request_t { uint64_t height; uint64_t count; @@ -2070,8 +2171,9 @@ namespace cryptonote KV_SERIALIZE(count); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint64_t emission_amount; @@ -2083,11 +2185,12 @@ namespace cryptonote KV_SERIALIZE(fee_amount) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BASE_FEE_ESTIMATE { - struct request + struct request_t { uint64_t grace_blocks; @@ -2095,8 +2198,9 @@ namespace cryptonote KV_SERIALIZE(grace_blocks) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint64_t fee; @@ -2110,15 +2214,17 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ALTERNATE_CHAINS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct chain_info { @@ -2139,7 +2245,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::string status; std::list<chain_info> chains; @@ -2149,11 +2255,12 @@ namespace cryptonote KV_SERIALIZE(chains) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_UPDATE { - struct request + struct request_t { std::string command; std::string path; @@ -2163,8 +2270,9 @@ namespace cryptonote KV_SERIALIZE(path); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; bool update; @@ -2184,11 +2292,12 @@ namespace cryptonote KV_SERIALIZE(path) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_RELAY_TX { - struct request + struct request_t { std::vector<std::string> txids; @@ -2196,8 +2305,9 @@ namespace cryptonote KV_SERIALIZE(txids) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; @@ -2205,15 +2315,17 @@ namespace cryptonote KV_SERIALIZE(status) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SYNC_INFO { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct peer { @@ -2245,7 +2357,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::string status; uint64_t height; @@ -2265,11 +2377,12 @@ namespace cryptonote KV_SERIALIZE(overview) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_OUTPUT_DISTRIBUTION { - struct request + struct request_t { std::vector<uint64_t> amounts; uint64_t from_height; @@ -2287,6 +2400,7 @@ namespace cryptonote KV_SERIALIZE_OPT(compress, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct distribution { @@ -2330,7 +2444,7 @@ namespace cryptonote END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::string status; std::vector<distribution> distributions; @@ -2342,11 +2456,12 @@ namespace cryptonote KV_SERIALIZE(untrusted) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_POP_BLOCKS { - struct request + struct request_t { uint64_t nblocks; @@ -2354,8 +2469,9 @@ namespace cryptonote KV_SERIALIZE(nblocks); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string status; uint64_t height; @@ -2365,11 +2481,12 @@ namespace cryptonote KV_SERIALIZE(height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_PRUNE_BLOCKCHAIN { - struct request + struct request_t { bool check; @@ -2377,8 +2494,9 @@ namespace cryptonote KV_SERIALIZE_OPT(check, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint32_t pruning_seed; std::string status; @@ -2388,6 +2506,7 @@ namespace cryptonote KV_SERIALIZE(pruning_seed) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; } diff --git a/src/wallet/message_transporter.cpp b/src/wallet/message_transporter.cpp index eafd13d3b..19bfa074d 100644 --- a/src/wallet/message_transporter.cpp +++ b/src/wallet/message_transporter.cpp @@ -44,7 +44,7 @@ namespace mms namespace bitmessage_rpc { - struct message_info + struct message_info_t { uint32_t encodingType; std::string toAddress; @@ -66,8 +66,9 @@ namespace bitmessage_rpc KV_SERIALIZE(subject) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<message_info_t> message_info; - struct inbox_messages_response + struct inbox_messages_response_t { std::vector<message_info> inboxMessages; @@ -75,6 +76,7 @@ namespace bitmessage_rpc KV_SERIALIZE(inboxMessages) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<inbox_messages_response_t> inbox_messages_response; } diff --git a/src/wallet/message_transporter.h b/src/wallet/message_transporter.h index 8291311ce..736fc9b63 100644 --- a/src/wallet/message_transporter.h +++ b/src/wallet/message_transporter.h @@ -42,7 +42,7 @@ namespace mms { -struct transport_message +struct transport_message_t { cryptonote::account_public_address source_monero_address; std::string source_transport_address; @@ -78,6 +78,7 @@ struct transport_message KV_SERIALIZE(transport_id) END_KV_SERIALIZE_MAP() }; +typedef epee::misc_utils::struct_init<transport_message_t> transport_message; class message_transporter { diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index c450b2b37..546e572bc 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -59,7 +59,7 @@ namespace wallet_rpc struct COMMAND_RPC_GET_BALANCE { - struct request + struct request_t { uint32_t account_index; std::set<uint32_t> address_indices; @@ -70,6 +70,7 @@ namespace wallet_rpc KV_SERIALIZE_OPT(all_accounts, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct per_subaddress_info { @@ -92,7 +93,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { uint64_t balance; uint64_t unlocked_balance; @@ -106,11 +107,12 @@ namespace wallet_rpc KV_SERIALIZE(per_subaddress) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ADDRESS { - struct request + struct request_t { uint32_t account_index; std::vector<uint32_t> address_index; @@ -119,6 +121,7 @@ namespace wallet_rpc KV_SERIALIZE(address_index) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct address_info { @@ -135,7 +138,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::string address; // to remain compatible with older RPC format std::vector<address_info> addresses; @@ -145,30 +148,33 @@ namespace wallet_rpc KV_SERIALIZE(addresses) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ADDRESS_INDEX { - struct request + struct request_t { std::string address; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { cryptonote::subaddress_index index; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(index) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CREATE_ADDRESS { - struct request + struct request_t { uint32_t account_index; std::string label; @@ -178,8 +184,9 @@ namespace wallet_rpc KV_SERIALIZE(label) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string address; uint32_t address_index; @@ -189,11 +196,12 @@ namespace wallet_rpc KV_SERIALIZE(address_index) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_LABEL_ADDRESS { - struct request + struct request_t { cryptonote::subaddress_index index; std::string label; @@ -203,17 +211,19 @@ namespace wallet_rpc KV_SERIALIZE(label) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ACCOUNTS { - struct request + struct request_t { std::string tag; // all accounts if empty, otherwise those accounts with this tag @@ -221,6 +231,7 @@ namespace wallet_rpc KV_SERIALIZE(tag) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct subaddress_account_info { @@ -241,7 +252,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { uint64_t total_balance; uint64_t total_unlocked_balance; @@ -253,19 +264,21 @@ namespace wallet_rpc KV_SERIALIZE(subaddress_accounts) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CREATE_ACCOUNT { - struct request + struct request_t { std::string label; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(label) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint32_t account_index; std::string address; // the 0-th address for convenience @@ -274,11 +287,12 @@ namespace wallet_rpc KV_SERIALIZE(address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_LABEL_ACCOUNT { - struct request + struct request_t { uint32_t account_index; std::string label; @@ -288,21 +302,24 @@ namespace wallet_rpc KV_SERIALIZE(label) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ACCOUNT_TAGS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct account_tag_info { @@ -317,7 +334,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::vector<account_tag_info> account_tags; @@ -325,11 +342,12 @@ namespace wallet_rpc KV_SERIALIZE(account_tags) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_TAG_ACCOUNTS { - struct request + struct request_t { std::string tag; std::set<uint32_t> accounts; @@ -339,17 +357,19 @@ namespace wallet_rpc KV_SERIALIZE(accounts) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_UNTAG_ACCOUNTS { - struct request + struct request_t { std::set<uint32_t> accounts; @@ -357,17 +377,19 @@ namespace wallet_rpc KV_SERIALIZE(accounts) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_ACCOUNT_TAG_DESCRIPTION { - struct request + struct request_t { std::string tag; std::string description; @@ -377,29 +399,33 @@ namespace wallet_rpc KV_SERIALIZE(description) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_HEIGHT { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t height; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct transfer_destination @@ -414,7 +440,7 @@ namespace wallet_rpc struct COMMAND_RPC_TRANSFER { - struct request + struct request_t { std::list<transfer_destination> destinations; uint32_t account_index; @@ -444,8 +470,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_metadata, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string tx_hash; std::string tx_key; @@ -467,11 +494,12 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_TRANSFER_SPLIT { - struct request + struct request_t { std::list<transfer_destination> destinations; uint32_t account_index; @@ -501,6 +529,7 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_metadata, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct key_list { @@ -511,7 +540,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::list<std::string> tx_hash_list; std::list<std::string> tx_key_list; @@ -533,6 +562,7 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_DESCRIBE_TRANSFER @@ -577,7 +607,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct request + struct request_t { std::string unsigned_txset; @@ -585,8 +615,9 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<transfer_description> desc; @@ -594,11 +625,12 @@ namespace wallet_rpc KV_SERIALIZE(desc) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SIGN_TRANSFER { - struct request + struct request_t { std::string unsigned_txset; bool export_raw; @@ -610,8 +642,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_keys, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string signed_txset; std::list<std::string> tx_hash_list; @@ -625,11 +658,12 @@ namespace wallet_rpc KV_SERIALIZE(tx_key_list) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SUBMIT_TRANSFER { - struct request + struct request_t { std::string tx_data_hex; @@ -637,8 +671,9 @@ namespace wallet_rpc KV_SERIALIZE(tx_data_hex) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<std::string> tx_hash_list; @@ -646,11 +681,12 @@ namespace wallet_rpc KV_SERIALIZE(tx_hash_list) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SWEEP_DUST { - struct request + struct request_t { bool get_tx_keys; bool do_not_relay; @@ -664,6 +700,7 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_metadata, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct key_list { @@ -674,7 +711,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::list<std::string> tx_hash_list; std::list<std::string> tx_key_list; @@ -696,11 +733,12 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SWEEP_ALL { - struct request + struct request_t { std::string address; uint32_t account_index; @@ -734,6 +772,7 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_metadata, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct key_list { @@ -744,7 +783,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::list<std::string> tx_hash_list; std::list<std::string> tx_key_list; @@ -766,11 +805,12 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SWEEP_SINGLE { - struct request + struct request_t { std::string address; uint32_t priority; @@ -800,8 +840,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(get_tx_metadata, false) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string tx_hash; std::string tx_key; @@ -823,11 +864,12 @@ namespace wallet_rpc KV_SERIALIZE(unsigned_txset) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_RELAY_TX { - struct request + struct request_t { std::string hex; @@ -835,8 +877,9 @@ namespace wallet_rpc KV_SERIALIZE(hex) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string tx_hash; @@ -844,21 +887,24 @@ namespace wallet_rpc KV_SERIALIZE(tx_hash) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_STORE { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct payment_details @@ -884,7 +930,7 @@ namespace wallet_rpc struct COMMAND_RPC_GET_PAYMENTS { - struct request + struct request_t { std::string payment_id; @@ -892,8 +938,9 @@ namespace wallet_rpc KV_SERIALIZE(payment_id) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<payment_details> payments; @@ -901,11 +948,12 @@ namespace wallet_rpc KV_SERIALIZE(payments) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_BULK_PAYMENTS { - struct request + struct request_t { std::vector<std::string> payment_ids; uint64_t min_block_height; @@ -915,8 +963,9 @@ namespace wallet_rpc KV_SERIALIZE(min_block_height) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<payment_details> payments; @@ -924,6 +973,7 @@ namespace wallet_rpc KV_SERIALIZE(payments) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct transfer_details @@ -947,7 +997,7 @@ namespace wallet_rpc struct COMMAND_RPC_INCOMING_TRANSFERS { - struct request + struct request_t { std::string transfer_type; uint32_t account_index; @@ -959,8 +1009,9 @@ namespace wallet_rpc KV_SERIALIZE(subaddr_indices) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<transfer_details> transfers; @@ -968,12 +1019,13 @@ namespace wallet_rpc KV_SERIALIZE(transfers) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; //JSON RPC V2 struct COMMAND_RPC_QUERY_KEY { - struct request + struct request_t { std::string key_type; @@ -981,8 +1033,9 @@ namespace wallet_rpc KV_SERIALIZE(key_type) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string key; @@ -990,11 +1043,12 @@ namespace wallet_rpc KV_SERIALIZE(key) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_MAKE_INTEGRATED_ADDRESS { - struct request + struct request_t { std::string standard_address; std::string payment_id; @@ -1004,8 +1058,9 @@ namespace wallet_rpc KV_SERIALIZE(payment_id) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string integrated_address; std::string payment_id; @@ -1015,11 +1070,12 @@ namespace wallet_rpc KV_SERIALIZE(payment_id) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SPLIT_INTEGRATED_ADDRESS { - struct request + struct request_t { std::string integrated_address; @@ -1027,8 +1083,9 @@ namespace wallet_rpc KV_SERIALIZE(integrated_address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string standard_address; std::string payment_id; @@ -1040,26 +1097,29 @@ namespace wallet_rpc KV_SERIALIZE(is_subaddress) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_STOP_WALLET { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_RESCAN_BLOCKCHAIN { - struct request + struct request_t { bool hard; @@ -1067,17 +1127,19 @@ namespace wallet_rpc KV_SERIALIZE_OPT(hard, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_TX_NOTES { - struct request + struct request_t { std::list<std::string> txids; std::list<std::string> notes; @@ -1087,17 +1149,19 @@ namespace wallet_rpc KV_SERIALIZE(notes) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TX_NOTES { - struct request + struct request_t { std::list<std::string> txids; @@ -1105,8 +1169,9 @@ namespace wallet_rpc KV_SERIALIZE(txids) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<std::string> notes; @@ -1114,11 +1179,12 @@ namespace wallet_rpc KV_SERIALIZE(notes) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SET_ATTRIBUTE { - struct request + struct request_t { std::string key; std::string value; @@ -1128,17 +1194,19 @@ namespace wallet_rpc KV_SERIALIZE(value) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ATTRIBUTE { - struct request + struct request_t { std::string key; @@ -1147,8 +1215,9 @@ namespace wallet_rpc KV_SERIALIZE(key) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string value; @@ -1156,11 +1225,12 @@ namespace wallet_rpc KV_SERIALIZE(value) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TX_KEY { - struct request + struct request_t { std::string txid; @@ -1168,8 +1238,9 @@ namespace wallet_rpc KV_SERIALIZE(txid) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string tx_key; @@ -1177,11 +1248,12 @@ namespace wallet_rpc KV_SERIALIZE(tx_key) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CHECK_TX_KEY { - struct request + struct request_t { std::string txid; std::string tx_key; @@ -1193,8 +1265,9 @@ namespace wallet_rpc KV_SERIALIZE(address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t received; bool in_pool; @@ -1206,11 +1279,12 @@ namespace wallet_rpc KV_SERIALIZE(confirmations) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TX_PROOF { - struct request + struct request_t { std::string txid; std::string address; @@ -1222,8 +1296,9 @@ namespace wallet_rpc KV_SERIALIZE(message) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string signature; @@ -1231,11 +1306,12 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CHECK_TX_PROOF { - struct request + struct request_t { std::string txid; std::string address; @@ -1249,8 +1325,9 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { bool good; uint64_t received; @@ -1264,6 +1341,7 @@ namespace wallet_rpc KV_SERIALIZE(confirmations) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct transfer_entry @@ -1305,7 +1383,7 @@ namespace wallet_rpc struct COMMAND_RPC_GET_SPEND_PROOF { - struct request + struct request_t { std::string txid; std::string message; @@ -1315,8 +1393,9 @@ namespace wallet_rpc KV_SERIALIZE(message) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string signature; @@ -1324,11 +1403,12 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CHECK_SPEND_PROOF { - struct request + struct request_t { std::string txid; std::string message; @@ -1340,8 +1420,9 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { bool good; @@ -1349,11 +1430,12 @@ namespace wallet_rpc KV_SERIALIZE(good) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_RESERVE_PROOF { - struct request + struct request_t { bool all; uint32_t account_index; // ignored when `all` is true @@ -1367,8 +1449,9 @@ namespace wallet_rpc KV_SERIALIZE(message) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string signature; @@ -1376,11 +1459,12 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CHECK_RESERVE_PROOF { - struct request + struct request_t { std::string address; std::string message; @@ -1392,8 +1476,9 @@ namespace wallet_rpc KV_SERIALIZE(signature) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { bool good; uint64_t total; @@ -1405,11 +1490,12 @@ namespace wallet_rpc KV_SERIALIZE(spent) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TRANSFERS { - struct request + struct request_t { bool in; bool out; @@ -1438,8 +1524,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(all_accounts, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<transfer_entry> in; std::list<transfer_entry> out; @@ -1455,11 +1542,12 @@ namespace wallet_rpc KV_SERIALIZE(pool); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_TRANSFER_BY_TXID { - struct request + struct request_t { std::string txid; uint32_t account_index; @@ -1469,8 +1557,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(account_index, (uint32_t)0) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { transfer_entry transfer; std::list<transfer_entry> transfers; @@ -1480,11 +1569,12 @@ namespace wallet_rpc KV_SERIALIZE(transfers); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SIGN { - struct request + struct request_t { std::string data; @@ -1492,8 +1582,9 @@ namespace wallet_rpc KV_SERIALIZE(data); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string signature; @@ -1501,11 +1592,12 @@ namespace wallet_rpc KV_SERIALIZE(signature); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_VERIFY { - struct request + struct request_t { std::string data; std::string address; @@ -1517,8 +1609,9 @@ namespace wallet_rpc KV_SERIALIZE(signature); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { bool good; @@ -1526,17 +1619,19 @@ namespace wallet_rpc KV_SERIALIZE(good); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_EXPORT_OUTPUTS { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string outputs_data_hex; @@ -1544,11 +1639,12 @@ namespace wallet_rpc KV_SERIALIZE(outputs_data_hex); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_IMPORT_OUTPUTS { - struct request + struct request_t { std::string outputs_data_hex; @@ -1556,8 +1652,9 @@ namespace wallet_rpc KV_SERIALIZE(outputs_data_hex); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t num_imported; @@ -1565,11 +1662,12 @@ namespace wallet_rpc KV_SERIALIZE(num_imported); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_EXPORT_KEY_IMAGES { - struct request + struct request_t { bool all; @@ -1577,6 +1675,7 @@ namespace wallet_rpc KV_SERIALIZE_OPT(all, false); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct signed_key_image { @@ -1589,7 +1688,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { uint32_t offset; std::vector<signed_key_image> signed_key_images; @@ -1599,6 +1698,7 @@ namespace wallet_rpc KV_SERIALIZE(signed_key_images); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_IMPORT_KEY_IMAGES @@ -1614,7 +1714,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct request + struct request_t { uint32_t offset; std::vector<signed_key_image> signed_key_images; @@ -1624,8 +1724,9 @@ namespace wallet_rpc KV_SERIALIZE(signed_key_images); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t height; uint64_t spent; @@ -1637,6 +1738,7 @@ namespace wallet_rpc KV_SERIALIZE(unspent) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct uri_spec @@ -1658,11 +1760,12 @@ namespace wallet_rpc struct COMMAND_RPC_MAKE_URI { - struct request: public uri_spec + struct request_t: public uri_spec { }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string uri; @@ -1670,11 +1773,12 @@ namespace wallet_rpc KV_SERIALIZE(uri) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_PARSE_URI { - struct request + struct request_t { std::string uri; @@ -1682,8 +1786,9 @@ namespace wallet_rpc KV_SERIALIZE(uri) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uri_spec uri; std::vector<std::string> unknown_parameters; @@ -1693,11 +1798,12 @@ namespace wallet_rpc KV_SERIALIZE(unknown_parameters); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_ADD_ADDRESS_BOOK_ENTRY { - struct request + struct request_t { std::string address; std::string payment_id; @@ -1709,8 +1815,9 @@ namespace wallet_rpc KV_SERIALIZE(description) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t index; @@ -1718,11 +1825,12 @@ namespace wallet_rpc KV_SERIALIZE(index); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_ADDRESS_BOOK_ENTRY { - struct request + struct request_t { std::list<uint64_t> entries; @@ -1730,6 +1838,7 @@ namespace wallet_rpc KV_SERIALIZE(entries) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; struct entry { @@ -1746,7 +1855,7 @@ namespace wallet_rpc END_KV_SERIALIZE_MAP() }; - struct response + struct response_t { std::vector<entry> entries; @@ -1754,11 +1863,12 @@ namespace wallet_rpc KV_SERIALIZE(entries) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_DELETE_ADDRESS_BOOK_ENTRY { - struct request + struct request_t { uint64_t index; @@ -1766,32 +1876,36 @@ namespace wallet_rpc KV_SERIALIZE(index); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_RESCAN_SPENT { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_REFRESH { - struct request + struct request_t { uint64_t start_height; @@ -1799,8 +1913,9 @@ namespace wallet_rpc KV_SERIALIZE_OPT(start_height, (uint64_t) 0) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t blocks_fetched; bool received_money; @@ -1810,11 +1925,12 @@ namespace wallet_rpc KV_SERIALIZE(received_money); END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_START_MINING { - struct request + struct request_t { uint64_t threads_count; bool do_background_mining; @@ -1826,37 +1942,43 @@ namespace wallet_rpc KV_SERIALIZE(ignore_battery) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_STOP_MINING { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_LANGUAGES { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { std::vector<std::string> languages; @@ -1864,11 +1986,12 @@ namespace wallet_rpc KV_SERIALIZE(languages) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CREATE_WALLET { - struct request + struct request_t { std::string filename; std::string password; @@ -1880,16 +2003,19 @@ namespace wallet_rpc KV_SERIALIZE(language) END_KV_SERIALIZE_MAP() }; - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_OPEN_WALLET { - struct request + struct request_t { std::string filename; std::string password; @@ -1899,31 +2025,36 @@ namespace wallet_rpc KV_SERIALIZE(password) END_KV_SERIALIZE_MAP() }; - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CLOSE_WALLET { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_CHANGE_WALLET_PASSWORD { - struct request + struct request_t { std::string old_password; std::string new_password; @@ -1933,16 +2064,19 @@ namespace wallet_rpc KV_SERIALIZE(new_password) END_KV_SERIALIZE_MAP() }; - struct response + typedef epee::misc_utils::struct_init<request_t> request; + + struct response_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_RESTORE_DETERMINISTIC_WALLET { - struct request + struct request_t { uint64_t restore_height; std::string filename; @@ -1960,8 +2094,9 @@ namespace wallet_rpc KV_SERIALIZE(language) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string address; std::string seed; @@ -1975,17 +2110,19 @@ namespace wallet_rpc KV_SERIALIZE(was_deprecated) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_IS_MULTISIG { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { bool multisig; bool ready; @@ -1999,17 +2136,19 @@ namespace wallet_rpc KV_SERIALIZE(total) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_PREPARE_MULTISIG { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string multisig_info; @@ -2017,11 +2156,12 @@ namespace wallet_rpc KV_SERIALIZE(multisig_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_MAKE_MULTISIG { - struct request + struct request_t { std::vector<std::string> multisig_info; uint32_t threshold; @@ -2033,8 +2173,9 @@ namespace wallet_rpc KV_SERIALIZE(password) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string address; std::string multisig_info; @@ -2044,17 +2185,19 @@ namespace wallet_rpc KV_SERIALIZE(multisig_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_EXPORT_MULTISIG { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string info; @@ -2062,11 +2205,12 @@ namespace wallet_rpc KV_SERIALIZE(info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_IMPORT_MULTISIG { - struct request + struct request_t { std::vector<std::string> info; @@ -2074,8 +2218,9 @@ namespace wallet_rpc KV_SERIALIZE(info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint64_t n_outputs; @@ -2083,11 +2228,12 @@ namespace wallet_rpc KV_SERIALIZE(n_outputs) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_FINALIZE_MULTISIG { - struct request + struct request_t { std::string password; std::vector<std::string> multisig_info; @@ -2097,8 +2243,9 @@ namespace wallet_rpc KV_SERIALIZE(multisig_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string address; @@ -2106,11 +2253,12 @@ namespace wallet_rpc KV_SERIALIZE(address) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_EXCHANGE_MULTISIG_KEYS { - struct request + struct request_t { std::string password; std::vector<std::string> multisig_info; @@ -2120,8 +2268,9 @@ namespace wallet_rpc KV_SERIALIZE(multisig_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string address; std::string multisig_info; @@ -2131,11 +2280,12 @@ namespace wallet_rpc KV_SERIALIZE(multisig_info) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SIGN_MULTISIG { - struct request + struct request_t { std::string tx_data_hex; @@ -2143,8 +2293,9 @@ namespace wallet_rpc KV_SERIALIZE(tx_data_hex) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::string tx_data_hex; std::list<std::string> tx_hash_list; @@ -2154,11 +2305,12 @@ namespace wallet_rpc KV_SERIALIZE(tx_hash_list) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_SUBMIT_MULTISIG { - struct request + struct request_t { std::string tx_data_hex; @@ -2166,8 +2318,9 @@ namespace wallet_rpc KV_SERIALIZE(tx_data_hex) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { std::list<std::string> tx_hash_list; @@ -2175,17 +2328,19 @@ namespace wallet_rpc KV_SERIALIZE(tx_hash_list) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_GET_VERSION { - struct request + struct request_t { BEGIN_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<request_t> request; - struct response + struct response_t { uint32_t version; @@ -2193,6 +2348,7 @@ namespace wallet_rpc KV_SERIALIZE(version) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<response_t> response; }; struct COMMAND_RPC_VALIDATE_ADDRESS |