Skip to content

Commit

Permalink
terra/token-bridge: simplify conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
kcsongor committed Dec 12, 2023
1 parent 19c9543 commit 74286d2
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions terra/contracts/token-bridge/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,30 +681,18 @@ fn handle_complete_transfer(
relayer_address: &HumanAddr,
) -> StdResult<Response> {
let transfer_info = TransferInfo::deserialize(data)?;
if transfer_info.token_chain == CHAIN_ID {
if is_native_id(transfer_info.token_address.as_slice()) {
handle_complete_transfer_token_native(
deps,
env,
info,
emitter_chain,
emitter_address,
transfer_type,
data,
relayer_address,
)
} else {
handle_complete_transfer_token(
deps,
env,
info,
emitter_chain,
emitter_address,
transfer_type,
data,
relayer_address,
)
}
if transfer_info.token_chain == CHAIN_ID && is_native_id(transfer_info.token_address.as_slice())
{
handle_complete_transfer_token_native(
deps,
env,
info,
emitter_chain,
emitter_address,
transfer_type,
data,
relayer_address,
)
} else {
handle_complete_transfer_token(
deps,
Expand Down

0 comments on commit 74286d2

Please sign in to comment.