aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server_commands_defs.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-04-14 13:34:05 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-04-14 13:34:05 +0100
commitc1bda097c18036853076806d7ed4fea2d20eb727 (patch)
tree12a5e35cedec291eb3b9d4cda44618458d4904cb /src/wallet/wallet_rpc_server_commands_defs.h
parentMerge pull request #3618 (diff)
downloadmonero-c1bda097c18036853076806d7ed4fea2d20eb727.tar.xz
wallet_rpc_server: add a get_version RPC
Diffstat (limited to 'src/wallet/wallet_rpc_server_commands_defs.h')
-rw-r--r--src/wallet/wallet_rpc_server_commands_defs.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h
index a0f43c9b9..d44aa459f 100644
--- a/src/wallet/wallet_rpc_server_commands_defs.h
+++ b/src/wallet/wallet_rpc_server_commands_defs.h
@@ -39,6 +39,17 @@
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc"
+// When making *any* change here, bump minor
+// If the change is incompatible, then bump major and set minor to 0
+// This ensures WALLET_RPC_VERSION always increases, that every change
+// has its own version, and that clients can just test major to see
+// whether they can talk to a given wallet without having to know in
+// advance which version they will stop working with
+// Don't go over 32767 for any of these
+#define WALLET_RPC_VERSION_MAJOR 1
+#define WALLET_RPC_VERSION_MINOR 0
+#define MAKE_WALLET_RPC_VERSION(major,minor) (((major)<<16)|(minor))
+#define WALLET_RPC_VERSION MAKE_WALLET_RPC_VERSION(WALLET_RPC_VERSION_MAJOR, WALLET_RPC_VERSION_MINOR)
namespace tools
{
namespace wallet_rpc
@@ -1848,5 +1859,23 @@ namespace wallet_rpc
};
};
+ struct COMMAND_RPC_GET_VERSION
+ {
+ struct request
+ {
+ BEGIN_KV_SERIALIZE_MAP()
+ END_KV_SERIALIZE_MAP()
+ };
+
+ struct response
+ {
+ uint32_t version;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(version)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
}
}