make gatekeeped amount part of the genesis

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-11-28 16:56:46 +03:00
parent 147542f10c
commit 5b26d4ce28
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "ghost-networks"
version = "0.1.19"
version = "0.1.20"
license.workspace = true
authors.workspace = true
edition.workspace = true

View File

@ -255,7 +255,7 @@ pub mod module {
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
pub networks: Vec<(T::NetworkId, Vec<u8>)>,
pub networks: Vec<(T::NetworkId, Vec<u8>, BalanceOf<T>)>,
}
impl<T: Config> Default for GenesisConfig<T> {
@ -270,11 +270,12 @@ pub mod module {
if !self.networks.is_empty() {
self.networks
.iter()
.for_each(|(chain_id, network_metadata)| {
.for_each(|(chain_id, network_metadata, gatekeeper_amount)| {
let network = NetworkData::decode(&mut &network_metadata[..])
.expect("Error decoding NetworkData");
Pallet::<T>::do_register_network(chain_id.clone(), network)
.expect("Error registering network");
GatekeeperAmount::<T>::insert(chain_id, gatekeeper_amount);
});
}
}