mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 05:37:58 +00:00
camel case and deny (#20)
This commit is contained in:
committed by
Robert Habermeier
parent
3dfafb5ec3
commit
0ceebe6625
@@ -24,12 +24,12 @@ pub type HeaderHash = H256;
|
||||
|
||||
/// A relay chain block header.
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Header {
|
||||
/// Block parent's hash.
|
||||
#[serde(rename="parentHash")]
|
||||
pub parent_hash: HeaderHash,
|
||||
/// State root after this transition.
|
||||
#[serde(rename="stateRoot")]
|
||||
pub state_root: H256,
|
||||
/// Unix time at which this header was produced.
|
||||
pub timestamp: u64,
|
||||
@@ -42,9 +42,10 @@ pub struct Header {
|
||||
/// Included candidates should be sorted by parachain ID, and without duplicate
|
||||
/// IDs.
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Body {
|
||||
/// Parachain proposal blocks.
|
||||
#[serde(rename="paraBlocks")]
|
||||
pub para_blocks: Vec<parachain::Proposal>,
|
||||
}
|
||||
|
||||
|
||||
@@ -32,13 +32,14 @@ impl From<u64> for Id {
|
||||
|
||||
/// A parachain block proposal.
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Proposal {
|
||||
/// The ID of the parachain this is a proposal for.
|
||||
pub parachain: Id,
|
||||
/// Parachain block header bytes.
|
||||
pub header: Header,
|
||||
/// Hash of data necessary to prove validity of the header.
|
||||
#[serde(rename="proofHash")]
|
||||
pub proof_hash: ProofHash,
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ pub struct EgressPosts(#[serde(with="bytes")] pub Vec<u8>);
|
||||
/// Validity result of particular proof and ingress queue.
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(tag="type", content="data")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub enum ProofValidity {
|
||||
/// The proof is invalid.
|
||||
#[serde(rename="invalid")]
|
||||
Invalid,
|
||||
#[serde(rename="valid")]
|
||||
/// The proof is processed and new egress queue is created.
|
||||
/// Also includes current ingress queue delta.
|
||||
Valid(IngressPostsDelta, EgressPosts),
|
||||
|
||||
Reference in New Issue
Block a user