@@ -20,6 +20,7 @@ use cumulus_primitives_core::ParaId;
20
20
use hex_literal:: hex;
21
21
use parachains_common:: { genesis_config_helpers:: * , AccountId , AuraId , Balance as AssetHubBalance } ;
22
22
use sp_core:: { crypto:: UncheckedInto , sr25519} ;
23
+ use sp_genesis_builder:: PresetId ;
23
24
use testnet_parachains_constants:: rococo:: xcm_version:: SAFE_XCM_VERSION ;
24
25
25
26
const ASSET_HUB_ROCOCO_ED : AssetHubBalance = crate :: ExistentialDeposit :: get ( ) ;
@@ -75,14 +76,14 @@ fn asset_hub_rococo_genesis(
75
76
}
76
77
77
78
/// Encapsulates names of predefined presets.
78
- pub mod preset_names {
79
+ mod preset_names {
79
80
pub const PRESET_DEVELOPMENT : & str = "development" ;
80
81
pub const PRESET_LOCAL : & str = "local" ;
81
82
pub const PRESET_GENESIS : & str = "genesis" ;
82
83
}
83
84
84
85
/// Provides the JSON representation of predefined genesis config for given `id`.
85
- pub fn get_preset ( id : & sp_genesis_builder :: PresetId ) -> Option < Vec < u8 > > {
86
+ pub fn get_preset ( id : & PresetId ) -> Option < Vec < u8 > > {
86
87
use preset_names:: * ;
87
88
let patch = match id. try_into ( ) {
88
89
Ok ( PRESET_GENESIS ) => asset_hub_rococo_genesis (
@@ -170,3 +171,13 @@ pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option<Vec<u8>> {
170
171
. into_bytes ( ) ,
171
172
)
172
173
}
174
+
175
+ /// List of supported presets.
176
+ pub fn preset_names ( ) -> Vec < PresetId > {
177
+ use preset_names:: * ;
178
+ vec ! [
179
+ PresetId :: from( PRESET_GENESIS ) ,
180
+ PresetId :: from( PRESET_DEVELOPMENT ) ,
181
+ PresetId :: from( PRESET_LOCAL ) ,
182
+ ]
183
+ }
0 commit comments