mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-14 15:09:23 +00:00
update to develop latest
This commit is contained in:
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
description = "Emissions pallet for Serai"
|
||||
license = "AGPL-3.0-only"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/substrate/emissions/pallet"
|
||||
authors = ["Akil Demir <aeg_asd@hotmail.com>"]
|
||||
authors = ["Akil Demir <akildemir72@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.77"
|
||||
|
||||
|
||||
@@ -79,10 +79,6 @@ pub mod pallet {
|
||||
#[pallet::getter(fn session)]
|
||||
pub type CurrentSession<T: Config> = StorageMap<_, Identity, NetworkId, u32, ValueQuery>;
|
||||
|
||||
// TODO: Find a better place for this
|
||||
#[pallet::storage]
|
||||
pub(crate) type GenesisCompleteBlock<T: Config> = StorageValue<_, u64, OptionQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
pub(crate) type LastSwapVolume<T: Config> = StorageMap<_, Identity, Coin, u64, OptionQuery>;
|
||||
|
||||
@@ -103,12 +99,7 @@ pub mod pallet {
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
fn on_initialize(n: BlockNumberFor<T>) -> Weight {
|
||||
if GenesisCompleteBlock::<T>::get().is_none() &&
|
||||
GenesisLiquidity::<T>::genesis_complete().is_some()
|
||||
{
|
||||
GenesisCompleteBlock::<T>::set(Some(n.saturated_into::<u64>()));
|
||||
}
|
||||
let genesis_ended = GenesisLiquidity::<T>::genesis_complete().is_some();
|
||||
let genesis_ended = GenesisLiquidity::<T>::genesis_complete_block().is_some();
|
||||
|
||||
// check if we got a new session
|
||||
let mut session_changed = false;
|
||||
@@ -297,7 +288,7 @@ pub mod pallet {
|
||||
|
||||
// TODO: we have the past session participants here in the emissions pallet so that we can
|
||||
// distribute rewards to them in the next session. Ideally we should be able to fetch this
|
||||
// information from valiadtor sets pallet.
|
||||
// information from validator sets pallet.
|
||||
Self::update_participants();
|
||||
Weight::zero() // TODO
|
||||
}
|
||||
@@ -316,7 +307,7 @@ pub mod pallet {
|
||||
#[cfg(not(feature = "fast-epoch"))]
|
||||
let initial_period_duration = 2 * MONTHS;
|
||||
|
||||
let genesis_complete_block = GenesisCompleteBlock::<T>::get();
|
||||
let genesis_complete_block = GenesisLiquidity::<T>::genesis_complete_block();
|
||||
genesis_complete_block.is_some() &&
|
||||
(n.saturated_into::<u64>() < (genesis_complete_block.unwrap() + initial_period_duration))
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
description = "Serai emissions primitives"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/substrate/emissions/primitives"
|
||||
authors = ["Akil Demir <aeg_asd@hotmail.com>"]
|
||||
authors = ["Akil Demir <akildemir72@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.77"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user