Skip to content

Commit

Permalink
use chk for neuron info lite stake (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
camfairchild authored and keithtensor committed Nov 7, 2024
1 parent e21ba0d commit e735f72
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pallets/subtensor/src/rpc_info/neuron_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use super::*;
use frame_support::pallet_prelude::{Decode, Encode};
use frame_support::storage::IterableStorageDoubleMap;
extern crate alloc;
use codec::Compact;

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

let stake: Vec<(T::AccountId, Compact<u64>)> =
<Stake<T> as IterableStorageDoubleMap<T::AccountId, T::AccountId, u64>>::iter_prefix(
hotkey.clone(),
)
.map(|(coldkey, stake)| (coldkey, stake.into()))
.collect();
let stake: Vec<(T::AccountId, Compact<u64>)> = vec![(
coldkey.clone(),
Self::get_stake_for_hotkey_on_subnet(&hotkey, netuid).into(),
)];

let neuron = NeuronInfoLite {
hotkey: hotkey.clone(),
Expand Down

0 comments on commit e735f72

Please sign in to comment.