Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Companion PR for PR#13119 (#6683)
Browse files Browse the repository at this point in the history
* Companion PR for PR#13119

* restart ci

* update lockfile for {"substrate"}

* Use Master Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use Master Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
gpestana and ggwpez authored Feb 21, 2023
1 parent 66cc0d1 commit 4b0ae4e
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 185 deletions.
377 changes: 195 additions & 182 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pallet-session = { git = "https://github.com/paritytech/substrate", branch = "ma
pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -169,6 +170,7 @@ std = [
"pallet-session/std",
"pallet-society/std",
"pallet-staking/std",
"pallet-staking-runtime-api/std",
"pallet-timestamp/std",
"pallet-tips/std",
"pallet-treasury/std",
Expand Down
16 changes: 15 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,21 @@ sp_api::impl_runtime_apis! {
Balance,
> for Runtime {
fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member).unwrap_or_default()
NominationPools::api_pending_rewards(member).unwrap_or_default()
}

fn points_to_balance(pool_id: pallet_nomination_pools::PoolId, points: Balance) -> Balance {
NominationPools::api_points_to_balance(pool_id, points)
}

fn balance_to_points(pool_id: pallet_nomination_pools::PoolId, new_funds: Balance) -> Balance {
NominationPools::api_balance_to_points(pool_id, new_funds)
}
}

impl pallet_staking_runtime_api::StakingApi<Block, Balance> for Runtime {
fn nominations_quota(balance: Balance) -> u32 {
Staking::api_nominations_quota(balance)
}
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pallet-session = { git = "https://github.com/paritytech/substrate", branch = "ma
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
polkadot-runtime-constants = { package = "polkadot-runtime-constants", path = "./constants", default-features = false }
Expand Down Expand Up @@ -155,6 +156,7 @@ std = [
"pallet-scheduler/std",
"pallet-session/std",
"pallet-staking/std",
"pallet-staking-runtime-api/std",
"pallet-timestamp/std",
"pallet-treasury/std",
"pallet-tips/std",
Expand Down
16 changes: 15 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,21 @@ sp_api::impl_runtime_apis! {
Balance,
> for Runtime {
fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member).unwrap_or_default()
NominationPools::api_pending_rewards(member).unwrap_or_default()
}

fn points_to_balance(pool_id: pallet_nomination_pools::PoolId, points: Balance) -> Balance {
NominationPools::api_points_to_balance(pool_id, points)
}

fn balance_to_points(pool_id: pallet_nomination_pools::PoolId, new_funds: Balance) -> Balance {
NominationPools::api_balance_to_points(pool_id, new_funds)
}
}

impl pallet_staking_runtime_api::StakingApi<Block, Balance> for Runtime {
fn nominations_quota(balance: Balance) -> u32 {
Staking::api_nominations_quota(balance)
}
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pallet-session = { git = "https://github.com/paritytech/substrate", branch = "ma
pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-state-trie-migration = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -156,6 +157,7 @@ std = [
"pallet-session/std",
"pallet-society/std",
"pallet-staking/std",
"pallet-staking-runtime-api/std",
"pallet-state-trie-migration/std",
"pallet-sudo/std",
"pallet-timestamp/std",
Expand Down
16 changes: 15 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,21 @@ sp_api::impl_runtime_apis! {
Balance,
> for Runtime {
fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member).unwrap_or_default()
NominationPools::api_pending_rewards(member).unwrap_or_default()
}

fn points_to_balance(pool_id: pallet_nomination_pools::PoolId, points: Balance) -> Balance {
NominationPools::api_points_to_balance(pool_id, points)
}

fn balance_to_points(pool_id: pallet_nomination_pools::PoolId, new_funds: Balance) -> Balance {
NominationPools::api_balance_to_points(pool_id, new_funds)
}
}

impl pallet_staking_runtime_api::StakingApi<Block, Balance> for Runtime {
fn nominations_quota(balance: Balance) -> u32 {
Staking::api_nominations_quota(balance)
}
}

Expand Down

0 comments on commit 4b0ae4e

Please sign in to comment.