diff --git a/pallets/axelar-router/src/lib.rs b/pallets/axelar-router/src/lib.rs index 495ee73fad..d18b96bd42 100644 --- a/pallets/axelar-router/src/lib.rs +++ b/pallets/axelar-router/src/lib.rs @@ -156,7 +156,7 @@ pub mod pallet { #[pallet::error] pub enum Error { /// Emit when the router configuration is not found. - RouterNotFound, + RouterConfigurationNotFound, /// Emit when the evm account code is not registered ContractCodeMismatch, @@ -222,7 +222,8 @@ pub mod pallet { .try_into() .map_err(|_| Error::::SourceChainTooLong)?; - let config = Configuration::::get(chain_name).ok_or(Error::::RouterNotFound)?; + let config = Configuration::::get(chain_name) + .ok_or(Error::::RouterConfigurationNotFound)?; ensure!( caller == config.liquidity_pools_contract_address, @@ -316,9 +317,10 @@ pub mod pallet { type Origin = DomainAddress; fn send(axelar_id: AxelarId, origin: Self::Origin, message: Vec) -> DispatchResult { - let chain_name = - ChainNameById::::get(axelar_id).ok_or(Error::::RouterNotFound)?; - let config = Configuration::::get(&chain_name).ok_or(Error::::RouterNotFound)?; + let chain_name = ChainNameById::::get(axelar_id) + .ok_or(Error::::RouterConfigurationNotFound)?; + let config = Configuration::::get(&chain_name) + .ok_or(Error::::RouterConfigurationNotFound)?; match config.domain { DomainConfig::Evm(evm_config) => { diff --git a/pallets/axelar-router/src/tests.rs b/pallets/axelar-router/src/tests.rs index 27af8c962f..376f2bd7ef 100644 --- a/pallets/axelar-router/src/tests.rs +++ b/pallets/axelar-router/src/tests.rs @@ -113,7 +113,7 @@ mod send { new_test_ext().execute_with(|| { assert_err!( Router::send(AxelarId::Evm(CHAIN_ID), SENDER, MESSAGE.to_vec()), - Error::::RouterNotFound, + Error::::RouterConfigurationNotFound, ); }); } @@ -167,7 +167,7 @@ mod receive { &SOURCE_ADDRESS.0, MESSAGE ), - Error::::RouterNotFound + Error::::RouterConfigurationNotFound ); }); } diff --git a/pallets/liquidity-pools-gateway/src/lib.rs b/pallets/liquidity-pools-gateway/src/lib.rs index 89f4b0d0da..f1b1c62336 100644 --- a/pallets/liquidity-pools-gateway/src/lib.rs +++ b/pallets/liquidity-pools-gateway/src/lib.rs @@ -179,7 +179,7 @@ pub mod pallet { UnknownInstance, /// Router not found. - RouterNotFound, + RouterConfigurationNotFound, /// Emitted when you call `start_batch_messages()` but that was already /// called. You should finalize the message with `end_batch_messages()` diff --git a/runtime/common/src/routing.rs b/runtime/common/src/routing.rs index 575526735b..9b9e345d3e 100644 --- a/runtime/common/src/routing.rs +++ b/runtime/common/src/routing.rs @@ -12,9 +12,11 @@ use sp_core::{H160, H256}; use sp_runtime::traits::{BlakeTwo256, Hash}; use sp_std::{marker::PhantomData, vec, vec::Vec}; -/// Identification of the router where the message is sent and received -/// RouterId is more specific than Domain, because RouterId also identify by -/// where the message is sent/received +/// Identification of the router where the messages are sent and received. +/// +/// NOTE: `RouterId` is more specific than `Domain`. `Domain` identifies the +/// source and destination of the message, but `RouterId` also identifies how +/// to reach them. #[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen)] pub enum RouterId { /// The message must be sent/received by EVM using Axelar diff --git a/runtime/integration-tests/src/cases/liquidity_pools_gateway_queue.rs b/runtime/integration-tests/src/cases/liquidity_pools_gateway_queue.rs index 41aac181eb..7034f18ecb 100644 --- a/runtime/integration-tests/src/cases/liquidity_pools_gateway_queue.rs +++ b/runtime/integration-tests/src/cases/liquidity_pools_gateway_queue.rs @@ -67,7 +67,7 @@ fn outbound() { pallet_liquidity_pools_gateway_queue::Event::::MessageExecutionFailure { nonce, message, - error: pallet_axelar_router::Error::::RouterNotFound.into(), + error: pallet_axelar_router::Error::::RouterConfigurationNotFound.into(), } });