File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,15 +156,13 @@ pub async fn bridge_monitoring_task(context: Arc<BridgeMonitoringContext>) {
156156
157157 // Bridge operator status
158158 let mut operator_statuses = Vec :: new ( ) ;
159- for ( index, public_key_string) in context. config . bridge_rpc_urls ( ) . keys ( ) . enumerate ( ) {
159+ let mut sorted_operators: Vec < _ > = context. config . bridge_rpc_urls ( ) . iter ( ) . collect ( ) ;
160+ sorted_operators. sort_by_key ( |( public_key_string, _) | * public_key_string) ;
161+
162+ for ( index, ( public_key_string, rpc_url) ) in sorted_operators. iter ( ) . enumerate ( ) {
160163 let operator_id = format ! ( "Alpen Labs #{}" , index + 1 ) ;
161164 let pk_bytes = hex:: decode ( public_key_string) . expect ( "decode to succeed" ) ;
162165 let operator_pk = PublicKey :: from_slice ( & pk_bytes) . expect ( "conversion to succeed" ) ;
163- let rpc_url = context
164- . config
165- . bridge_rpc_urls ( )
166- . get ( public_key_string)
167- . expect ( "valid rpc url" ) ;
168166 let status = get_operator_status ( rpc_url) . await ;
169167
170168 operator_statuses. push ( OperatorStatus :: new ( operator_id, operator_pk, status) ) ;
You can’t perform that action at this time.
0 commit comments