Skip to content

Commit

Permalink
fmt and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofdeepanshu committed Oct 2, 2023
1 parent 338413b commit b007449
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion precompiles/xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ homepage.workspace = true
repository.workspace = true

[dependencies]
astar-primitives = { workspace = true }
log = { workspace = true }
num_enum = { workspace = true }
pallet-evm-precompile-assets-erc20 = { workspace = true }
pallet-xcm = { workspace = true }
precompile-utils = { workspace = true }
astar-primitives = { workspace = true }

# Substrate
frame-support = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion precompiles/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

#![cfg_attr(not(feature = "std"), no_std)]

use astar_primitives::xcm::constants::XCM_SIZE_LIMIT;
use fp_evm::{PrecompileHandle, PrecompileOutput};
use frame_support::{
dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo},
pallet_prelude::Weight,
traits::{ConstU32, Get},
};
use astar_primitives::xcm::constants::XCM_SIZE_LIMIT;
type GetXcmSizeLimit = ConstU32<XCM_SIZE_LIMIT>;

use pallet_evm::{AddressMapping, Precompile};
Expand Down
19 changes: 19 additions & 0 deletions primitives/src/xcm/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file is part of Astar.

// Copyright (C) 2019-2023 Stake Technologies Pte.Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later

// Astar 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.

// Astar 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 Astar. If not, see <http://www.gnu.org/licenses/>.

pub const XCM_SIZE_LIMIT: u32 = 2u32.pow(16);
4 changes: 2 additions & 2 deletions primitives/src/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
//! Please refer to implementation below for more info.
//!
#![cfg_attr(not(feature = "std"), no_std)]

use crate::AccountId;

use frame_support::{
Expand All @@ -54,6 +52,8 @@ use pallet_xc_asset_config::{ExecutionPaymentRate, XcAssetLocation};
#[cfg(test)]
mod tests;

pub mod constants;

/// Used to convert between cross-chain asset multilocation and local asset Id.
///
/// This implementation relies on `XcAssetConfig` pallet to handle mapping.
Expand Down

0 comments on commit b007449

Please sign in to comment.