mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Implement null weight trader (#2957)
This commit is contained in:
@@ -25,6 +25,7 @@ use super::{MultiLocation, Xcm};
|
|||||||
pub enum Error {
|
pub enum Error {
|
||||||
Undefined,
|
Undefined,
|
||||||
Overflow,
|
Overflow,
|
||||||
|
/// The operation is intentionally unsupported.
|
||||||
Unimplemented,
|
Unimplemented,
|
||||||
UnhandledXcmVersion,
|
UnhandledXcmVersion,
|
||||||
UnhandledXcmMessage,
|
UnhandledXcmMessage,
|
||||||
|
|||||||
@@ -61,3 +61,10 @@ pub trait WeightTrader: Sized {
|
|||||||
/// Default implementation refunds nothing.
|
/// Default implementation refunds nothing.
|
||||||
fn refund_weight(&mut self, _weight: Weight) -> MultiAsset { MultiAsset::None }
|
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