Skip to content
Snippets Groups Projects
Commit 0ceebe66 authored by Tomasz Drwięga's avatar Tomasz Drwięga Committed by asynchronous rob
Browse files

camel case and deny (#20)

parent 3dfafb5e
No related merge requests found
......@@ -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),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment