1- use std:: {
2- collections:: { HashMap , HashSet } ,
3- io:: Write ,
4- path:: PathBuf ,
5- } ;
1+ use std:: { collections:: HashMap , io:: Write , path:: PathBuf } ;
62
73use alloy:: { hex, rpc:: types:: beacon:: constants:: BLS_SIGNATURE_BYTES_LEN } ;
84use blsful:: inner_types:: { Field , G2Affine , G2Projective , Group , Scalar } ;
@@ -107,14 +103,8 @@ impl DirkManager {
107103 }
108104 } ;
109105
110- let wallets: HashSet < String > = host
111- . accounts
112- . iter ( )
113- . map ( |account| decompose_name ( account) . unwrap_or_default ( ) . 0 )
114- . collect ( ) ;
115-
116106 let accounts_response = match ListerClient :: new ( channel. clone ( ) )
117- . list_accounts ( ListAccountsRequest { paths : wallets. into_iter ( ) . collect ( ) } )
107+ . list_accounts ( ListAccountsRequest { paths : host . wallets . clone ( ) } )
118108 . await
119109 {
120110 Ok ( res) => res,
@@ -130,12 +120,7 @@ impl DirkManager {
130120 }
131121
132122 let accounts_response = accounts_response. into_inner ( ) ;
133- load_simple_accounts (
134- accounts_response. accounts ,
135- & host,
136- & channel,
137- & mut consensus_accounts,
138- ) ;
123+ load_simple_accounts ( accounts_response. accounts , & channel, & mut consensus_accounts) ;
139124 load_distributed_accounts (
140125 accounts_response. distributed_accounts ,
141126 & host,
@@ -144,15 +129,6 @@ impl DirkManager {
144129 )
145130 . map_err ( |error| warn ! ( "{error}" ) )
146131 . ok ( ) ;
147-
148- for account in host. accounts {
149- if !consensus_accounts
150- . values ( )
151- . any ( |account| account. full_name ( ) == account. full_name ( ) )
152- {
153- warn ! ( "Account {account} not found in server {}" , host. url) ;
154- }
155- }
156132 }
157133
158134 debug ! (
@@ -595,15 +571,10 @@ fn decompose_name(full_name: &str) -> eyre::Result<(String, String)> {
595571/// Load `SimpleAccount`s into the consensus accounts map
596572fn load_simple_accounts (
597573 accounts : Vec < crate :: proto:: v1:: Account > ,
598- host : & DirkHostConfig ,
599574 channel : & Channel ,
600575 consensus_accounts : & mut HashMap < BlsPublicKey , Account > ,
601576) {
602577 for account in accounts {
603- if !host. accounts . contains ( & account. name ) {
604- continue ;
605- }
606-
607578 let Ok ( ( wallet, name) ) = decompose_name ( & account. name ) else {
608579 warn ! ( "Invalid account name {}" , account. name) ;
609580 continue ;
@@ -643,10 +614,6 @@ fn load_distributed_accounts(
643614 . ok_or ( eyre:: eyre!( "Host name not found for server {}" , host. url) ) ?;
644615
645616 for account in accounts {
646- if !host. accounts . contains ( & account. name ) {
647- continue ;
648- }
649-
650617 let Ok ( public_key) = BlsPublicKey :: try_from ( account. composite_public_key . as_slice ( ) ) else {
651618 warn ! ( "Failed to parse composite public key for account {}" , account. name) ;
652619 continue ;
0 commit comments