diff --git a/massa-api/src/public.rs b/massa-api/src/public.rs index a096af53fd3..b03f2f9224e 100644 --- a/massa-api/src/public.rs +++ b/massa-api/src/public.rs @@ -234,6 +234,11 @@ impl MassaRpcServer for API { fee, } in reqs { + if address.is_none() && fee.is_some() { + return Err( + ApiError::BadRequest("fee argument is set without address".into()).into(), + ); + } let address = if let Some(addr) = address { addr } else { @@ -327,6 +332,12 @@ impl MassaRpcServer for API { fee, } in reqs { + if caller_address.is_none() && (fee.is_some() || coins.is_some()) { + return Err(ApiError::BadRequest( + "fee or coins argument is set without caller_address".into(), + ) + .into()); + } let caller_address = if let Some(addr) = caller_address { addr } else {