From 29bbfc21c69e84b51339b0297e0c2fe09930f5fb Mon Sep 17 00:00:00 2001 From: Marcin Date: Mon, 5 Dec 2022 08:08:44 +0100 Subject: [PATCH] Added pending_rewards API call to Mainnet 8.X branch (#782) --- Cargo.lock | 15 +++++++++++++-- bin/node/Cargo.toml | 2 +- bin/runtime/Cargo.toml | 4 +++- bin/runtime/src/lib.rs | 9 ++++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d07508120c..83caad2ac9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,7 +227,7 @@ dependencies = [ [[package]] name = "aleph-node" -version = "0.8.2+mainnet" +version = "0.8.3+mainnet" dependencies = [ "aleph-runtime", "clap", @@ -282,7 +282,7 @@ dependencies = [ [[package]] name = "aleph-runtime" -version = "0.8.0+mainnet" +version = "0.8.1+mainnet" dependencies = [ "frame-executive", "frame-support", @@ -297,6 +297,7 @@ dependencies = [ "pallet-identity", "pallet-multisig", "pallet-nomination-pools", + "pallet-nomination-pools-runtime-api", "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-session", @@ -4988,6 +4989,16 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "1.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-std", +] + [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" diff --git a/bin/node/Cargo.toml b/bin/node/Cargo.toml index 94fc45d1d6..df8e934b4e 100644 --- a/bin/node/Cargo.toml +++ b/bin/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-node" -version = "0.8.2+mainnet" +version = "0.8.3+mainnet" authors = ["Cardinal Cryptography"] description = "Aleph node binary" edition = "2021" diff --git a/bin/runtime/Cargo.toml b/bin/runtime/Cargo.toml index 4a4b30f344..5fcae19c85 100644 --- a/bin/runtime/Cargo.toml +++ b/bin/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-runtime" -version = "0.8.0+mainnet" +version = "0.8.1+mainnet" authors = ["Cardinal Cryptography"] edition = "2021" homepage = "https://alephzero.org" @@ -38,6 +38,7 @@ pallet-vesting = { default-features = false, git = "https://github.com/Cardinal- pallet-multisig = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } pallet-utility = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } pallet-nomination-pools = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } +pallet-nomination-pools-runtime-api = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } sp-api = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } sp-block-builder = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } @@ -103,6 +104,7 @@ std = [ "frame-system-rpc-runtime-api/std", "primitives/std", "pallet-nomination-pools/std", + "pallet-nomination-pools-runtime-api/std", ] short_session = ["primitives/short_session"] try-runtime = [ diff --git a/bin/runtime/src/lib.rs b/bin/runtime/src/lib.rs index 6955191edf..8912b8479c 100644 --- a/bin/runtime/src/lib.rs +++ b/bin/runtime/src/lib.rs @@ -104,7 +104,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("aleph-node"), impl_name: create_runtime_str!("aleph-node"), authoring_version: 1, - spec_version: 39, + spec_version: 46, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 14, @@ -863,6 +863,13 @@ impl_runtime_apis! { } } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi for Runtime { + fn pending_rewards(member_account: AccountId) -> Balance { + NominationPools::pending_rewards(member_account) + } + } + + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (frame_support::weights::Weight, frame_support::weights::Weight) {