mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Implement null weight trader (#2957)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user