chore: move whitelist test to better place and add missing Inactive Issuance (#14130)

* chore: move whitelist test to better palace and add missing `Inactive Issuance`

* remove duplicated

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
yjh
2023-05-18 06:26:33 +08:00
committed by GitHub
parent 0e49ed72aa
commit 99b05fd918
4 changed files with 38 additions and 76 deletions
+15 -2
View File
@@ -27,7 +27,7 @@ use frame_support::{
parameter_types,
traits::{
tokens::fungible, ConstU32, ConstU64, ConstU8, Imbalance as ImbalanceT, OnUnbalanced,
StorageMapShim, StoredMap,
StorageMapShim, StoredMap, WhitelistedStorageKeys,
},
weights::{IdentityFee, Weight},
RuntimeDebug,
@@ -35,13 +35,14 @@ use frame_support::{
use frame_system::{self as system, RawOrigin};
use pallet_transaction_payment::{ChargeTransactionPayment, CurrencyAdapter, Multiplier};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_core::{hexdisplay::HexDisplay, H256};
use sp_io;
use sp_runtime::{
testing::Header,
traits::{BadOrigin, IdentityLookup, SignedExtension, Zero},
ArithmeticError, DispatchError, DispatchResult, FixedPointNumber, TokenError,
};
use std::collections::BTreeSet;
mod currency_tests;
mod dispatchable_tests;
@@ -304,3 +305,15 @@ fn weights_sane() {
let info = crate::Call::<Test>::force_unreserve { who: 10, amount: 4 }.get_dispatch_info();
assert_eq!(<() as crate::WeightInfo>::force_unreserve(), info.weight);
}
#[test]
fn check_whitelist() {
let whitelist: BTreeSet<String> = AllPalletsWithSystem::whitelisted_storage_keys()
.iter()
.map(|s| HexDisplay::from(&s.key).to_string())
.collect();
// Inactive Issuance
assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f1ccde6872881f893a21de93dfe970cd5"));
// Total Issuance
assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80"));
}