diff --git a/contracts/pool_stable/src/contract.rs b/contracts/pool_stable/src/contract.rs index ebf5318dc..bd03078d1 100644 --- a/contracts/pool_stable/src/contract.rs +++ b/contracts/pool_stable/src/contract.rs @@ -270,16 +270,7 @@ impl StableLiquidityPoolTrait for StableLiquidityPool { } } - if desired_a == 0 || desired_b == 0 { - log!( - &env, - "Pool Stable: ProvideLiquidity: Both tokens must be provided and must be bigger then 0!" - ); - panic_with_error!( - env, - ContractError::ProvideLiquidityBothTokensMustBeMoreThanZero - ); - } + validate_int_parameters!(desired_a, desired_b); // sender needs to authorize the deposit sender.require_auth(); diff --git a/contracts/pool_stable/src/tests/liquidity.rs b/contracts/pool_stable/src/tests/liquidity.rs index fe17bcf89..5bd19479d 100644 --- a/contracts/pool_stable/src/tests/liquidity.rs +++ b/contracts/pool_stable/src/tests/liquidity.rs @@ -412,9 +412,7 @@ fn provide_liqudity_too_high_fees() { } #[test] -#[should_panic( - expected = "Pool Stable: ProvideLiquidity: Both tokens must be provided and must be bigger then 0!" -)] +#[should_panic(expected = "value cannot be less than or equal zero")] fn swap_with_no_amounts() { let env = Env::default(); env.mock_all_auths();