Skip to content

Commit

Permalink
Use quoted ints from #1588
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Sep 7, 2020
1 parent 4b153d7 commit 9159c15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions validator_client/slashing_protection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parking_lot = "0.11.0"
serde = "1.0.110"
serde_derive = "1.0.110"
serde_json = "1.0.52"
serde_utils = { path = "../../consensus/serde_utils" }

[dev-dependencies]
rayon = "1.3.0"
11 changes: 6 additions & 5 deletions validator_client/slashing_protection/src/interchange.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use serde_derive::{Deserialize, Serialize};
use serde_utils::quoted_u64::Quoted;
use std::collections::HashSet;
use std::iter::FromIterator;
use types::{serde_utils::Quoted, Epoch, Hash256, PublicKey, Slot};
use types::{Epoch, Hash256, PublicKey, Slot};

#[derive(Debug, Clone, Copy, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
Expand All @@ -14,7 +15,7 @@ pub enum InterchangeFormat {
#[serde(deny_unknown_fields)]
pub struct InterchangeMetadata {
pub interchange_format: InterchangeFormat,
#[serde(with = "types::serde_utils::only_quoted")]
#[serde(with = "serde_utils::quoted_u64::require_quotes")]
pub interchange_format_version: u64,
pub genesis_validators_root: Hash256,
}
Expand Down Expand Up @@ -64,17 +65,17 @@ pub struct CompleteInterchangeData {
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SignedBlock {
#[serde(with = "types::serde_utils::only_quoted")]
#[serde(with = "serde_utils::quoted_u64::require_quotes")]
pub slot: Slot,
pub signing_root: Option<Hash256>,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SignedAttestation {
#[serde(with = "types::serde_utils::only_quoted")]
#[serde(with = "serde_utils::quoted_u64::require_quotes")]
pub source_epoch: Epoch,
#[serde(with = "types::serde_utils::only_quoted")]
#[serde(with = "serde_utils::quoted_u64::require_quotes")]
pub target_epoch: Epoch,
pub signing_root: Option<Hash256>,
}
Expand Down

0 comments on commit 9159c15

Please sign in to comment.