cuprate_rpc_types/
constants.rs

1//! TODO
2
3// From: <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h#L83-L89>
4//
5// ```
6// When making *any* change here, bump minor
7// If the change is incompatible, then bump major and set minor to 0
8// This ensures CORE_RPC_VERSION always increases, that every change
9// has its own version, and that clients can just test major to see
10// whether they can talk to a given daemon without having to know in
11// advance which version they will stop working with
12// Don't go over 32767 for any of these
13// ```
14//
15// What this means for Cuprate: just follow `monerod`.
16
17//---------------------------------------------------------------------------------------------------- Import
18use crate::macros::monero_definition_link;
19
20//---------------------------------------------------------------------------------------------------- Status
21// Common RPC status strings:
22// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server_commands_defs.h#L78-L81>.
23//
24// Note that these are _distinct_ from the ones in ZMQ:
25// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/message.cpp#L40-L44>.
26
27#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 78)]
28pub const CORE_RPC_STATUS_OK: &str = "OK";
29
30#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 79)]
31pub const CORE_RPC_STATUS_BUSY: &str = "BUSY";
32
33#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 80)]
34pub const CORE_RPC_STATUS_NOT_MINING: &str = "NOT MINING";
35
36#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 81)]
37pub const CORE_RPC_STATUS_PAYMENT_REQUIRED: &str = "PAYMENT REQUIRED";
38
39//---------------------------------------------------------------------------------------------------- Versions
40#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 90)]
41/// RPC major version.
42pub const CORE_RPC_VERSION_MAJOR: u32 = 3;
43
44#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 91)]
45/// RPC miror version.
46pub const CORE_RPC_VERSION_MINOR: u32 = 14;
47
48#[doc = monero_definition_link!(cc73fe71162d564ffda8e549b79a350bca53c454, "/rpc/core_rpc_server_commands_defs.h", 92..=93)]
49/// RPC version.
50pub const CORE_RPC_VERSION: u32 = (CORE_RPC_VERSION_MAJOR << 16) | CORE_RPC_VERSION_MINOR;
51
52//---------------------------------------------------------------------------------------------------- Tests
53#[cfg(test)]
54mod test {
55    // use super::*;
56}