Skip to content

Commit

Permalink
refactored error name
Browse files Browse the repository at this point in the history
  • Loading branch information
x3c41a committed Oct 16, 2024
1 parent 151745b commit bcbd187
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions polkadot/xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use xcm_executor::{
use xcm_runtime_apis::{
dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
fees::Error as XcmPaymentApiError,
trusted_query::Error as TrustQueryApiError,
trusted_query::Error as TrustedQueryApiError,
};

#[cfg(any(feature = "try-runtime", test))]
Expand Down Expand Up @@ -2609,14 +2609,14 @@ impl<T: Config> Pallet<T> {
pub fn is_trusted_reserve(
asset: VersionedAsset,
location: VersionedLocation,
) -> Result<bool, TrustQueryApiError> {
) -> Result<bool, TrustedQueryApiError> {
let location: Location = location.try_into().map_err(|e| {
tracing::debug!(
target: "xcm::pallet_xcm::is_trusted_reserve",
"Asset version conversion failed with error: {:?}",
e,
);
TrustQueryApiError::VersionedLocationConversionFailed
TrustedQueryApiError::VersionedLocationConversionFailed
})?;

let a: Asset = asset.try_into().map_err(|e| {
Expand All @@ -2625,7 +2625,7 @@ impl<T: Config> Pallet<T> {
"Location version conversion failed with error: {:?}",
e,
);
TrustQueryApiError::VersionedAssetConversionFailed
TrustedQueryApiError::VersionedAssetConversionFailed
})?;

Ok(<T::XcmExecutor as XcmAssetTransfers>::IsReserve::contains(&a, &location))
Expand All @@ -2635,22 +2635,22 @@ impl<T: Config> Pallet<T> {
pub fn is_trusted_teleporter(
asset: VersionedAsset,
location: VersionedLocation,
) -> Result<bool, TrustQueryApiError> {
) -> Result<bool, TrustedQueryApiError> {
let location: Location = location.try_into().map_err(|e| {
tracing::debug!(
target: "xcm::pallet_xcm::is_trusted_teleporter",
"Asset version conversion failed with error: {:?}",
e,
);
TrustQueryApiError::VersionedLocationConversionFailed
TrustedQueryApiError::VersionedLocationConversionFailed
})?;
let a: Asset = asset.try_into().map_err(|e| {
tracing::debug!(
target: "xcm::pallet_xcm::is_trusted_teleporter",
"Location version conversion failed with error: {:?}",
e,
);
TrustQueryApiError::VersionedAssetConversionFailed
TrustedQueryApiError::VersionedAssetConversionFailed
})?;
Ok(<T::XcmExecutor as XcmAssetTransfers>::IsTeleporter::contains(&a, &location))
}
Expand Down

0 comments on commit bcbd187

Please sign in to comment.