From a9dbb09a37360210c3f4ec49e37c2b264f76fd8d Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 2 Dec 2022 10:19:27 +0100 Subject: [PATCH 1/2] Added pending_rewards call to nomination pool api to our runtime --- Cargo.lock | 13 ++++++++++++- bin/runtime/Cargo.toml | 4 +++- bin/runtime/src/lib.rs | 8 +++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5aab6a0715..823ba463e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "aleph-runtime" -version = "0.8.3" +version = "0.9.0" dependencies = [ "frame-executive", "frame-support", @@ -298,6 +298,7 @@ dependencies = [ "pallet-identity", "pallet-multisig", "pallet-nomination-pools", + "pallet-nomination-pools-runtime-api", "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-session", @@ -4357,6 +4358,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.31#46bfeea179cafbdd8aba7b26300064c64a661415" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-std", +] + [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" diff --git a/bin/runtime/Cargo.toml b/bin/runtime/Cargo.toml index e0e208c69b..f1c89ca1f7 100644 --- a/bin/runtime/Cargo.toml +++ b/bin/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-runtime" -version = "0.8.3" +version = "0.9.0" authors = ["Cardinal Cryptography"] edition = "2021" homepage = "https://alephzero.org" @@ -40,6 +40,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.31" } pallet-utility = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.31" } pallet-nomination-pools = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.31" } +pallet-nomination-pools-runtime-api = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.31" } sp-api = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.31" } sp-block-builder = { default-features = false, git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.31" } @@ -107,6 +108,7 @@ std = [ "pallet-contracts-primitives/std", "pallet-contracts/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 95fffe88da..30843433e3 100644 --- a/bin/runtime/src/lib.rs +++ b/bin/runtime/src/lib.rs @@ -105,7 +105,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: 42, + spec_version: 43, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 13, @@ -915,6 +915,12 @@ impl_runtime_apis! { } } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi for Runtime { + fn pending_rewards(member_account: AccountId) -> Balance { + NominationPools::pending_rewards(member_account).unwrap_or_default() + } + } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { From fb49802957ff0f0f2a10d17831088026612171f9 Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 2 Dec 2022 11:05:36 +0100 Subject: [PATCH 2/2] Set runtime version to 0.8.4 --- Cargo.lock | 2 +- bin/runtime/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 823ba463e5..ed7aae8096 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "aleph-runtime" -version = "0.9.0" +version = "0.8.4" dependencies = [ "frame-executive", "frame-support", diff --git a/bin/runtime/Cargo.toml b/bin/runtime/Cargo.toml index f1c89ca1f7..888e32e6b5 100644 --- a/bin/runtime/Cargo.toml +++ b/bin/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-runtime" -version = "0.9.0" +version = "0.8.4" authors = ["Cardinal Cryptography"] edition = "2021" homepage = "https://alephzero.org"