Skip to content

Commit 067ddd3

Browse files
committed
Revert "add stake info by hk, ck, netuid"
This reverts commit e0e2b84.
1 parent e0e2b84 commit 067ddd3

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed

pallets/subtensor/runtime-api/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ sp_api::decl_runtime_apis! {
3434
pub trait StakeInfoRuntimeApi {
3535
fn get_stake_info_for_coldkey( coldkey_account_vec: Vec<u8> ) -> Vec<u8>;
3636
fn get_stake_info_for_coldkeys( coldkey_account_vecs: Vec<Vec<u8>> ) -> Vec<u8>;
37-
fn get_stake_info_for_hotkey_coldkey_netuid( hotkey_account_vec: Vec<u8>, coldkey_account_vec: Vec<u8>, netuid: u16 ) -> Vec<u8>;
3837
}
3938

4039
pub trait SubnetRegistrationRuntimeApi {

pallets/subtensor/src/rpc_info/stake_info.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -99,42 +99,4 @@ impl<T: Config> Pallet<T> {
9999
first.1.clone()
100100
}
101101
}
102-
103-
pub fn get_stake_info_for_hotkey_coldkey_netuid(
104-
hotkey_account_vec: Vec<u8>,
105-
coldkey_account_vec: Vec<u8>,
106-
netuid: u16,
107-
) -> Option<StakeInfo<T>> {
108-
if coldkey_account_vec.len() != 32 {
109-
return None; // Invalid coldkey
110-
}
111-
112-
let Ok(coldkey) = T::AccountId::decode(&mut coldkey_account_vec.as_bytes_ref()) else {
113-
return None;
114-
};
115-
116-
if hotkey_account_vec.len() != 32 {
117-
return None; // Invalid hotkey
118-
}
119-
120-
let Ok(hotkey) = T::AccountId::decode(&mut hotkey_account_vec.as_bytes_ref()) else {
121-
return None;
122-
};
123-
124-
let alpha: u64 =
125-
Self::get_stake_for_hotkey_and_coldkey_on_subnet(&hotkey, &coldkey, netuid);
126-
let emission: u64 = AlphaDividendsPerSubnet::<T>::get(netuid, &hotkey);
127-
let is_registered: bool = Self::is_hotkey_registered_on_network(netuid, &hotkey);
128-
129-
Some(StakeInfo {
130-
hotkey: hotkey.clone(),
131-
coldkey: coldkey.clone(),
132-
netuid: (netuid).into(),
133-
stake: alpha.into(),
134-
locked: 0.into(),
135-
emission: emission.into(),
136-
drain: 0.into(),
137-
is_registered,
138-
})
139-
}
140102
}

runtime/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,11 +2157,6 @@ impl_runtime_apis! {
21572157
let result = SubtensorModule::get_stake_info_for_coldkeys( coldkey_account_vecs );
21582158
result.encode()
21592159
}
2160-
2161-
fn get_stake_for_hotkey_coldkey_netuid( hotkey_account_vec: Vec<u8>, coldkey_account_vec: Vec<u8>, netuid: u16 ) -> Vec<u8> {
2162-
let result = SubtensorModule::get_stake_info_for_hotkey_coldkey_netuid( hotkey_account_vec, coldkey_account_vec, netuid );
2163-
result.encode()
2164-
}
21652160
}
21662161

21672162
impl subtensor_custom_rpc_runtime_api::SubnetRegistrationRuntimeApi<Block> for Runtime {

0 commit comments

Comments
 (0)