Skip to content

Commit

Permalink
remove unecessary validation (#396)
Browse files Browse the repository at this point in the history
Co-authored-by: James Gaddum <[email protected]>
  • Loading branch information
admin-calculated and GadAlmighty authored Sep 13, 2023
1 parent fb70876 commit f7ae402
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
d06d893f846d9bcd423a21dd02b3a3609d93e1feae54a3e9c2eb09452615b9d4 dca.wasm
c88e1bea9edd0b493ac353ad3cc6ae4fc968cb58d7f6830b84e46a02a1125f17 fin.wasm
12d5dd7c0ff2597d4bb3b69de5509213daa38889dec5b79f493554f66f4dd1e1 dca.wasm
e130d15c8edc46a30947fa04a575648ffc5db2e0c959231332dd7e92f644bb80 fin.wasm
5ee275bfe8f94b2b5e26d30c9cb836086b00f468e0037af3352e8d308679122f osmosis.wasm
4 changes: 2 additions & 2 deletions artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
d13130620e2eba9c753973fe8485a0dbfe030303a5a7f0faca95b07ceb5bef48 target/wasm32-unknown-unknown/release/osmosis.wasm
0320523edf5e4e6d7202ee645fbee73b27b14d75fd2cf792ad944330075f7ad2 target/wasm32-unknown-unknown/release/fin.wasm
152936933105383f6d492aebec4f8d5a385bf15c42cafc71f573272198504b1b target/wasm32-unknown-unknown/release/dca.wasm
3e2036c562ce4fc03387f8ff9d5901d3332ba4482e4bcb2eb8780b06ee58ffd9 target/wasm32-unknown-unknown/release/dca.wasm
f54ee38c6b35a02a3419f1f9bbdc6e94120b4aa0d40bdadbef56b29cdc34a0bc target/wasm32-unknown-unknown/release/fin.wasm
Binary file modified artifacts/dca.wasm
Binary file not shown.
Binary file modified artifacts/fin.wasm
Binary file not shown.
27 changes: 0 additions & 27 deletions contracts/dca/src/handlers/update_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,31 +507,4 @@ mod update_config_tests {
"Error: no more than 10 fee collectors are allowed"
)
}

#[test]
fn with_page_limit_less_than_30_should_fail() {
let mut deps = mock_dependencies();
let info = mock_info(ADMIN, &[]);

instantiate_contract(deps.as_mut(), mock_env(), info.clone());

let err = update_config_handler(
deps.as_mut(),
info,
None,
None,
None,
None,
None,
Some(10),
None,
None,
None,
None,
None,
)
.unwrap_err();

assert_eq!(err.to_string(), "Error: limit cannot be less than 30.")
}
}
6 changes: 1 addition & 5 deletions contracts/dca/src/helpers/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,7 @@ pub fn assert_dca_plus_escrow_level_is_less_than_100_percent(

pub fn assert_page_limit_is_valid(limit: Option<u16>) -> Result<(), ContractError> {
if let Some(limit) = limit {
if limit < 30 {
return Err(ContractError::CustomError {
val: "limit cannot be less than 30.".to_string(),
});
} else if limit > 1000 {
if limit > 1000 {
return Err(ContractError::CustomError {
val: "limit cannot be greater than 1000.".to_string(),
});
Expand Down

0 comments on commit f7ae402

Please sign in to comment.