File tree Expand file tree Collapse file tree 4 files changed +2
-48
lines changed Expand file tree Collapse file tree 4 files changed +2
-48
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ impl MetagraphPrecompile {
21
21
22
22
match method_id {
23
23
id if id == get_method_id ( "getUidCount(uint16)" ) => Self :: get_uid_count ( & method_input) ,
24
- id if id == get_method_id ( "getIsSubnetRegistered(uint16)" ) => {
25
- Self :: get_is_subnet_registered ( & method_input)
26
- }
27
24
id if id == get_method_id ( "getStake(uint16,uint16)" ) => Self :: get_stake ( & method_input) ,
28
25
id if id == get_method_id ( "getRank(uint16,uint16)" ) => Self :: get_rank ( & method_input) ,
29
26
id if id == get_method_id ( "getTrust(uint16,uint16)" ) => Self :: get_trust ( & method_input) ,
@@ -79,24 +76,6 @@ impl MetagraphPrecompile {
79
76
} )
80
77
}
81
78
82
- fn get_is_subnet_registered ( data : & [ u8 ] ) -> PrecompileResult {
83
- let netuid = Self :: parse_netuid ( data) ?;
84
- let is_registered = pallet_subtensor:: Pallet :: < Runtime > :: if_subnet_exist ( netuid) ;
85
-
86
- let result_u256 = if is_registered {
87
- U256 :: from ( 1 )
88
- } else {
89
- U256 :: from ( 0 )
90
- } ;
91
- let mut result = [ 0_u8 ; 32 ] ;
92
- U256 :: to_big_endian ( & result_u256, & mut result) ;
93
-
94
- Ok ( PrecompileOutput {
95
- exit_status : ExitSucceed :: Returned ,
96
- output : result. into ( ) ,
97
- } )
98
- }
99
-
100
79
fn get_stake ( data : & [ u8 ] ) -> PrecompileResult {
101
80
let netuid = Self :: parse_netuid ( data) ?;
102
81
let uid = Self :: parse_uid ( get_slice ( data, 32 , 64 ) ?) ?;
Original file line number Diff line number Diff line change 39
39
pub fn new ( ) -> Self {
40
40
Self ( Default :: default ( ) )
41
41
}
42
- pub fn used_addresses ( ) -> [ H160 ; 10 ] {
42
+ pub fn used_addresses ( ) -> [ H160 ; 11 ] {
43
43
[
44
44
hash ( 1 ) ,
45
45
hash ( 2 ) ,
51
51
hash ( EDVERIFY_PRECOMPILE_INDEX ) ,
52
52
hash ( BALANCE_TRANSFER_INDEX ) ,
53
53
hash ( STAKING_PRECOMPILE_INDEX ) ,
54
+ hash ( METAGRAPH_PRECOMPILE_INDEX ) ,
54
55
]
55
56
}
56
57
}
Original file line number Diff line number Diff line change 338
338
"stateMutability": "view",
339
339
"type": "function"
340
340
},
341
- {
342
- "inputs": [
343
- {
344
- "internalType": "uint16",
345
- "name": "netuid",
346
- "type": "uint16"
347
- }
348
- ],
349
- "name": "getIsSubnetRegistered",
350
- "outputs": [
351
- {
352
- "internalType": "bool",
353
- "name": "",
354
- "type": "bool"
355
- }
356
- ],
357
- "stateMutability": "view",
358
- "type": "function"
359
- },
360
341
{
361
342
"inputs": [
362
343
{
Original file line number Diff line number Diff line change @@ -19,13 +19,6 @@ interface IMetagraph {
19
19
* @return The count of UIDs associated with the specified netuid.
20
20
*/
21
21
function getUidCount (uint16 netuid ) external view returns (uint16 );
22
-
23
- /**
24
- * @dev Checks if a subnet with the given network identifier (netuid) is registered.
25
- * @param netuid The network identifier of the subnet to check.
26
- * @return Returns true if the subnet is registered, false otherwise.
27
- */
28
- function getIsSubnetRegistered (uint16 netuid ) external view returns (bool );
29
22
30
23
/**
31
24
* @dev Retrieves the stake amount associated with a given network identifier (netuid) and unique identifier (uid).
You can’t perform that action at this time.
0 commit comments