From 90a6d133e5a0b5f50f65d12fbfa1f0bcbc691fb8 Mon Sep 17 00:00:00 2001 From: lemunozm Date: Sun, 18 Aug 2024 16:55:05 +0200 Subject: [PATCH] remove default and fix IT --- libs/types/src/domain_address.rs | 6 ------ pallets/axelar-router/src/lib.rs | 6 ------ pallets/liquidity-pools-gateway/src/mock.rs | 2 +- runtime/integration-tests/src/cases/assets.rs | 6 +++--- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/libs/types/src/domain_address.rs b/libs/types/src/domain_address.rs index 8f400f57b8..42d369c174 100644 --- a/libs/types/src/domain_address.rs +++ b/libs/types/src/domain_address.rs @@ -78,12 +78,6 @@ impl TypeId for DomainAddress { const TYPE_ID: [u8; 4] = crate::ids::DOMAIN_ADDRESS_ID; } -impl Default for DomainAddress { - fn default() -> Self { - DomainAddress::Centrifuge(AccountId32::new([0; 32])) - } -} - impl From for Domain { fn from(x: DomainAddress) -> Self { match x { diff --git a/pallets/axelar-router/src/lib.rs b/pallets/axelar-router/src/lib.rs index 6d68016b01..5de9f1f892 100644 --- a/pallets/axelar-router/src/lib.rs +++ b/pallets/axelar-router/src/lib.rs @@ -62,12 +62,6 @@ pub enum AxelarId { Evm(EVMChainId), } -impl Default for AxelarId { - fn default() -> Self { - Self::Evm(1) - } -} - /// Configuration for outbound messages though axelar #[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen)] pub struct AxelarConfig { diff --git a/pallets/liquidity-pools-gateway/src/mock.rs b/pallets/liquidity-pools-gateway/src/mock.rs index 19d14d3c37..f410211acf 100644 --- a/pallets/liquidity-pools-gateway/src/mock.rs +++ b/pallets/liquidity-pools-gateway/src/mock.rs @@ -126,7 +126,7 @@ impl LPMessage for Message { } } -#[derive(Default, Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen, Hash)] +#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen, Hash)] pub struct RouterId(pub u32); pub struct TestRouterProvider; diff --git a/runtime/integration-tests/src/cases/assets.rs b/runtime/integration-tests/src/cases/assets.rs index 9ae8147d0e..6635caa759 100644 --- a/runtime/integration-tests/src/cases/assets.rs +++ b/runtime/integration-tests/src/cases/assets.rs @@ -1,5 +1,5 @@ use cfg_types::tokens::{default_metadata, CurrencyId}; -use frame_support::{assert_noop, assert_ok, dispatch::RawOrigin}; +use frame_support::{assert_err, assert_ok, dispatch::RawOrigin}; use sp_runtime::{DispatchError, DispatchError::BadOrigin}; use crate::{config::Runtime, env::Env, envs::runtime_env::RuntimeEnv, utils::orml_asset_registry}; @@ -21,7 +21,7 @@ fn authority_configured() { Some(CurrencyId::ForeignAsset(42)) )); - assert_noop!( + assert_err!( orml_asset_registry::Pallet::::register_asset( RawOrigin::Root.into(), default_metadata(), @@ -37,7 +37,7 @@ fn processor_configured() { let mut env = RuntimeEnv::::default(); env.parachain_state_mut(|| { - assert_noop!( + assert_err!( orml_asset_registry::Pallet::::register_asset( RawOrigin::Root.into(), default_metadata(),