From 586bb09e02adbfd0c888cdb524579b17c529dad5 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 20 Feb 2019 11:06:03 +1300 Subject: [PATCH] Set ssz_derive to import from ssz:: Previously it was expecting `Encodable`, `Decodable`, etc to be in scope, now it uses `ssz::Encodable`. --- eth2/types/src/attestation.rs | 4 ++-- eth2/types/src/attestation_data.rs | 4 ++-- eth2/types/src/attestation_data_and_custody_bit.rs | 4 ++-- eth2/types/src/attester_slashing.rs | 4 ++-- eth2/types/src/beacon_block.rs | 4 ++-- eth2/types/src/beacon_block_body.rs | 4 ++-- eth2/types/src/beacon_state.rs | 2 +- eth2/types/src/beacon_state/tests.rs | 2 +- eth2/types/src/casper_slashing.rs | 4 ++-- eth2/types/src/crosslink.rs | 4 ++-- eth2/types/src/deposit.rs | 4 ++-- eth2/types/src/deposit_data.rs | 4 ++-- eth2/types/src/deposit_input.rs | 4 ++-- eth2/types/src/eth1_data.rs | 4 ++-- eth2/types/src/eth1_data_vote.rs | 4 ++-- eth2/types/src/exit.rs | 4 ++-- eth2/types/src/fork.rs | 4 ++-- eth2/types/src/pending_attestation.rs | 4 ++-- eth2/types/src/proposal_signed_data.rs | 4 ++-- eth2/types/src/proposer_slashing.rs | 4 ++-- eth2/types/src/shard_reassignment_record.rs | 4 ++-- eth2/types/src/slashable_attestation.rs | 4 ++-- eth2/types/src/slashable_vote_data.rs | 4 ++-- eth2/types/src/validator_registry_delta_block.rs | 4 ++-- eth2/utils/ssz_derive/src/lib.rs | 10 +++++----- 25 files changed, 51 insertions(+), 51 deletions(-) diff --git a/eth2/types/src/attestation.rs b/eth2/types/src/attestation.rs index 1b19e59cb..7388a8e49 100644 --- a/eth2/types/src/attestation.rs +++ b/eth2/types/src/attestation.rs @@ -2,7 +2,7 @@ use super::{AggregatePublicKey, AggregateSignature, AttestationData, Bitfield, H use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, Clone, PartialEq, Serialize, Encode, Decode)] @@ -60,7 +60,7 @@ impl TestRandom for Attestation { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/attestation_data.rs b/eth2/types/src/attestation_data.rs index a99d50f58..7edb0b72b 100644 --- a/eth2/types/src/attestation_data.rs +++ b/eth2/types/src/attestation_data.rs @@ -2,7 +2,7 @@ use crate::test_utils::TestRandom; use crate::{AttestationDataAndCustodyBit, Crosslink, Epoch, Hash256, Slot}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; pub const SSZ_ATTESTION_DATA_LENGTH: usize = { @@ -78,7 +78,7 @@ impl TestRandom for AttestationData { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/attestation_data_and_custody_bit.rs b/eth2/types/src/attestation_data_and_custody_bit.rs index afc9499d0..3f107be82 100644 --- a/eth2/types/src/attestation_data_and_custody_bit.rs +++ b/eth2/types/src/attestation_data_and_custody_bit.rs @@ -2,7 +2,7 @@ use super::AttestationData; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::TreeHash; use ssz_derive::{Decode, Encode}; #[derive(Debug, Clone, PartialEq, Default, Serialize, Encode, Decode)] @@ -35,7 +35,7 @@ impl TestRandom for AttestationDataAndCustodyBit { mod test { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/attester_slashing.rs b/eth2/types/src/attester_slashing.rs index d6578c917..f84998324 100644 --- a/eth2/types/src/attester_slashing.rs +++ b/eth2/types/src/attester_slashing.rs @@ -1,7 +1,7 @@ use crate::{test_utils::TestRandom, SlashableAttestation}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -32,7 +32,7 @@ impl TestRandom for AttesterSlashing { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/beacon_block.rs b/eth2/types/src/beacon_block.rs index 08c7841d8..c252d03f7 100644 --- a/eth2/types/src/beacon_block.rs +++ b/eth2/types/src/beacon_block.rs @@ -3,7 +3,7 @@ use crate::{BeaconBlockBody, ChainSpec, Eth1Data, Hash256, ProposalSignedData, S use bls::Signature; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -92,7 +92,7 @@ impl TestRandom for BeaconBlock { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/beacon_block_body.rs b/eth2/types/src/beacon_block_body.rs index ffb2ea9d3..e051f5940 100644 --- a/eth2/types/src/beacon_block_body.rs +++ b/eth2/types/src/beacon_block_body.rs @@ -2,7 +2,7 @@ use super::{Attestation, AttesterSlashing, Deposit, Exit, ProposerSlashing}; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Default, Serialize, Encode, Decode)] @@ -42,7 +42,7 @@ impl TestRandom for BeaconBlockBody { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/beacon_state.rs b/eth2/types/src/beacon_state.rs index 85aaabf24..21deb6fe7 100644 --- a/eth2/types/src/beacon_state.rs +++ b/eth2/types/src/beacon_state.rs @@ -9,7 +9,7 @@ use honey_badger_split::SplitExt; use log::trace; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; use swap_or_not_shuffle::get_permutated_index; diff --git a/eth2/types/src/beacon_state/tests.rs b/eth2/types/src/beacon_state/tests.rs index 2b7c5b539..7e25d4dba 100644 --- a/eth2/types/src/beacon_state/tests.rs +++ b/eth2/types/src/beacon_state/tests.rs @@ -7,7 +7,7 @@ use crate::{ Eth1Data, Hash256, Keypair, }; use bls::create_proof_of_possession; -use ssz::ssz_encode; +use ssz::{ssz_encode, Decodable}; struct BeaconStateTestBuilder { pub genesis_time: u64, diff --git a/eth2/types/src/casper_slashing.rs b/eth2/types/src/casper_slashing.rs index 27fce54a9..6346db65c 100644 --- a/eth2/types/src/casper_slashing.rs +++ b/eth2/types/src/casper_slashing.rs @@ -2,7 +2,7 @@ use super::SlashableVoteData; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -33,7 +33,7 @@ impl TestRandom for CasperSlashing { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/crosslink.rs b/eth2/types/src/crosslink.rs index a1d467083..19c71f604 100644 --- a/eth2/types/src/crosslink.rs +++ b/eth2/types/src/crosslink.rs @@ -2,7 +2,7 @@ use crate::test_utils::TestRandom; use crate::{Epoch, Hash256}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, Clone, PartialEq, Default, Serialize, Hash, Encode, Decode)] @@ -43,7 +43,7 @@ impl TestRandom for Crosslink { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/deposit.rs b/eth2/types/src/deposit.rs index eb54df6f3..78f43532a 100644 --- a/eth2/types/src/deposit.rs +++ b/eth2/types/src/deposit.rs @@ -2,7 +2,7 @@ use super::{DepositData, Hash256}; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -36,7 +36,7 @@ impl TestRandom for Deposit { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/deposit_data.rs b/eth2/types/src/deposit_data.rs index f22a1cf1a..8f49deb3c 100644 --- a/eth2/types/src/deposit_data.rs +++ b/eth2/types/src/deposit_data.rs @@ -2,7 +2,7 @@ use super::DepositInput; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -36,7 +36,7 @@ impl TestRandom for DepositData { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/deposit_input.rs b/eth2/types/src/deposit_input.rs index a8299c455..7556fc2ca 100644 --- a/eth2/types/src/deposit_input.rs +++ b/eth2/types/src/deposit_input.rs @@ -3,7 +3,7 @@ use crate::test_utils::TestRandom; use bls::{PublicKey, Signature}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -37,7 +37,7 @@ impl TestRandom for DepositInput { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/eth1_data.rs b/eth2/types/src/eth1_data.rs index c88627548..b0dc14e7a 100644 --- a/eth2/types/src/eth1_data.rs +++ b/eth2/types/src/eth1_data.rs @@ -2,7 +2,7 @@ use super::Hash256; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; // Note: this is refer to as DepositRootVote in specs @@ -34,7 +34,7 @@ impl TestRandom for Eth1Data { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/eth1_data_vote.rs b/eth2/types/src/eth1_data_vote.rs index ee891523b..eda6e6a6a 100644 --- a/eth2/types/src/eth1_data_vote.rs +++ b/eth2/types/src/eth1_data_vote.rs @@ -2,7 +2,7 @@ use super::Eth1Data; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; // Note: this is refer to as DepositRootVote in specs @@ -34,7 +34,7 @@ impl TestRandom for Eth1DataVote { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/exit.rs b/eth2/types/src/exit.rs index 1379497ae..18d743b83 100644 --- a/eth2/types/src/exit.rs +++ b/eth2/types/src/exit.rs @@ -2,7 +2,7 @@ use crate::{test_utils::TestRandom, Epoch}; use bls::Signature; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -36,7 +36,7 @@ impl TestRandom for Exit { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/fork.rs b/eth2/types/src/fork.rs index 5c1fa6fb0..85d530e19 100644 --- a/eth2/types/src/fork.rs +++ b/eth2/types/src/fork.rs @@ -1,7 +1,7 @@ use crate::{test_utils::TestRandom, Epoch}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, Clone, PartialEq, Default, Serialize, Encode, Decode)] @@ -35,7 +35,7 @@ impl TestRandom for Fork { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/pending_attestation.rs b/eth2/types/src/pending_attestation.rs index c3d6023c4..42f990210 100644 --- a/eth2/types/src/pending_attestation.rs +++ b/eth2/types/src/pending_attestation.rs @@ -2,7 +2,7 @@ use crate::test_utils::TestRandom; use crate::{AttestationData, Bitfield, Slot}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, Clone, PartialEq, Serialize, Encode, Decode)] @@ -39,7 +39,7 @@ impl TestRandom for PendingAttestation { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/proposal_signed_data.rs b/eth2/types/src/proposal_signed_data.rs index b544c807b..63c0f1ce6 100644 --- a/eth2/types/src/proposal_signed_data.rs +++ b/eth2/types/src/proposal_signed_data.rs @@ -2,7 +2,7 @@ use crate::test_utils::TestRandom; use crate::{Hash256, Slot}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Default, Serialize, Encode, Decode)] @@ -36,7 +36,7 @@ impl TestRandom for ProposalSignedData { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/proposer_slashing.rs b/eth2/types/src/proposer_slashing.rs index 1b1620df8..b3a819a7f 100644 --- a/eth2/types/src/proposer_slashing.rs +++ b/eth2/types/src/proposer_slashing.rs @@ -3,7 +3,7 @@ use crate::test_utils::TestRandom; use bls::Signature; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -43,7 +43,7 @@ impl TestRandom for ProposerSlashing { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/shard_reassignment_record.rs b/eth2/types/src/shard_reassignment_record.rs index 0a4650e6e..511fe13ca 100644 --- a/eth2/types/src/shard_reassignment_record.rs +++ b/eth2/types/src/shard_reassignment_record.rs @@ -1,7 +1,7 @@ use crate::{test_utils::TestRandom, Slot}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -35,7 +35,7 @@ impl TestRandom for ShardReassignmentRecord { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/slashable_attestation.rs b/eth2/types/src/slashable_attestation.rs index 2ae625c23..676954ec2 100644 --- a/eth2/types/src/slashable_attestation.rs +++ b/eth2/types/src/slashable_attestation.rs @@ -1,7 +1,7 @@ use crate::{test_utils::TestRandom, AggregateSignature, AttestationData, Bitfield}; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -38,7 +38,7 @@ impl TestRandom for SlashableAttestation { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/types/src/slashable_vote_data.rs b/eth2/types/src/slashable_vote_data.rs index ba7b9ae92..bdd1d0619 100644 --- a/eth2/types/src/slashable_vote_data.rs +++ b/eth2/types/src/slashable_vote_data.rs @@ -4,7 +4,7 @@ use crate::test_utils::TestRandom; use bls::AggregateSignature; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; #[derive(Debug, PartialEq, Clone, Serialize, Encode, Decode)] @@ -64,7 +64,7 @@ mod tests { use crate::chain_spec::ChainSpec; use crate::slot_epoch::{Epoch, Slot}; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_is_double_vote_true() { diff --git a/eth2/types/src/validator_registry_delta_block.rs b/eth2/types/src/validator_registry_delta_block.rs index f171880b0..14f9c6ce5 100644 --- a/eth2/types/src/validator_registry_delta_block.rs +++ b/eth2/types/src/validator_registry_delta_block.rs @@ -2,7 +2,7 @@ use crate::{test_utils::TestRandom, Hash256, Slot}; use bls::PublicKey; use rand::RngCore; use serde_derive::Serialize; -use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; +use ssz::{hash, TreeHash}; use ssz_derive::{Decode, Encode}; // The information gathered from the PoW chain validator registration function. @@ -56,7 +56,7 @@ impl TestRandom for ValidatorRegistryDeltaBlock { mod tests { use super::*; use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use ssz::ssz_encode; + use ssz::{ssz_encode, Decodable}; #[test] pub fn test_ssz_round_trip() { diff --git a/eth2/utils/ssz_derive/src/lib.rs b/eth2/utils/ssz_derive/src/lib.rs index 41c47a496..dbf7638f2 100644 --- a/eth2/utils/ssz_derive/src/lib.rs +++ b/eth2/utils/ssz_derive/src/lib.rs @@ -11,7 +11,7 @@ //! //! Example: //! ``` -//! use ssz::{ssz_encode, Decodable, Encodable, SszStream, DecodeError}; +//! use ssz::{ssz_encode, Decodable}; //! use ssz_derive::{Encode, Decode}; //! //! #[derive(Encode, Decode)] @@ -68,8 +68,8 @@ pub fn ssz_encode_derive(input: TokenStream) -> TokenStream { let field_idents = get_named_field_idents(&struct_data); let output = quote! { - impl Encodable for #name { - fn ssz_append(&self, s: &mut SszStream) { + impl ssz::Encodable for #name { + fn ssz_append(&self, s: &mut ssz::SszStream) { #( s.append(&self.#field_idents); )* @@ -103,8 +103,8 @@ pub fn ssz_decode_derive(input: TokenStream) -> TokenStream { let field_idents_b = &field_idents; let output = quote! { - impl Decodable for #name { - fn ssz_decode(bytes: &[u8], i: usize) -> Result<(Self, usize), DecodeError> { + impl ssz::Decodable for #name { + fn ssz_decode(bytes: &[u8], i: usize) -> Result<(Self, usize), ssz::DecodeError> { #( let (#field_idents_a, i) = <_>::ssz_decode(bytes, i)?; )*