From ac93f922486f65e1a337ce5f14c37772f58c1357 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Mon, 7 Nov 2022 20:22:24 -0300 Subject: [PATCH] move docs to struct --- zebra-rpc/src/methods/get_block_template_rpcs.rs | 5 ----- .../types/get_block_template.rs | 12 ++++-------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/zebra-rpc/src/methods/get_block_template_rpcs.rs b/zebra-rpc/src/methods/get_block_template_rpcs.rs index f79374bebfa..dab76fb942f 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs.rs @@ -326,7 +326,6 @@ where Ok(GetBlockTemplate { capabilities: vec![], - // The block version version: ZCASH_BLOCK_VERSION, previous_block_hash: GetBlockHash([0; 32].into()), @@ -348,19 +347,15 @@ where min_time: 0, - // Hardcoded list of block fields the miner is allowed to change. mutable: constants::GET_BLOCK_TEMPLATE_MUTABLE_FIELD .iter() .map(ToString::to_string) .collect(), - // A range of valid nonces that goes from `u32::MIN` to `u32::MAX`. nonce_range: constants::GET_BLOCK_TEMPLATE_NONCE_RANGE_FIELD.to_string(), - // Max legacy signature operations in the block. sigop_limit: MAX_BLOCK_SIGOPS, - // Max block size in bytes size_limit: MAX_BLOCK_BYTES, cur_time: 0, diff --git a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs index 022262f80a8..63840d15a47 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template.rs @@ -74,22 +74,18 @@ pub struct GetBlockTemplate { // TODO: use DateTime32 type? pub min_time: u32, - /// Add documentation. + /// Hardcoded list of block fields the miner is allowed to change. pub mutable: Vec, - /// Add documentation. + /// A range of valid nonces that goes from `u32::MIN` to `u32::MAX`. #[serde(rename = "noncerange")] pub nonce_range: String, - /// Add documentation. - /// - /// The same as `MAX_BLOCK_SIGOPS`. + /// Max legacy signature operations in the block. #[serde(rename = "sigoplimit")] pub sigop_limit: u64, - /// Add documentation. - /// - /// The same as `MAX_BLOCK_BYTES`. + /// Max block size in bytes #[serde(rename = "sizelimit")] pub size_limit: u64,