1- use crate :: { geoclicommand:: GeoCliCommand , validators :: validate_pubkey } ;
1+ use crate :: geoclicommand:: GeoCliCommand ;
22use clap:: Args ;
33use doublezero_sdk:: geolocation:: programconfig:: init:: InitProgramConfigCommand ;
4- use solana_sdk:: pubkey:: Pubkey ;
54use std:: io:: Write ;
65
76#[ derive( Args , Debug ) ]
8- pub struct InitProgramConfigCliCommand {
9- /// Serviceability program ID
10- #[ arg( long, value_parser = validate_pubkey) ]
11- pub serviceability_program_id : String ,
12- }
7+ pub struct InitProgramConfigCliCommand { }
138
149impl InitProgramConfigCliCommand {
1510 pub fn execute < C : GeoCliCommand , W : Write > ( self , client : & C , out : & mut W ) -> eyre:: Result < ( ) > {
16- let serviceability_program_id =
17- Pubkey :: try_from ( self . serviceability_program_id . as_str ( ) ) . unwrap ( ) ;
18-
19- let ( sig, pda) = client. init_program_config ( InitProgramConfigCommand {
20- serviceability_program_id,
21- } ) ?;
11+ let ( sig, pda) = client. init_program_config ( InitProgramConfigCommand { } ) ?;
2212
2313 writeln ! ( out, "Signature: {sig}\r \n Account: {pda}" ) ?;
2414
@@ -37,7 +27,6 @@ mod tests {
3727 fn test_cli_geo_init_program_config ( ) {
3828 let mut client = MockGeoCliCommand :: new ( ) ;
3929
40- let svc_program_id = Pubkey :: from_str_const ( "HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx" ) ;
4130 let config_pda = Pubkey :: from_str_const ( "BmrLoL9jzYo4yiPUsFhYFU8hgE3CD3Npt8tgbqvneMyB" ) ;
4231 let signature = Signature :: from ( [
4332 120 , 138 , 162 , 185 , 59 , 209 , 241 , 157 , 71 , 157 , 74 , 131 , 4 , 87 , 54 , 28 , 38 , 180 , 222 ,
@@ -48,16 +37,11 @@ mod tests {
4837
4938 client
5039 . expect_init_program_config ( )
51- . with ( predicate:: eq ( InitProgramConfigCommand {
52- serviceability_program_id : svc_program_id,
53- } ) )
40+ . with ( predicate:: eq ( InitProgramConfigCommand { } ) )
5441 . returning ( move |_| Ok ( ( signature, config_pda) ) ) ;
5542
5643 let mut output = Vec :: new ( ) ;
57- let res = InitProgramConfigCliCommand {
58- serviceability_program_id : svc_program_id. to_string ( ) ,
59- }
60- . execute ( & client, & mut output) ;
44+ let res = InitProgramConfigCliCommand { } . execute ( & client, & mut output) ;
6145 assert ! ( res. is_ok( ) ) ;
6246 let output_str = String :: from_utf8 ( output) . unwrap ( ) ;
6347 assert ! ( output_str. contains( "Signature:" ) ) ;
0 commit comments