From 3873c11be33e923a74c16c2e0ecf00861ffb64c5 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed Date: Fri, 19 Nov 2021 14:44:42 +0530 Subject: [PATCH] Add Default impl for ProofSpecs --- modules/src/core/ics23_commitment/specs.rs | 8 +++++++- relayer/src/config.rs | 8 +------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/src/core/ics23_commitment/specs.rs b/modules/src/core/ics23_commitment/specs.rs index 034bf56fe0..b818c8976a 100644 --- a/modules/src/core/ics23_commitment/specs.rs +++ b/modules/src/core/ics23_commitment/specs.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; /// Additionally, this type also aids in the conversion from `ProofSpec` types from crate `ics23` /// into proof specifications as represented in the `ibc_proto` type; see the /// `From` trait(s) below. -#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] pub struct ProofSpecs(Vec); impl ProofSpecs { @@ -24,6 +24,12 @@ impl ProofSpecs { } } +impl Default for ProofSpecs { + fn default() -> Self { + Self::cosmos() + } +} + /// Converts from the domain type (which is represented as a vector of `ics23::ProofSpec` /// to the corresponding proto type (vector of `ibc_proto::ProofSpec`). /// TODO: fix with diff --git a/relayer/src/config.rs b/relayer/src/config.rs index 4595b2087f..1882d3d0cb 100644 --- a/relayer/src/config.rs +++ b/relayer/src/config.rs @@ -411,15 +411,9 @@ pub struct ChainConfig { pub address_type: AddressType, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct ProofSpecsJson(ProofSpecs); -impl Default for ProofSpecsJson { - fn default() -> Self { - Self(ProofSpecs::cosmos()) - } -} - impl From for ProofSpecs { fn from(value: ProofSpecsJson) -> Self { value.0