diff --git a/rpc/types/Cargo.toml b/rpc/types/Cargo.toml index 08b13b1..cfe7e47 100644 --- a/rpc/types/Cargo.toml +++ b/rpc/types/Cargo.toml @@ -16,7 +16,7 @@ epee = ["dep:cuprate-epee-encoding"] [dependencies] cuprate-epee-encoding = { path = "../../net/epee-encoding", optional = true } cuprate-fixed-bytes = { path = "../../net/fixed-bytes" } -cuprate-types = { path = "../../types" } +cuprate-types = { path = "../../types", default-features = false, features = ["epee", "serde"] } paste = { workspace = true } serde = { workspace = true, optional = true } diff --git a/rpc/types/src/json.rs b/rpc/types/src/json.rs index fb6e44b..d3426b4 100644 --- a/rpc/types/src/json.rs +++ b/rpc/types/src/json.rs @@ -635,7 +635,9 @@ define_request_and_response! { AccessResponseBase { blob: String, block_header: BlockHeader, - json: String, // FIXME: this should be defined in a struct, it has many fields. + /// `cuprate_rpc_types::json::block::Block` should be used + /// to create this JSON string in a type-safe manner. + json: String, miner_tx_hash: String, tx_hashes: Vec = default_vec::(), "default_vec", } diff --git a/rpc/types/src/misc/tx_entry.rs b/rpc/types/src/misc/tx_entry.rs index 5151cee..807c202 100644 --- a/rpc/types/src/misc/tx_entry.rs +++ b/rpc/types/src/misc/tx_entry.rs @@ -72,6 +72,8 @@ pub enum TxEntry { /// This entry exists in the transaction pool. InPool { as_hex: String, + /// `cuprate_rpc_types::json::tx::Transaction` should be used + /// to create this JSON string in a type-safe manner. as_json: String, block_height: u64, block_timestamp: u64, @@ -89,6 +91,8 @@ pub enum TxEntry { /// This entry _does not_ exist in the transaction pool. NotInPool { as_hex: String, + /// `cuprate_rpc_types::json::tx::Transaction` should be used + /// to create this JSON string in a type-safe manner. as_json: String, double_spend_seen: bool, prunable_as_hex: String, diff --git a/rpc/types/src/other.rs b/rpc/types/src/other.rs index 5b04089..e7f3394 100644 --- a/rpc/types/src/other.rs +++ b/rpc/types/src/other.rs @@ -140,6 +140,8 @@ define_request_and_response! { #[doc = serde_doc_test!(GET_TRANSACTIONS_RESPONSE)] AccessResponseBase { txs_as_hex: Vec = default_vec::(), "default_vec", + /// `cuprate_rpc_types::json::tx::Transaction` should be used + /// to create this JSON string in a type-safe manner. txs_as_json: Vec = default_vec::(), "default_vec", missed_tx: Vec = default_vec::(), "default_vec", txs: Vec = default_vec::(), "default_vec",