diff --git a/polkadot/xcm/src/v0/traits.rs b/polkadot/xcm/src/v0/traits.rs index 8734bb6c7f..f0df7db03e 100644 --- a/polkadot/xcm/src/v0/traits.rs +++ b/polkadot/xcm/src/v0/traits.rs @@ -25,6 +25,7 @@ use super::{MultiLocation, Xcm}; pub enum Error { Undefined, Overflow, + /// The operation is intentionally unsupported. Unimplemented, UnhandledXcmVersion, UnhandledXcmMessage, diff --git a/polkadot/xcm/xcm-executor/src/traits/weight.rs b/polkadot/xcm/xcm-executor/src/traits/weight.rs index 1d6d5eeec4..5fd8963090 100644 --- a/polkadot/xcm/xcm-executor/src/traits/weight.rs +++ b/polkadot/xcm/xcm-executor/src/traits/weight.rs @@ -61,3 +61,10 @@ pub trait WeightTrader: Sized { /// Default implementation refunds nothing. fn refund_weight(&mut self, _weight: Weight) -> MultiAsset { MultiAsset::None } } + +impl WeightTrader for () { + fn new() -> Self { () } + fn buy_weight(&mut self, _: Weight, _: Assets) -> Result { + Err(Error::Unimplemented) + } +}