casper_client/rpcs/v1_4_5/
query_global_state.rs1use serde::{Deserialize, Serialize};
2
3use casper_types::{Key, ProtocolVersion};
4
5pub use crate::rpcs::common::GlobalStateIdentifier;
6use crate::types::{BlockHeader, StoredValue};
7#[cfg(doc)]
8use crate::BlockIdentifier;
9
10pub(crate) const QUERY_GLOBAL_STATE_METHOD: &str = "query_global_state";
11
12#[derive(Clone, Serialize, Deserialize, Debug)]
13#[serde(deny_unknown_fields)]
14pub(crate) struct QueryGlobalStateParams {
15 state_identifier: GlobalStateIdentifier,
16 key: String,
18 path: Vec<String>,
19}
20
21impl QueryGlobalStateParams {
22 pub(crate) fn new(
23 state_identifier: GlobalStateIdentifier,
24 key: Key,
25 path: Vec<String>,
26 ) -> Self {
27 QueryGlobalStateParams {
28 state_identifier,
29 key: key.to_formatted_string(),
30 path,
31 }
32 }
33}
34
35#[derive(Serialize, Deserialize, Debug)]
37#[serde(deny_unknown_fields)]
38pub struct QueryGlobalStateResult {
39 pub api_version: ProtocolVersion,
41 pub block_header: Option<BlockHeader>,
43 pub stored_value: StoredValue,
45 pub merkle_proof: String,
47}