Conversation
| "latest_block_height" => i.block_height | ||
| }; | ||
| o.pretty(2) | ||
| let branch_id: u32 = i.consensus_branch_id.parse().unwrap(); |
There was a problem hiding this comment.
can you replace with an expect with a message to explain why this should not panic?
| pub supports_transparent: bool, | ||
| pub chain_name: String, | ||
| pub sapling_activation_height: BlockHeight, | ||
| pub consensus_branch_id: BranchId, |
There was a problem hiding this comment.
work is undergoing to remove zcash_protocol from the public API. I think this is ok for now and we can revisit this later when the replacement internal types and modules are in place.
| vendor: i.vendor, | ||
| supports_transparent: i.taddr_support, | ||
| chain_name: i.chain_name, | ||
| sapling_activation_height: i.sapling_activation_height.try_into().unwrap(), |
There was a problem hiding this comment.
can we replace unwrap with atleast an expect or preferably returning an error now this fn returns a result?
| supports_transparent: i.taddr_support, | ||
| chain_name: i.chain_name, | ||
| sapling_activation_height: i.sapling_activation_height.try_into().unwrap(), | ||
| consensus_branch_id: BranchId::try_from(branch_id).unwrap(), |
| chain_name: i.chain_name, | ||
| sapling_activation_height: i.sapling_activation_height.try_into().unwrap(), | ||
| consensus_branch_id: BranchId::try_from(branch_id).unwrap(), | ||
| latest_block_height: i.block_height.try_into().unwrap(), |
| pub sapling_activation_height: BlockHeight, | ||
| pub consensus_branch_id: BranchId, | ||
| pub latest_block_height: BlockHeight, | ||
| } |
There was a problem hiding this comment.
can we add an impl:
impl From for json::JsonValue {
...
}
| "sapling_activation_height" => info.sapling_activation_height.to_string(), | ||
| "consensus_branch_id" => u32::from(info.consensus_branch_id).to_string(), | ||
| "latest_block_height" => info.latest_block_height.to_string() | ||
| } |
There was a problem hiding this comment.
can we move this code into the impl i mentioned below and call it here?
There was a problem hiding this comment.
i.e. Ok(info) => json::JsonValue::from(info).pretty(2)
Fixes #2257.