-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP reward-distribution hook and percentage caculation
- Loading branch information
Showing
9 changed files
with
182 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#[cfg(test)] | ||
use mocktopus::macros::mockable; | ||
|
||
#[cfg_attr(test, mockable)] | ||
pub(crate) mod security { | ||
use frame_support::dispatch::DispatchResult; | ||
use sp_runtime::DispatchError; | ||
|
||
pub fn ensure_parachain_status_running<T: crate::Config>() -> DispatchResult { | ||
<security::Pallet<T>>::ensure_parachain_status_running() | ||
} | ||
|
||
pub fn parachain_block_expired<T: crate::Config>( | ||
opentime: T::BlockNumber, | ||
period: T::BlockNumber, | ||
) -> Result<bool, DispatchError> { | ||
<security::Pallet<T>>::parachain_block_expired(opentime, period) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
use crate::Config; | ||
use frame_support::traits::Currency; | ||
//use currency::CurrencyId; | ||
use primitives::{CurrencyId, VaultId}; | ||
|
||
pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId; | ||
|
||
pub(crate) type BalanceOf<T> = <<T as Config>::Currency as Currency<AccountIdOf<T>>>::Balance; | ||
pub(crate) type BalanceOf<T> = <T as Config>::Balance; | ||
|
||
pub(crate) type DefaultVaultId<T> = VaultId<<T as frame_system::Config>::AccountId, CurrencyId>; |