git.delta.rocks / unique-network / refs/commits / 11a57bd3fcf7

difftreelog

fix rpc , empty strings

PraetorP2022-09-13parent: #8ab1370.patch.diff
in: master

1 file changed

modifiedpallets/app-promotion/src/lib.rsdiffbeforeafterboth
760 /// Returns the total staked balance for the staker.760 /// Returns the total staked balance for the staker.
761 /// If `staker` is `None`, returns the total amount staked.761 /// If `staker` is `None`, returns the total amount staked.
762 /// - `staker`: staker account.762 /// - `staker`: staker account.
763 ///
764 pub fn cross_id_total_staked(staker: Option<T::CrossAccountId>) -> Option<BalanceOf<T>> {763 pub fn cross_id_total_staked(staker: Option<T::CrossAccountId>) -> Option<BalanceOf<T>> {
765 staker.map_or(Some(<TotalStaked<T>>::get()), |s| {764 staker.map_or(Some(<TotalStaked<T>>::get()), |s| {
766 Self::total_staked_by_id(s.as_sub())765 Self::total_staked_by_id(s.as_sub())
777 /// the amount of the stake.776 /// the amount of the stake.
778 ///777 ///
779 /// - `staker`: staker account.778 /// - `staker`: staker account.
780 ///
781 pub fn cross_id_total_staked_per_block(779 pub fn cross_id_total_staked_per_block(
782 staker: T::CrossAccountId,780 staker: T::CrossAccountId,
783 ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {781 ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {
832 /// Since user funds are not transferred anywhere by staking, overflow protection is provided830 /// Since user funds are not transferred anywhere by staking, overflow protection is provided
833 /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow,831 /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow,
834 /// the staker must have more funds on his account than the maximum set for `Balance` type.832 /// the staker must have more funds on his account than the maximum set for `Balance` type.
835 ///
836 /// **Note**: This `fn` has been added to implement RPC
837 pub fn cross_id_pending_unstake(staker: Option<T::CrossAccountId>) -> BalanceOf<T> {833 pub fn cross_id_pending_unstake(staker: Option<T::CrossAccountId>) -> BalanceOf<T> {
838 staker.map_or(834 staker.map_or(
839 PendingUnstake::<T>::iter_values()835 PendingUnstake::<T>::iter_values()
858 /// the amount of the unreserved funds.854 /// the amount of the unreserved funds.
859 ///855 ///
860 /// - `staker`: staker account.856 /// - `staker`: staker account.
861 ///
862 /// **Note**: This `fn` has been added to implement RPC
863 pub fn cross_id_pending_unstake_per_block(857 pub fn cross_id_pending_unstake_per_block(
864 staker: T::CrossAccountId,858 staker: T::CrossAccountId,
865 ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {859 ) -> Vec<(T::BlockNumber, BalanceOf<T>)> {