Skip to content

Commit

Permalink
Removed unneeded normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Sep 15, 2020
1 parent 97d1156 commit 35bd6c2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contracts/cw20-atomic-swap/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ pub fn try_create<S: Storage, A: Api, Q: Querier>(
deps: &mut Extern<S, A, Q>,
env: Env,
msg: CreateMsg,
mut balance: Balance,
balance: Balance,
) -> StdResult<HandleResponse> {
if !is_valid_name(&msg.id) {
return Err(StdError::generic_err("Invalid atomic swap id"));
}

// Normalize coins first
balance.normalize();
// this ignores 0 value coins, must have one or more with positive balance
if balance.is_empty() {
return Err(StdError::generic_err(
"Send some coins to create an atomic swap",
Expand Down

0 comments on commit 35bd6c2

Please sign in to comment.