Skip to content

Commit dbb5b5d

Browse files
authored
Merge pull request #781 from opentensor/hotfix/metagraph_stake
fix: metagraph stake info [devnet]
2 parents aaf9149 + 8dd149c commit dbb5b5d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pallets/subtensor/src/rpc_info/neuron_info.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::*;
22
use frame_support::pallet_prelude::{Decode, Encode};
3-
use frame_support::storage::IterableStorageDoubleMap;
43
extern crate alloc;
54
use codec::Compact;
65

@@ -179,12 +178,10 @@ impl<T: Config> Pallet<T> {
179178
let last_update = Self::get_last_update_for_uid(netuid, uid);
180179
let validator_permit = Self::get_validator_permit_for_uid(netuid, uid);
181180

182-
let stake: Vec<(T::AccountId, Compact<u64>)> =
183-
<Stake<T> as IterableStorageDoubleMap<T::AccountId, T::AccountId, u64>>::iter_prefix(
184-
hotkey.clone(),
185-
)
186-
.map(|(coldkey, stake)| (coldkey, stake.into()))
187-
.collect();
181+
let stake: Vec<(T::AccountId, Compact<u64>)> = vec![(
182+
coldkey.clone(),
183+
Self::get_stake_for_hotkey_on_subnet(&hotkey, netuid).into(),
184+
)];
188185

189186
let neuron = NeuronInfoLite {
190187
hotkey: hotkey.clone(),

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
142142
// `spec_version`, and `authoring_version` are the same between Wasm and native.
143143
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
144144
// the compatible custom types.
145-
spec_version: 195,
145+
spec_version: 196,
146146
impl_version: 1,
147147
apis: RUNTIME_API_VERSIONS,
148148
transaction_version: 1,

0 commit comments

Comments
 (0)