Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Nov 17, 2023
1 parent 4d1aa25 commit 1085ad8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 36 deletions.
4 changes: 2 additions & 2 deletions modules/transaction-pause/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn paused_transaction_filter_work() {
assert_ok!(TransactionPause::pause_transaction(
RuntimeOrigin::signed(1),
b"Balances".to_vec(),
b"transfer".to_vec()
b"transfer_allow_death".to_vec()
));
assert_ok!(TransactionPause::pause_transaction(
RuntimeOrigin::signed(1),
Expand All @@ -142,7 +142,7 @@ fn paused_transaction_filter_work() {
assert_ok!(TransactionPause::unpause_transaction(
RuntimeOrigin::signed(1),
b"Balances".to_vec(),
b"transfer".to_vec()
b"transfer_allow_death".to_vec()
));
assert_ok!(TransactionPause::unpause_transaction(
RuntimeOrigin::signed(1),
Expand Down
22 changes: 0 additions & 22 deletions runtime/integration-tests/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,28 +319,6 @@ fn parachain_subaccounts_are_unique() {
});
}

#[test]
#[should_panic(expected = "Relay chain block number needs to strictly increase between Parachain blocks!")]
fn cumulus_check_relay_chain_block_number() {
ExtBuilder::default().build().execute_with(|| {
set_relaychain_block_number(10);
assert_eq!(ParachainSystem::validation_data().unwrap().relay_parent_number, 10);

// testnet skip checking relay chain block number
set_relaychain_block_number(9);
assert_eq!(ParachainSystem::validation_data().unwrap().relay_parent_number, 9);

// set mainnet ChainId
// only karura-mainnet and acala-mainnet check relay chain block number, use karura mainnet ChainId
// with mandala runtime
#[cfg(any(feature = "with-mandala-runtime", feature = "with-karura-runtime"))]
module_evm::ChainId::<Runtime>::set(CHAIN_ID_KARURA_MAINNET);
#[cfg(feature = "with-acala-runtime")]
module_evm::ChainId::<Runtime>::set(CHAIN_ID_ACALA_MAINNET);
set_relaychain_block_number(8);
});
}

#[cfg(feature = "with-mandala-runtime")]
mod mandala_only_tests {
use super::*;
Expand Down
23 changes: 13 additions & 10 deletions runtime/integration-tests/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,30 @@ pub use xcm::v3::prelude::*;
pub use mandala_imports::*;
#[cfg(feature = "with-mandala-runtime")]
mod mandala_imports {
pub use frame_support::traits::{Currency as PalletCurrency, Get};
pub use mandala_runtime::xcm_config::*;
use mandala_runtime::AlternativeFeeSurplus;
pub use mandala_runtime::{
create_x2_parachain_multilocation, get_all_module_accounts, AcalaOracle, AcalaSwap, AccountId, AggregatedDex,
AssetRegistry, AuctionManager, Aura, Authority, AuthoritysOriginId, Authorship, Balance, Balances, BlockNumber,
CDPEnginePalletId, CDPTreasuryPalletId, CdpEngine, CdpTreasury, CollatorSelection, CreateClassDeposit,
CreateTokenDeposit, Currencies, CurrencyId, DataDepositPerByte, DealWithFees, DefaultDebitExchangeRate,
DefaultExchangeRate, Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil, Get,
GetNativeCurrencyId, Homa, Honzon, IdleScheduler, Loans, MaxTipsOfPriority, MinRewardDistributeAmount,
MinimumDebitValue, MultiLocation, NativeTokenExistentialDeposit, NetworkId, NftPalletId, OneDay, OriginCaller,
PalletCurrency, ParachainInfo, ParachainSystem, Proxy, ProxyType, Ratio, Runtime, RuntimeCall, RuntimeEvent,
RuntimeOrigin, Scheduler, Session, SessionKeys, SessionManager, SevenDays, StableAsset, StableAssetPalletId,
System, Timestamp, TipPerWeightStep, TokenSymbol, Tokens, TransactionPayment, TransactionPaymentPalletId,
TreasuryAccount, TreasuryPalletId, UncheckedExtrinsic, Utility, Vesting, XcmInterface, EVM, NFT,
DefaultExchangeRate, Dex, EmergencyShutdown, EvmAccounts, ExistentialDeposits, FinancialCouncil,
GetNativeCurrencyId, Homa, Honzon, IdleScheduler, Loans, MinRewardDistributeAmount, MinimumDebitValue,
NativeTokenExistentialDeposit, NftPalletId, OneDay, OriginCaller, ParachainInfo, ParachainSystem, Proxy,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, Session, SessionKeys, SessionManager, SevenDays,
StableAsset, StableAssetPalletId, System, Timestamp, TokenSymbol, Tokens, TransactionPayment,
TransactionPaymentPalletId, TreasuryAccount, TreasuryPalletId, UncheckedExtrinsic, Utility, Vesting,
XcmInterface, EVM, NFT,
};
use module_transaction_payment::BuyWeightRateOfTransactionFeePool;
pub use primitives::TradingPair;
pub use runtime_common::{cent, dollar, millicent, FixedRateOfAsset, ACA, AUSD, DOT, LDOT};
pub use runtime_common::{
cent, dollar, millicent, FixedRateOfAsset, MaxTipsOfPriority, ProxyType, Ratio, TipPerWeightStep, ACA, AUSD,
DOT, LDOT,
};
pub use sp_runtime::traits::AccountIdConversion;
use sp_runtime::Percent;
pub use xcm::v3::Weight as XcmWeight;
pub use xcm::v3::{prelude::*, Weight as XcmWeight};
pub use xcm_executor::XcmExecutor;

parameter_types! {
Expand Down
3 changes: 1 addition & 2 deletions runtime/integration-tests/src/vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ fn test_vesting_use_relaychain_block_number() {
#[cfg(feature = "with-acala-runtime")]
let signer: AccountId = AcalaFoundationAccounts::get()[0].clone();

assert_ok!(Balances::set_balance_deprecated(
assert_ok!(Balances::force_set_balance(
RuntimeOrigin::root(),
signer.clone().into(),
1_000 * dollar(ACA),
0
));

assert_ok!(Vesting::vested_transfer(
Expand Down

0 comments on commit 1085ad8

Please sign in to comment.