Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet)_: fix crash on cbridge fee calculation #5178

Merged
merged 1 commit into from
May 20, 2024

Conversation

IvanBelyakoff
Copy link
Contributor

@IvanBelyakoff IvanBelyakoff commented May 17, 2024

Closes #19610

cbridge does not handle such small values, though we pass them correctly:
"{\n \"err\": {\n \"code\": 500,\n \"msg\": \"amount should \\u003e 0\"\n },\n \"eq_value_token_amt\": \"\",\n \"bridge_rate\": 0,\n \"perc_fee\": \"\",\n \"base_fee\": \"\",\n \"slippage_tolerance\": 0,\n \"max_slippage\": 0,\n \"estimated_receive_amt\": \"\",\n \"drop_gas_amt\": \"\",\n \"op_fee_rebate\": 0,\n \"op_fee_rebate_portion\": 0,\n \"op_fee_rebate_end_time\": \"0\"\n}" url="https://cbridge-prod2.celer.app/v2/estimateAmt?src_chain_id=1&dst_chain_id=10&token_symbol=WETH&amt=10000&usr_addr=0xaa47c83316edc05cf9ff7136296b026c5de7eccd&slippage_tolerance=500" amountIn=10000
It returns err, that amount should be > 0 and base_fee and perc_fee are empty, so we can't parse them into a bigInt anf get nil.

@status-im-auto
Copy link
Member

status-im-auto commented May 17, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 2ea8d89 #1 2024-05-17 13:07:59 ~4 min linux 📦zip
✔️ 2ea8d89 #1 2024-05-17 13:08:25 ~4 min ios 📦zip
✔️ 2ea8d89 #1 2024-05-17 13:09:23 ~5 min android 📦aar
✔️ 2ea8d89 #1 2024-05-17 13:48:04 ~44 min tests 📄log

@J-Son89
Copy link
Member

J-Son89 commented May 17, 2024

@IvanBelyakoff - can we include an informative description here?
I understand the issue includes the error, but perhaps you could explain the solution at a high level etc 👍

@IvanBelyakoff
Copy link
Contributor Author

@IvanBelyakoff - can we include an informative description here? I understand the issue includes the error, but perhaps you could explain the solution at a high level etc 👍

done

@IvanBelyakoff IvanBelyakoff merged commit 16171c9 into develop May 20, 2024
9 checks passed
@IvanBelyakoff IvanBelyakoff deleted the fix/crash_cbridge_calculate_fees branch May 20, 2024 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crashes after attempting to send assets with minimum value
4 participants