-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runtime change required for bridge to work (#734)
* runtime change required for bridge to work * fix the name of test
- Loading branch information
1 parent
29d2321
commit 74479db
Showing
14 changed files
with
177 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
solo-chains/runtime/dancelight/src/tests/migrations_test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (C) Moondance Labs Ltd. | ||
// This file is part of Tanssi. | ||
|
||
// Tanssi is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Tanssi is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Tanssi. If not, see <http://www.gnu.org/licenses/> | ||
|
||
use crate::tests::common::ExtBuilder; | ||
use crate::{BeefyMmrLeaf, PalletInfo, Runtime}; | ||
use beefy_primitives::mmr::BeefyAuthoritySet; | ||
use frame_support::storage::unhashed; | ||
use frame_support::traits::PalletInfo as _; | ||
use pallet_migrations::Migration; | ||
use tanssi_runtime_common::migrations::MigrateMMRLeafPallet; | ||
use xcm::v3::Weight; | ||
|
||
#[test] | ||
fn test_migration_mmr_leaf_pallet_renaming() { | ||
ExtBuilder::default().build().execute_with(|| { | ||
let migrate_mmr_leaf_pallet = MigrateMMRLeafPallet::<Runtime>(Default::default()); | ||
let old_pallet_name = MigrateMMRLeafPallet::<Runtime>::old_pallet_name(); | ||
let old_storage_1 = frame_support::storage::storage_prefix( | ||
old_pallet_name.as_bytes(), | ||
b"example_storage_1", | ||
); | ||
let new_storage_1 = frame_support::storage::storage_prefix( | ||
PalletInfo::name::<BeefyMmrLeaf>() | ||
.expect("BeefyMMRLeaf pallet must be part of the runtime") | ||
.as_bytes(), | ||
b"example_storage_1", | ||
); | ||
unhashed::put(&old_storage_1, &1u64); | ||
|
||
let beefy_authority_set: BeefyAuthoritySet<()> = BeefyAuthoritySet { | ||
len: 5, | ||
..Default::default() | ||
}; | ||
let old_storage_2 = frame_support::storage::storage_prefix( | ||
old_pallet_name.as_bytes(), | ||
b"example_storage_2", | ||
); | ||
let new_storage_2 = frame_support::storage::storage_prefix( | ||
PalletInfo::name::<BeefyMmrLeaf>() | ||
.expect("BeefyMMRLeaf pallet must be part of the runtime") | ||
.as_bytes(), | ||
b"example_storage_2", | ||
); | ||
unhashed::put(&old_storage_2, &beefy_authority_set); | ||
|
||
let used_weight = migrate_mmr_leaf_pallet.migrate(Weight::MAX); | ||
assert_eq!(used_weight, Weight::MAX); | ||
|
||
assert_eq!(unhashed::get::<u64>(&old_storage_1), None); | ||
assert_eq!(unhashed::get::<BeefyAuthoritySet<()>>(&old_storage_2), None); | ||
|
||
assert_eq!(unhashed::get::<u64>(&new_storage_1), Some(1u64)); | ||
assert_eq!( | ||
unhashed::get::<BeefyAuthoritySet<()>>(&new_storage_2), | ||
Some(BeefyAuthoritySet { | ||
len: 5, | ||
..Default::default() | ||
}) | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
typescript-api/src/dancelight/interfaces/augment-api-query.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.