From 1af9fc8ad2f5a9b67a51cddace32e339b5c3efcd Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 21 Mar 2023 19:27:30 -0400 Subject: [PATCH 1/2] bump spec --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index abaa2f8685..7f1136e33a 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -111,7 +111,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 103, + spec_version: 104, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From abb660596dc3a399a751befccaf1a78c12e6a078 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Tue, 21 Mar 2023 19:27:43 -0400 Subject: [PATCH 2/2] don't return nom if 0 staked --- pallets/subtensor/src/delegate_info.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/subtensor/src/delegate_info.rs b/pallets/subtensor/src/delegate_info.rs index e4c9fb6eaf..a3c3234077 100644 --- a/pallets/subtensor/src/delegate_info.rs +++ b/pallets/subtensor/src/delegate_info.rs @@ -26,6 +26,8 @@ impl Pallet { let mut nominators = Vec::<(T::AccountId, Compact)>::new(); for ( nominator, stake ) in < Stake as IterableStorageDoubleMap >::iter_prefix( delegate.clone() ) { + if stake == 0 { continue; } + // Only add nominators with stake nominators.push( ( nominator.clone(), stake.into() ) ); }