difftreelog
remove: getTotalStakingLocked from RPC.
in: master
5 files changed
client/rpc/src/lib.rsdiffbeforeafterboth270 at: Option<BlockHash>,270 at: Option<BlockHash>,271 ) -> Result<Vec<(BlockNumber, String)>>;271 ) -> Result<Vec<(BlockNumber, String)>>;272273 /// Returns the total amount locked by staking tokens.274 #[method(name = "appPromotion_totalStakingLocked")]275 fn total_staking_locked(276 &self,277 staker: CrossAccountId,278 at: Option<BlockHash>,279 ) -> Result<String>;280272281 /// Returns the total amount of tokens pending withdrawal from staking.273 /// Returns the total amount of tokens pending withdrawal from staking.282 #[method(name = "appPromotion_pendingUnstake")]274 #[method(name = "appPromotion_pendingUnstake")]594 .into_iter()586 .into_iter()595 .map(|(b, a)| (b, a.to_string()))587 .map(|(b, a)| (b, a.to_string()))596 .collect::<Vec<_>>(), app_promotion_api);588 .collect::<Vec<_>>(), app_promotion_api);597 pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), app_promotion_api);598 pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);589 pass_method!(pending_unstake(staker: Option<CrossAccountId>) -> String => |v| v.to_string(), app_promotion_api);599 pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>590 pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> =>600 |v| v591 |v| vprimitives/app_promotion_rpc/src/lib.rsdiffbeforeafterboth35 {35 {36 fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;36 fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;37 fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;37 fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;38 fn total_staking_locked(staker: CrossAccountId) -> Result<u128>;39 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;38 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;40 fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;39 fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;41 }40 }runtime/common/runtime_apis.rsdiffbeforeafterboth206 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker));206 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_total_staked_per_block(staker));207 }207 }208209 fn total_staking_locked(staker: CrossAccountId) -> Result<u128, DispatchError> {210 #[cfg(not(feature = "app-promotion"))]211 return unsupported!();212213 #[cfg(feature = "app-promotion")]214 return Ok(<pallet_app_promotion::Pallet<Runtime>>::cross_id_locked_balance(staker));215 }216208217 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {209 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128, DispatchError> {218 #[cfg(not(feature = "app-promotion"))]210 #[cfg(not(feature = "app-promotion"))]tests/src/interfaces/appPromotion/definitions.tsdiffbeforeafterboth222223const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr';23const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr';242425const collectionParam = {name: 'collection', type: 'u32'};26const tokenParam = {name: 'tokenId', type: 'u32'};27const propertyKeysParam = {name: 'propertyKeys', type: 'Vec<String>', isOptional: true};28const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});25const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE});29const atParam = {name: 'at', type: 'Hash', isOptional: true};26const atParam = {name: 'at', type: 'Hash', isOptional: true};302747 [crossAccountParam('staker')],44 [crossAccountParam('staker')],48 'Vec<(u32, u128)>',45 'Vec<(u32, u128)>',49 ),46 ),50 totalStakingLocked: fun(51 'Return the total amount locked by staking tokens',52 [crossAccountParam('staker')],53 'u128',54 ),55 pendingUnstake: fun(47 pendingUnstake: fun(56 'Returns the total amount of unstaked tokens',48 'Returns the total amount of unstaked tokens',57 [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],49 [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}],tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth52 * Returns the total amount of staked tokens per block when staked52 * Returns the total amount of staked tokens per block when staked53 **/53 **/54 totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;54 totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;55 /**56 * Return the total amount locked by staking tokens57 **/58 totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;59 };55 };60 author: {56 author: {61 /**57 /**