-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Integrate new xcm-emulator environment * Utilize new xcm-emulator interfaces * Spawn relay-para network using patched xcm-emulator * Use proper collator genesis config * Fix Rococo tests * Finalize Battery Station XCM tests * Finalize Zeitgeist XCM tests
- Loading branch information
Showing
24 changed files
with
1,239 additions
and
817 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
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.