Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofdeepanshu committed Sep 11, 2023
1 parent c3383af commit a737b87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion precompiles/xcm/XCM_v2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface XCM {
address payment_asset_id,
uint256 payment_amount,
bytes calldata call,
WeightV2 transact_weight
WeightV2 memory transact_weight
) external returns (bool);

/**
Expand Down
14 changes: 8 additions & 6 deletions precompiles/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ where

let fee_asset_item: u32 = input.read::<U256>()?.low_u32();

log::trace!(target: "xcm-precompile::asset_withdraw", "Raw arguments: assets: {:?}, asset_amount: {:?} \
beneficiart: {:?}, destination: {:?}, fee_index: {}",
assets, amounts_raw, beneficiary, dest, fee_asset_item);

if fee_asset_item as usize > assets.len() {
return Err(revert("Bad fee index."));
}
Expand All @@ -502,6 +498,11 @@ where
handle.context().caller,
))
.into();

log::trace!(target: "xcm-precompile::asset_withdraw", "Raw arguments: assets: {:?}, asset_amount: {:?} \
beneficiary: {:?}, destination: {:?}, fee_index: {}",
assets, amounts_raw, beneficiary, dest, fee_asset_item);

let call = pallet_xcm::Call::<Runtime>::reserve_withdraw_assets {
dest: Box::new(dest.into()),
beneficiary: Box::new(beneficiary.into()),
Expand Down Expand Up @@ -617,8 +618,6 @@ where
}
let amounts: Vec<u128> = amounts_raw.iter().map(|x| x.low_u128()).collect();

log::trace!(target: "xcm-precompile:assets_reserve_transfer", "Processed arguments: assets {:?}, amounts: {:?}", assets, amounts);

// Check that assets list is valid:
// * all assets resolved to multi-location
// * all assets has corresponded amount
Expand Down Expand Up @@ -648,6 +647,9 @@ where
handle.context().caller,
))
.into();

log::trace!(target: "xcm-precompile:assets_reserve_transfer", "Processed arguments: assets {:?}, amounts: {:?}, beneficiary: {:?}, destination: {:?}, fee_index: {}", assets, amounts, beneficiary, dest, fee_asset_item);

let call = pallet_xcm::Call::<Runtime>::reserve_transfer_assets {
dest: Box::new(dest.into()),
beneficiary: Box::new(beneficiary.into()),
Expand Down
4 changes: 2 additions & 2 deletions runtime/astar/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use pallet_evm_precompile_sha3fips::Sha3FIPS256;
use pallet_evm_precompile_simple::{ECRecover, ECRecoverPublicKey, Identity, Ripemd160, Sha256};
use pallet_evm_precompile_sr25519::Sr25519Precompile;
use pallet_evm_precompile_substrate_ecdsa::SubstrateEcdsaPrecompile;
// use pallet_evm_precompile_xcm::XcmPrecompile;
use pallet_evm_precompile_xcm::XcmPrecompile;
use sp_core::H160;
use sp_std::fmt::Debug;
use sp_std::marker::PhantomData;
Expand Down Expand Up @@ -73,7 +73,7 @@ where
Erc20AssetsPrecompileSet<R>: PrecompileSet,
DappsStakingWrapper<R>: Precompile,
BatchPrecompile<R>: Precompile,
// XcmPrecompile<R, C>: Precompile,
XcmPrecompile<R, C>: Precompile,
Dispatch<R>: Precompile,
R: pallet_evm::Config
+ pallet_assets::Config
Expand Down

0 comments on commit a737b87

Please sign in to comment.