casper_client/rpcs/v1_4_5/
get_block.rs1use serde::{Deserialize, Serialize};
2
3use casper_types::ProtocolVersion;
4
5use crate::{rpcs::common::BlockIdentifier, types::Block};
6
7pub(crate) const GET_BLOCK_METHOD: &str = "chain_get_block";
8
9#[derive(Serialize, Deserialize, Debug)]
10#[serde(deny_unknown_fields)]
11pub(crate) struct GetBlockParams {
12 block_identifier: BlockIdentifier,
13}
14
15impl GetBlockParams {
16 pub(crate) fn new(block_identifier: BlockIdentifier) -> Self {
17 GetBlockParams { block_identifier }
18 }
19}
20
21#[derive(Serialize, Deserialize, Debug)]
23#[serde(deny_unknown_fields)]
24pub struct GetBlockResult {
25 pub api_version: ProtocolVersion,
27 pub block: Option<Block>,
29}