Skip to content

Commit

Permalink
Merge pull request #785 from opentensor/testnet
Browse files Browse the repository at this point in the history
Finney
  • Loading branch information
unconst authored Sep 6, 2024
2 parents e79b099 + b1039b2 commit 58c1f51
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 58c1f51

Please sign in to comment.