Skip to content

pallet-randomness-beacon: set default config on genesis #385

@juangirini

Description

@juangirini

This is specially useful for testing, which requires to set Drand Quicknet's pk on every startup.
We could use pallet:genesis_config and pallet::genesis_build like

	#[pallet::genesis_config]
	pub struct GenesisConfig<T: Config> {
		pub pk: Option<PubkeyOf<T>>,
	}

	#[pallet::genesis_build]
	impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
		fn build(&self) {
			Pubkey::<T>::set(self.pk.clone());
		}
	}

And then add it to the genesis_config_presets.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions