-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate new xcm-emulator #1324
Merged
sea212
merged 13 commits into
sea212-update-dependencies-v1.1.0
from
sea212-update-dependencies-part-5
Apr 29, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
92a1a45
Update runtime (#1323)
sea212 4b57af7
WIP Integrate new xcm-emulator environment
sea212 9787eda
Utilize new xcm-emulator interfaces
sea212 a2b7158
Spawn relay-para network using patched xcm-emulator
sea212 d4a7a79
Use proper collator genesis config
sea212 0ecf8e8
Fix Rococo tests
sea212 81cc031
Fix all XCM tests on Battery Station
sea212 60e9775
Format code
sea212 70f5052
Finalize Battery Station XCM tests
sea212 7ae1786
Update license
sea212 5698873
Finalize Zeitgeist XCM tests
sea212 6fa6cc2
Update license
sea212 b864110
Merge branch 'sea212-update-dependencies-v1.1.0' into sea212-update-d…
sea212 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
79 changes: 79 additions & 0 deletions
79
runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.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,79 @@ | ||
// Copyright 2024 Forecasting Technologies LTD. | ||
// | ||
// This file is part of Zeitgeist. | ||
// | ||
// Zeitgeist 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. | ||
// | ||
// Zeitgeist 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 Zeitgeist. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
use crate::{ | ||
integration_tests::xcm::setup::{ | ||
accounts, ztg, BTC_ID, FOREIGN_PARENT_ID, FOREIGN_SIBLING_ID, FOREIGN_ZTG_ID, | ||
}, | ||
parachain_params::MinCandidateStk, | ||
parameters::ZeitgeistTreasuryAccount, | ||
Asset, | ||
}; | ||
use nimbus_primitives::NimbusId; | ||
use sp_core::storage::Storage; | ||
use sp_runtime::BuildStorage; | ||
|
||
const ENDOWMENT: u128 = ztg(1_000_000); | ||
const SAFE_XCM_VERSION: u32 = 2; | ||
|
||
pub(crate) fn genesis(parachain_id: u32) -> Storage { | ||
let genesis_config = crate::RuntimeGenesisConfig { | ||
author_mapping: crate::AuthorMappingConfig { | ||
mappings: vec![( | ||
accounts::get_from_seed::<NimbusId>(accounts::ALICE), | ||
accounts::alice(), | ||
)], | ||
}, | ||
balances: crate::BalancesConfig { | ||
balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), | ||
}, | ||
parachain_info: crate::ParachainInfoConfig { | ||
parachain_id: parachain_id.into(), | ||
..Default::default() | ||
}, | ||
parachain_staking: crate::ParachainStakingConfig { | ||
candidates: vec![(accounts::alice(), MinCandidateStk::get())], | ||
..Default::default() | ||
}, | ||
polkadot_xcm: crate::PolkadotXcmConfig { | ||
safe_xcm_version: Some(SAFE_XCM_VERSION), | ||
..Default::default() | ||
}, | ||
system: crate::SystemConfig { | ||
code: crate::WASM_BINARY.unwrap().to_vec(), | ||
..Default::default() | ||
}, | ||
tokens: crate::TokensConfig { | ||
balances: accounts::init_balances() | ||
.iter() | ||
.chain(vec![(ZeitgeistTreasuryAccount::get())].iter()) | ||
.map(|k| { | ||
vec![ | ||
(k.clone(), Asset::from(FOREIGN_PARENT_ID).try_into().unwrap(), ENDOWMENT), | ||
(k.clone(), Asset::from(FOREIGN_SIBLING_ID).try_into().unwrap(), ENDOWMENT), | ||
(k.clone(), Asset::from(FOREIGN_ZTG_ID).try_into().unwrap(), ENDOWMENT), | ||
(k.clone(), Asset::from(BTC_ID).try_into().unwrap(), ENDOWMENT), | ||
] | ||
}) | ||
.flatten() | ||
.collect::<Vec<_>>(), | ||
}, | ||
..Default::default() | ||
}; | ||
|
||
genesis_config.build_storage().unwrap() | ||
} |
19 changes: 19 additions & 0 deletions
19
runtime/battery-station/src/integration_tests/xcm/genesis/mod.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,19 @@ | ||
// Copyright 2024 Forecasting Technologies LTD. | ||
// | ||
// This file is part of Zeitgeist. | ||
// | ||
// Zeitgeist 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. | ||
// | ||
// Zeitgeist 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 Zeitgeist. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
pub(super) mod battery_station; | ||
pub(super) mod rococo; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this comment mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's missing the commit hash of the changes. The comments should indicate what the patch is for and which commits deviate from the original repository.