Skip to content

Commit 4b2dce4

Browse files
committed
Merge branch 'main' into user-book
2 parents 99b3c45 + 3ef6a96 commit 4b2dce4

File tree

108 files changed

+8103
-3546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+8103
-3546
lines changed

Cargo.lock

Lines changed: 23 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ members = [
1212

1313
# Net
1414
"net/epee-encoding",
15-
"net/fixed-bytes",
1615
"net/levin",
1716
"net/wire",
1817

@@ -30,6 +29,11 @@ members = [
3029
"storage/txpool",
3130
"storage/database",
3231

32+
# Types
33+
"types/types",
34+
"types/hex",
35+
"types/fixed-bytes",
36+
3337
# RPC
3438
"rpc/json-rpc",
3539
"rpc/types",
@@ -44,7 +48,6 @@ members = [
4448
"helper",
4549
"pruning",
4650
"test-utils",
47-
"types",
4851
]
4952

5053
[profile.release]
@@ -77,22 +80,23 @@ cuprate-consensus-context = { path = "consensus/context", default-featur
7780
cuprate-cryptonight = { path = "cryptonight", default-features = false }
7881
cuprate-helper = { path = "helper", default-features = false }
7982
cuprate-epee-encoding = { path = "net/epee-encoding", default-features = false }
80-
cuprate-fixed-bytes = { path = "net/fixed-bytes", default-features = false }
8183
cuprate-levin = { path = "net/levin", default-features = false }
8284
cuprate-wire = { path = "net/wire", default-features = false }
85+
cuprate-async-buffer = { path = "p2p/async-buffer", default-features = false }
8386
cuprate-p2p = { path = "p2p/p2p", default-features = false }
8487
cuprate-p2p-core = { path = "p2p/p2p-core", default-features = false }
8588
cuprate-p2p-bucket = { path = "p2p/p2p-bucket", default-features = false }
8689
cuprate-dandelion-tower = { path = "p2p/dandelion-tower", default-features = false }
87-
cuprate-async-buffer = { path = "p2p/async-buffer", default-features = false }
8890
cuprate-address-book = { path = "p2p/address-book", default-features = false }
8991
cuprate-blockchain = { path = "storage/blockchain", default-features = false }
9092
cuprate-database = { path = "storage/database", default-features = false }
9193
cuprate-database-service = { path = "storage/service", default-features = false }
9294
cuprate-txpool = { path = "storage/txpool", default-features = false }
9395
cuprate-pruning = { path = "pruning", default-features = false }
9496
cuprate-test-utils = { path = "test-utils", default-features = false }
95-
cuprate-types = { path = "types", default-features = false }
97+
cuprate-types = { path = "types/types", default-features = false }
98+
cuprate-hex = { path = "types/hex", default-features = false }
99+
cuprate-fixed-bytes = { path = "types/fixed-bytes", default-features = false }
96100
cuprate-json-rpc = { path = "rpc/json-rpc", default-features = false }
97101
cuprate-rpc-types = { path = "rpc/types", default-features = false }
98102
cuprate-rpc-interface = { path = "rpc/interface", default-features = false }
@@ -121,6 +125,7 @@ futures = { version = "0.3", default-features = false }
121125
hex = { version = "0.4", default-features = false }
122126
hex-literal = { version = "0.4", default-features = false }
123127
indexmap = { version = "2", default-features = false }
128+
monero-address = { git = "https://github.com/Cuprate/serai.git", rev = "e6ae8c2", default-features = false }
124129
monero-serai = { git = "https://github.com/Cuprate/serai.git", rev = "e6ae8c2", default-features = false }
125130
nu-ansi-term = { version = "0.46", default-features = false }
126131
paste = { version = "1", default-features = false }
@@ -211,7 +216,6 @@ missing_transmute_annotations = "deny"
211216
mut_mut = "deny"
212217
needless_bitwise_bool = "deny"
213218
needless_character_iteration = "deny"
214-
needless_continue = "deny"
215219
needless_for_each = "deny"
216220
needless_maybe_sized = "deny"
217221
needless_raw_string_hashes = "deny"

binaries/cuprated/Cargo.toml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,34 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/binaries/cuprated"
99

1010
[dependencies]
1111
# TODO: after v1.0.0, remove unneeded dependencies.
12-
cuprate-constants = { workspace = true, features = ["build"] }
13-
cuprate-consensus = { workspace = true }
14-
cuprate-fast-sync = { workspace = true }
12+
cuprate-address-book = { workspace = true }
13+
cuprate-async-buffer = { workspace = true }
14+
cuprate-blockchain = { workspace = true }
1515
cuprate-consensus-context = { workspace = true }
1616
cuprate-consensus-rules = { workspace = true }
17+
cuprate-consensus = { workspace = true }
18+
cuprate-constants = { workspace = true, features = ["build", "rpc"] }
1719
cuprate-cryptonight = { workspace = true }
18-
cuprate-helper = { workspace = true, features = ["std", "serde", "time"] }
20+
cuprate-dandelion-tower = { workspace = true, features = ["txpool"] }
21+
cuprate-database-service = { workspace = true, features = ["serde"] }
22+
cuprate-database = { workspace = true, features = ["serde"] }
1923
cuprate-epee-encoding = { workspace = true }
24+
cuprate-fast-sync = { workspace = true }
2025
cuprate-fixed-bytes = { workspace = true }
26+
cuprate-helper = { workspace = true, features = ["std", "serde", "time"] }
27+
cuprate-hex = { workspace = true }
28+
cuprate-json-rpc = { workspace = true }
2129
cuprate-levin = { workspace = true }
22-
cuprate-wire = { workspace = true }
23-
cuprate-p2p = { workspace = true }
2430
cuprate-p2p-core = { workspace = true }
25-
cuprate-dandelion-tower = { workspace = true, features = ["txpool"] }
26-
cuprate-async-buffer = { workspace = true }
27-
cuprate-address-book = { workspace = true }
28-
cuprate-blockchain = { workspace = true }
29-
cuprate-database-service = { workspace = true, features = ["serde"] }
30-
cuprate-txpool = { workspace = true }
31-
cuprate-database = { workspace = true, features = ["serde"] }
31+
cuprate-p2p = { workspace = true }
3232
cuprate-pruning = { workspace = true }
33-
cuprate-test-utils = { workspace = true }
34-
cuprate-types = { workspace = true }
35-
cuprate-json-rpc = { workspace = true }
3633
cuprate-rpc-interface = { workspace = true }
37-
cuprate-rpc-types = { workspace = true }
34+
cuprate-rpc-types = { workspace = true, features = ["from"] }
35+
cuprate-test-utils = { workspace = true }
36+
cuprate-txpool = { workspace = true }
37+
cuprate-types = { workspace = true, features = ["json"] }
38+
cuprate-wire = { workspace = true }
39+
3840

3941
# TODO: after v1.0.0, remove unneeded dependencies.
4042
anyhow = { workspace = true }
@@ -56,6 +58,7 @@ futures = { workspace = true }
5658
hex = { workspace = true }
5759
hex-literal = { workspace = true }
5860
indexmap = { workspace = true }
61+
monero-address = { workspace = true }
5962
monero-serai = { workspace = true }
6063
nu-ansi-term = { workspace = true }
6164
paste = { workspace = true }
@@ -67,6 +70,7 @@ rayon = { workspace = true }
6770
serde_bytes = { workspace = true }
6871
serde_json = { workspace = true }
6972
serde = { workspace = true }
73+
strum = { workspace = true }
7074
thiserror = { workspace = true }
7175
thread_local = { workspace = true }
7276
tokio-util = { workspace = true, features = ["rt"] }
2.16 KB
Binary file not shown.

binaries/cuprated/src/rpc.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
//!
33
//! Will contain the code to initiate the RPC and a request handler.
44
5-
mod bin;
65
mod constants;
7-
mod handler;
8-
mod json;
9-
mod other;
10-
mod request;
6+
mod handlers;
7+
mod rpc_handler;
8+
mod service;
119

12-
pub use handler::CupratedRpcHandler;
10+
pub use rpc_handler::CupratedRpcHandler;

binaries/cuprated/src/rpc/bin.rs

Lines changed: 0 additions & 85 deletions
This file was deleted.

binaries/cuprated/src/rpc/constants.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
/// The string message used in RPC response fields for when
44
/// `cuprated` does not support a field that `monerod` has.
55
pub(super) const FIELD_NOT_SUPPORTED: &str = "`cuprated` does not support this field.";
6+
7+
/// The error message returned when an unsupported RPC call is requested.
8+
pub(super) const UNSUPPORTED_RPC_CALL: &str = "This RPC call is not supported by Cuprate.";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! RPC handler functions.
2+
//!
3+
//! These are the glue (async) functions that connect all the
4+
//! internal `cuprated` functions and fulfill the request.
5+
//!
6+
//! - JSON-RPC handlers are in [`json_rpc`]
7+
//! - Other JSON endpoint handlers are in [`other_json`]
8+
//! - Other binary endpoint handlers are in [`bin`]
9+
//!
10+
//! - [`helper`] contains helper functions used by many handlers
11+
//! - [`shared`] contains shared functions used by multiple handlers
12+
13+
pub(super) mod bin;
14+
pub(super) mod json_rpc;
15+
pub(super) mod other_json;
16+
17+
mod helper;
18+
mod shared;

0 commit comments

Comments
 (0)