remove hardcoded crate versions from tests (#12950)

This commit is contained in:
João Paulo Silva de Souza
2022-12-20 16:56:27 -03:00
committed by GitHub
parent 548955a73f
commit 8d95737f41
2 changed files with 35 additions and 53 deletions
@@ -619,44 +619,29 @@ fn storage_expand() {
#[test]
fn pallet_metadata_expands() {
use frame_support::traits::{CrateVersion, PalletInfoData, PalletsInfoAccess};
use frame_support::traits::PalletsInfoAccess;
let mut infos = AllPalletsWithSystem::infos();
infos.sort_by_key(|x| x.index);
assert_eq!(
infos,
vec![
PalletInfoData {
index: 0,
name: "System",
module_name: "frame_system",
crate_version: CrateVersion { major: 4, minor: 0, patch: 0 },
},
PalletInfoData {
index: 1,
name: "Example",
module_name: "pallet",
crate_version: CrateVersion { major: 3, minor: 0, patch: 0 },
},
PalletInfoData {
index: 2,
name: "Instance1Example",
module_name: "pallet",
crate_version: CrateVersion { major: 3, minor: 0, patch: 0 },
},
PalletInfoData {
index: 3,
name: "Example2",
module_name: "pallet2",
crate_version: CrateVersion { major: 3, minor: 0, patch: 0 },
},
PalletInfoData {
index: 4,
name: "Instance1Example2",
module_name: "pallet2",
crate_version: CrateVersion { major: 3, minor: 0, patch: 0 },
},
]
);
assert_eq!(infos[0].index, 0);
assert_eq!(infos[0].name, "System");
assert_eq!(infos[0].module_name, "frame_system");
assert_eq!(infos[1].index, 1);
assert_eq!(infos[1].name, "Example");
assert_eq!(infos[1].module_name, "pallet");
assert_eq!(infos[2].index, 2);
assert_eq!(infos[2].name, "Instance1Example");
assert_eq!(infos[2].module_name, "pallet");
assert_eq!(infos[3].index, 3);
assert_eq!(infos[3].name, "Example2");
assert_eq!(infos[3].module_name, "pallet2");
assert_eq!(infos[4].index, 4);
assert_eq!(infos[4].name, "Instance1Example2");
assert_eq!(infos[4].module_name, "pallet2");
}
#[test]