Skip to content

Commit

Permalink
feat: removing the native balance zero check
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Nov 12, 2024
1 parent a017b75 commit 500b71b
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/handlers/chain_agnostic/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use {
storage::irn::OperationType,
utils::crypto::{
convert_alloy_address_to_h160, decode_erc20_function_type, decode_erc20_transfer_data,
get_balance, get_erc20_balance, get_gas_price, get_nonce, Erc20FunctionType,
get_erc20_balance, get_gas_price, get_nonce, Erc20FunctionType,
},
},
alloy::primitives::{Address, U256},
Expand Down Expand Up @@ -203,21 +203,6 @@ async fn handler_internal(
return Ok(NO_BRIDING_NEEDED_RESPONSE.into_response());
}

// Check the native token balance for the bridging chainId for gas fees paying
let native_token_balance = get_balance(
&bridge_chain_id,
convert_alloy_address_to_h160(from_address),
&query_params.project_id.clone(),
MessageSource::ChainAgnosticCheck,
)
.await?;
if U256::from_be_bytes(native_token_balance.into()) == U256::ZERO {
return Ok(Json(ErrorResponse {
error: BridgingError::InsufficientGasFunds,
})
.into_response());
}

// Get Quotes for the bridging
let quotes = state
.providers
Expand Down

0 comments on commit 500b71b

Please sign in to comment.