@@ -228,10 +228,10 @@ impl Operating {
228228impl Mining {
229229 pub fn overwrite_with ( & mut self , matches : & clap:: ArgMatches ) -> Result < ( ) , String > {
230230 if let Some ( author) = matches. value_of ( "author" ) {
231- self . author = Some ( parse_address ( author) ?) ;
231+ self . author = Some ( author. parse ( ) ?) ;
232232 }
233233 if let Some ( engine_signer) = matches. value_of ( "engine-signer" ) {
234- self . engine_signer = Some ( parse_address ( engine_signer) ?) ;
234+ self . engine_signer = Some ( engine_signer. parse ( ) ?) ;
235235 }
236236 if let Some ( password_path) = matches. value_of ( "password-path" ) {
237237 self . password_path = Some ( password_path. to_string ( ) ) ;
@@ -361,7 +361,7 @@ impl ShardValidator {
361361 }
362362
363363 if let Some ( account) = matches. value_of ( "shard-validator" ) {
364- self . account = Some ( parse_address ( account) ?)
364+ self . account = Some ( account. parse ( ) ?)
365365 }
366366 if let Some ( password_path) = matches. value_of ( "shard-validator-password-path" ) {
367367 self . password_path = Some ( password_path. to_string ( ) ) ;
@@ -388,11 +388,3 @@ pub fn load_config(matches: &clap::ArgMatches) -> Result<Config, String> {
388388
389389 Ok ( config)
390390}
391-
392- fn parse_address ( value : & str ) -> Result < Address , String > {
393- if value. starts_with ( "0x" ) {
394- Address :: from_str ( & value[ 2 ..] )
395- } else {
396- Address :: from_str ( value)
397- } . map_err ( |_| "Invalid address" . to_string ( ) )
398- }
0 commit comments