File tree Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Original file line number Diff line number Diff line change @@ -147,23 +147,6 @@ impl<T: Config> Pallet<T> {
147
147
Some ( neuron)
148
148
}
149
149
150
- pub fn get_neuron_certificate ( netuid : u16 , uid : u16 ) -> Option < NeuronCertificate > {
151
- if !Self :: if_subnet_exist ( netuid) {
152
- return None ;
153
- }
154
-
155
- let hotkey = match Self :: get_hotkey_for_net_and_uid ( netuid, uid) {
156
- Ok ( h) => h,
157
- Err ( _) => return None ,
158
- } ;
159
-
160
- if Self :: has_neuron_certificate ( netuid, & hotkey) {
161
- NeuronCertificates :: < T > :: get ( netuid, hotkey)
162
- } else {
163
- None
164
- }
165
- }
166
-
167
150
pub fn get_neuron ( netuid : u16 , uid : u16 ) -> Option < NeuronInfo < T > > {
168
151
if !Self :: if_subnet_exist ( netuid) {
169
152
return None ;
Original file line number Diff line number Diff line change @@ -252,10 +252,6 @@ impl<T: Config> Pallet<T> {
252
252
Axons :: < T > :: contains_key ( netuid, hotkey)
253
253
}
254
254
255
- pub fn has_neuron_certificate ( netuid : u16 , hotkey : & T :: AccountId ) -> bool {
256
- NeuronCertificates :: < T > :: contains_key ( netuid, hotkey)
257
- }
258
-
259
255
pub fn has_prometheus_info ( netuid : u16 , hotkey : & T :: AccountId ) -> bool {
260
256
Prometheus :: < T > :: contains_key ( netuid, hotkey)
261
257
}
Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ fn test_serving_ok() {
103
103
fn test_serving_tls_ok ( ) {
104
104
new_test_ext ( 1 ) . execute_with ( || {
105
105
let hotkey_account_id = U256 :: from ( 1 ) ;
106
- let uid: u16 = 0 ;
107
106
let netuid: u16 = 1 ;
108
107
let tempo: u16 = 13 ;
109
108
let version: u32 = 2 ;
@@ -129,8 +128,9 @@ fn test_serving_tls_ok() {
129
128
placeholder2,
130
129
certificate. clone( )
131
130
) ) ;
132
- let stored_certificate =
133
- SubtensorModule :: get_neuron_certificate ( netuid, uid) . expect ( "Certificate should exist" ) ;
131
+
132
+ let stored_certificate = NeuronCertificates :: < Test > :: get ( netuid, hotkey_account_id)
133
+ . expect ( "Certificate should exist" ) ;
134
134
assert_eq ! ( stored_certificate. certificate, certificate) ;
135
135
let new_certificate = "UPDATED_CERT" . as_bytes ( ) . to_vec ( ) ;
136
136
assert_ok ! ( SubtensorModule :: serve_axon_tls(
@@ -145,8 +145,8 @@ fn test_serving_tls_ok() {
145
145
placeholder2,
146
146
new_certificate. clone( )
147
147
) ) ;
148
- let stored_certificate =
149
- SubtensorModule :: get_neuron_certificate ( netuid , uid ) . expect ( "Certificate should exist" ) ;
148
+ let stored_certificate = NeuronCertificates :: < Test > :: get ( netuid , hotkey_account_id )
149
+ . expect ( "Certificate should exist" ) ;
150
150
assert_eq ! ( stored_certificate. certificate, new_certificate)
151
151
} ) ;
152
152
}
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ fn test_replace_neuron() {
86
86
assert_eq ! ( curr_hotkey. unwrap( ) , new_hotkey_account_id) ;
87
87
88
88
// Check neuron certificate was reset
89
- let certificate = SubtensorModule :: get_neuron_certificate ( netuid, neuron_uid . unwrap ( ) ) ;
89
+ let certificate = NeuronCertificates :: < Test > :: get ( netuid, hotkey_account_id ) ;
90
90
assert_eq ! ( certificate, None ) ;
91
91
} ) ;
92
92
}
You can’t perform that action at this time.
0 commit comments