@@ -1079,9 +1079,6 @@ fn set_request_fees(request: &mut String, wallet_handle: i32, submitter_did: &st
10791079}
10801080
10811081fn parse_payment_inputs ( inputs : & Vec < & str > ) -> Result < String , ( ) > {
1082- if inputs. is_empty ( ) {
1083- return Err ( println_err ! ( "Inputs list is empty" ) ) ;
1084- }
10851082 serde_json:: to_string ( & inputs)
10861083 . map_err ( |_| println_err ! ( "Wrong data has been received" ) )
10871084}
@@ -3433,6 +3430,28 @@ pub mod tests {
34333430 TestUtils :: cleanup_storage ( ) ;
34343431 }
34353432
3433+ #[ test]
3434+ pub fn set_fees_prepare_works_for_empty_fees ( ) {
3435+ TestUtils :: cleanup_storage ( ) ;
3436+ let ctx = CommandContext :: new ( ) ;
3437+
3438+ create_and_connect_pool ( & ctx) ;
3439+ create_and_open_wallet ( & ctx) ;
3440+ load_null_payment_plugin ( & ctx) ;
3441+ new_did ( & ctx, SEED_TRUSTEE ) ;
3442+ use_did ( & ctx, DID_TRUSTEE ) ;
3443+ {
3444+ let cmd = set_fees_prepare_command:: new ( ) ;
3445+ let mut params = CommandParams :: new ( ) ;
3446+ params. insert ( "payment_method" , NULL_PAYMENT_METHOD . to_string ( ) ) ;
3447+ params. insert ( "fees" , "" . to_string ( ) ) ;
3448+ cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
3449+ }
3450+ close_and_delete_wallet ( & ctx) ;
3451+ disconnect_and_delete_pool ( & ctx) ;
3452+ TestUtils :: cleanup_storage ( ) ;
3453+ }
3454+
34363455 #[ test]
34373456 pub fn set_fees_prepare_works_for_no_active_wallet ( ) {
34383457 TestUtils :: cleanup_storage ( ) ;
0 commit comments