mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Added Asset Conversion in Kusama (#2935)
* Changes for asset conversion in ksm * applied changes to forbid batch calls in xcm filters for ksm and wnd, fixed tests typing, cleaned up * updated weights for pallet_asset_conversion in ksm * updated swap_locally_on_chain_using_local_assets test * added more call filters, approval deposit fix * Update parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs * Update tests to be like master * set metadata needed for the test. * Update parachains/runtimes/assets/asset-hub-kusama/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update parachains/runtimes/assets/asset-hub-kusama/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * removed hardcoded existential_deposit in local swap test * storage to const We're not planning on setting this via an on chain vote so let's have it as a const. * unneeded tests * const * shorter line * missed one * remove unused import * Update parachains/runtimes/assets/asset-hub-kusama/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> --------- Co-authored-by: joepetrowski <joe@parity.io> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Giles Cope <gilescope@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -29,8 +29,8 @@ use asset_hub_westend_runtime::{
|
||||
AssetFeeAsExistentialDepositMultiplierFeeCharger, ForeignCreatorsSovereignAccountOf,
|
||||
WestendLocation,
|
||||
},
|
||||
AllPalletsWithoutSystem, LiquidityWithdrawalFee, MetadataDepositBase, MetadataDepositPerByte,
|
||||
RuntimeCall, RuntimeEvent,
|
||||
AllPalletsWithoutSystem, MetadataDepositBase, MetadataDepositPerByte, RuntimeCall,
|
||||
RuntimeEvent,
|
||||
};
|
||||
use asset_test_utils::{CollatorSessionKeys, ExtBuilder, XcmReceivedFrom};
|
||||
use codec::{Decode, DecodeLimit, Encode};
|
||||
@@ -41,10 +41,7 @@ use frame_support::{
|
||||
weights::{Weight, WeightToFee as WeightToFeeT},
|
||||
};
|
||||
use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance};
|
||||
use sp_runtime::{
|
||||
traits::{CheckedAdd, CheckedSub, MaybeEquivalence},
|
||||
Permill,
|
||||
};
|
||||
use sp_runtime::traits::MaybeEquivalence;
|
||||
use std::convert::Into;
|
||||
use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH};
|
||||
use xcm_executor::{
|
||||
@@ -667,39 +664,3 @@ fn plain_receive_teleported_asset_works() {
|
||||
assert_eq!(outcome.ensure_complete(), Ok(()));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn change_allow_multi_asset_pools_by_governance_works() {
|
||||
asset_test_utils::test_cases::change_storage_constant_by_governance_works::<
|
||||
Runtime,
|
||||
AllowMultiAssetPools,
|
||||
bool,
|
||||
>(
|
||||
collator_session_keys(),
|
||||
1000,
|
||||
Box::new(|call| RuntimeCall::System(call).encode()),
|
||||
|| (AllowMultiAssetPools::key().to_vec(), AllowMultiAssetPools::get()),
|
||||
|old_value| !old_value,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn change_liquidity_withdrawal_fee_by_governance_works() {
|
||||
asset_test_utils::test_cases::change_storage_constant_by_governance_works::<
|
||||
Runtime,
|
||||
LiquidityWithdrawalFee,
|
||||
Permill,
|
||||
>(
|
||||
collator_session_keys(),
|
||||
1000,
|
||||
Box::new(|call| RuntimeCall::System(call).encode()),
|
||||
|| (LiquidityWithdrawalFee::key().to_vec(), LiquidityWithdrawalFee::get()),
|
||||
|old_value| {
|
||||
if let Some(new_value) = old_value.checked_add(&Permill::from_percent(2)) {
|
||||
new_value
|
||||
} else {
|
||||
old_value.checked_sub(&Permill::from_percent(2)).unwrap()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user