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/// Not defined in `monerod` although used frequently.
40pub const CORE_RPC_STATUS_FAILED: &str = "Failed";
41
42//---------------------------------------------------------------------------------------------------- Versions
43#[doc = monero_definition_link!("cc73fe71162d564ffda8e549b79a350bca53c454", "/rpc/core_rpc_server_commands_defs.h", 90)]
44/// RPC major version.
45pub const CORE_RPC_VERSION_MAJOR: u32 = 3;
46
47#[doc = monero_definition_link!("cc73fe71162d564ffda8e549b79a350bca53c454", "/rpc/core_rpc_server_commands_defs.h", 91)]
48/// RPC miror version.
49pub const CORE_RPC_VERSION_MINOR: u32 = 14;
50
51#[doc = monero_definition_link!("cc73fe71162d564ffda8e549b79a350bca53c454", "/rpc/core_rpc_server_commands_defs.h", 92..=93)]
52/// RPC version.
53pub const CORE_RPC_VERSION: u32 = (CORE_RPC_VERSION_MAJOR << 16) | CORE_RPC_VERSION_MINOR;
54
55//---------------------------------------------------------------------------------------------------- Tests
56#[cfg(test)]
57mod test {
58 // use super::*;
59}