@@ -1068,9 +1068,6 @@ fn set_request_fees(request: &mut String, wallet_handle: i32, submitter_did: &st
10681068}
10691069
10701070fn parse_payment_inputs ( inputs : & Vec < & str > ) -> Result < String , ( ) > {
1071- if inputs. is_empty ( ) {
1072- return Err ( println_err ! ( "Inputs list is empty" ) ) ;
1073- }
10741071 serde_json:: to_string ( & inputs)
10751072 . map_err ( |_| println_err ! ( "Wrong data has been received" ) )
10761073}
@@ -3423,6 +3420,28 @@ pub mod tests {
34233420 TestUtils :: cleanup_storage ( ) ;
34243421 }
34253422
3423+ #[ test]
3424+ pub fn set_fees_prepare_works_for_empty_fees ( ) {
3425+ TestUtils :: cleanup_storage ( ) ;
3426+ let ctx = CommandContext :: new ( ) ;
3427+
3428+ create_and_connect_pool ( & ctx) ;
3429+ create_and_open_wallet ( & ctx) ;
3430+ load_null_payment_plugin ( & ctx) ;
3431+ new_did ( & ctx, SEED_TRUSTEE ) ;
3432+ use_did ( & ctx, DID_TRUSTEE ) ;
3433+ {
3434+ let cmd = set_fees_prepare_command:: new ( ) ;
3435+ let mut params = CommandParams :: new ( ) ;
3436+ params. insert ( "payment_method" , NULL_PAYMENT_METHOD . to_string ( ) ) ;
3437+ params. insert ( "fees" , "" . to_string ( ) ) ;
3438+ cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
3439+ }
3440+ close_and_delete_wallet ( & ctx) ;
3441+ disconnect_and_delete_pool ( & ctx) ;
3442+ TestUtils :: cleanup_storage ( ) ;
3443+ }
3444+
34263445 #[ test]
34273446 pub fn set_fees_prepare_works_for_no_active_wallet ( ) {
34283447 TestUtils :: cleanup_storage ( ) ;
0 commit comments