merge genesis complete block with genesis ended

This commit is contained in:
akildemir
2024-08-15 12:51:05 +03:00
committed by Luke Parker
parent efc45c391b
commit a2df54dd6a
5 changed files with 22 additions and 32 deletions

View File

@@ -72,8 +72,8 @@ pub mod pallet {
pub(crate) type Oracle<T: Config> = StorageMap<_, Identity, Coin, u64, OptionQuery>;
#[pallet::storage]
#[pallet::getter(fn genesis_complete)]
pub(crate) type GenesisComplete<T: Config> = StorageValue<_, (), OptionQuery>;
#[pallet::getter(fn genesis_complete_block)]
pub(crate) type GenesisCompleteBlock<T: Config> = StorageValue<_, u64, OptionQuery>;
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
@@ -87,7 +87,7 @@ pub mod pallet {
// Distribute the genesis sri to pools after a month
if (n.saturated_into::<u64>() >= final_block) &&
Self::oraclization_is_done() &&
GenesisComplete::<T>::get().is_none()
GenesisCompleteBlock::<T>::get().is_none()
{
// mint the SRI
Coins::<T>::mint(
@@ -167,7 +167,7 @@ pub mod pallet {
assert_eq!(Coins::<T>::balance(GENESIS_LIQUIDITY_ACCOUNT.into(), coin), Amount(0));
}
GenesisComplete::<T>::set(Some(()));
GenesisCompleteBlock::<T>::set(Some(n.saturated_into::<u64>()));
}
// we accept we reached economic security once we can mint smallest amount of a network's coin