Unverified Commit 9d73c530 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Implement null weight trader (#2957)

parent ed71f321
Pipeline #136264 passed with stages
in 35 minutes and 54 seconds
......@@ -25,6 +25,7 @@ use super::{MultiLocation, Xcm};
pub enum Error {
Undefined,
Overflow,
/// The operation is intentionally unsupported.
Unimplemented,
UnhandledXcmVersion,
UnhandledXcmMessage,
......
......@@ -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<Assets, Error> {
Err(Error::Unimplemented)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment