cuprate-rpc-types: add comments

This commit is contained in:
hinto.janai 2024-09-26 16:47:42 -04:00
parent 33c31871e1
commit 7dbd514a2d
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
4 changed files with 10 additions and 2 deletions

View file

@ -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 }

View file

@ -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<String> = default_vec::<String>(), "default_vec",
}

View file

@ -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,

View file

@ -140,6 +140,8 @@ define_request_and_response! {
#[doc = serde_doc_test!(GET_TRANSACTIONS_RESPONSE)]
AccessResponseBase {
txs_as_hex: Vec<String> = default_vec::<String>(), "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<String> = default_vec::<String>(), "default_vec",
missed_tx: Vec<String> = default_vec::<String>(), "default_vec",
txs: Vec<TxEntry> = default_vec::<TxEntry>(), "default_vec",