Skip to content

Commit

Permalink
Salp Revamp companion for dmp transfer (#191)
Browse files Browse the repository at this point in the history
* Salp Revamp companion for dmp transfer

* Fix check
  • Loading branch information
yrong authored Jul 26, 2021
1 parent d600485 commit ac814e8
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 80 deletions.
2 changes: 2 additions & 0 deletions node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ mod bridge;
mod currency;
mod tests;
pub mod traits;
mod xcm;

pub use crate::{
bridge::*,
currency::{CurrencyId, TokenSymbol},
traits::*,
xcm::*,
};

/// An index to a block.
Expand Down
42 changes: 42 additions & 0 deletions node/primitives/src/xcm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// This file is part of Bifrost.

// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use codec::{Decode, Encode};
use sp_std::prelude::*;

/// The type used to represent the xcmp transfer direction
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
pub enum TransferOriginType {
FromSelf = 0,
FromRelayChain = 1,
FromSiblingParaChain = 2,
}

pub struct XcmBaseWeight(u64);

impl From<u64> for XcmBaseWeight {
fn from(u: u64) -> Self {
XcmBaseWeight(u)
}
}

impl From<XcmBaseWeight> for u64 {
fn from(x: XcmBaseWeight) -> Self {
x.0.into()
}
}
Loading

0 comments on commit ac814e8

Please sign in to comment.