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: amount to receive #196

Merged
merged 50 commits into from
Jun 11, 2024
Merged

fix: amount to receive #196

merged 50 commits into from
Jun 11, 2024

Conversation

wainola
Copy link
Contributor

@wainola wainola commented May 13, 2024

Description

Fixes displayed amount to receive due to double subtraction over the already subtracted value

Related Issue Or Context

Closes: #192

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in sygma-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

Lykhoyda
Lykhoyda previously approved these changes May 15, 2024
@wainola
Copy link
Contributor Author

wainola commented May 16, 2024

update: as per conversation with @sztok7 I'm going to make a small refactor to avoid the checking and also rely on debounce for the race conditions when building the transfers

@saadjhk saadjhk marked this pull request as draft May 16, 2024 08:46
LyonSsS
LyonSsS previously approved these changes May 23, 2024
Copy link

@LyonSsS LyonSsS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Preview Link - fix passed

Co-authored-by: Filip Štoković <59089574+sztok7@users.noreply.github.com>
Co-authored-by: Filip Štoković <59089574+sztok7@users.noreply.github.com>
@LyonSsS
Copy link

LyonSsS commented Jun 10, 2024

There is still a small issue ongoing as:

STR:

  1. Select Sepolia source and destination Base.
  2. Connect Metmask wallet.
  3. Insert value 25 and then paste the destination EVM address.
  4. Then switch destination to Rococo.
  5. Insert a value destination address and wait for math to update.
  6. Then switch destination to Base one more and wait for math to update.
  7. Then switch destination to Rhala again.
  8. Update the amount to be transfered from 25 to 4 and then insert the destination Rhala Address. Booth action very fast ( <= 1 second).

Exp: The amount to be transferred to be set to the new input ( value 4 - Fee).
Act: The amount to be transferred is calculated based on the initial input - 25.
Switch_Update2

@saadjhk
Copy link
Member

saadjhk commented Jun 11, 2024

There is still a small issue ongoing as:

STR:

  1. Select Sepolia source and destination Base.
  2. Connect Metmask wallet.
  3. Insert value 25 and then paste the destination EVM address.
  4. Then switch destination to Rococo.
  5. Insert a value destination address and wait for math to update.
  6. Then switch destination to Base one more and wait for math to update.
  7. Then switch destination to Rhala again.
  8. Update the amount to be transfered from 25 to 4 and then insert the destination Rhala Address. Booth action very fast ( <= 1 second).

Exp: The amount to be transferred to be set to the new input ( value 4 - Fee). Act: The amount to be transferred is calculated based on the initial input - 25. Switch_Update2 Switch_Update2

We would like to close this PR as this case occurs when a very fast reaction is made from the user, we can open an issue in future if we can easily reproduce this

Copy link

@LyonSsS LyonSsS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified this PR. Works as expected.
Only a small issue with very low chance of occurrence.

@wainola wainola merged commit 8c2cdad into main Jun 11, 2024
4 checks passed
@wainola wainola deleted the fix/amount-to-receive branch June 11, 2024 12:51
@MakMuftic MakMuftic mentioned this pull request Jun 7, 2024
MakMuftic added a commit that referenced this pull request Jun 13, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>@buildwithsygma/sygmaprotocol-react-widget:
0.1.3</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @buildwithsygma/sygmaprotocol-widget bumped to 0.2.0
</details>

<details><summary>sygmaprotocol-widget: 0.2.0</summary>

##
[0.2.0](sygmaprotocol-widget-v0.1.2...sygmaprotocol-widget-v0.2.0)
(2024-06-13)


### Features

* automatically add unknown source evm network into wallet
([#162](#162))
([d5886bd](d5886bd))
* display amount to be received on destination
([#168](#168))
([347f7a5](347f7a5))
* Display Fee
([#145](#145))
([872703d](872703d))
* display transfer gas cost estimation
([#174](#174))
([b154555](b154555))
* enable developers to configure network whitelisting
([#170](#170))
([5db505f](5db505f))
* enable user to specify wallets
([#161](#161))
([8a02170](8a02170))
* Retry loading bridge routes
([#136](#136))
([8e0101f](8e0101f))
* substrate fungible transfer
([#134](#134))
([337f1b7](337f1b7))
* wallet account selector for substrate
([#106](#106))
([79127fd](79127fd)),
closes [#74](#74)


### Bug Fixes

* amount to receive
([#196](#196))
([8c2cdad](8c2cdad))
* destination address format
([#197](#197))
([250ea35](250ea35))
* explorer urls when adding networks
([#200](#200))
([d65d99a](d65d99a))
* Fixed amount to receive decimals
([#208](#208))
([be23500](be23500))
* Gas Fee estimation behavior, is not consistent for the actual transfer
TX ([#204](#204))
([d57233e](d57233e))
* handling transfer cancellation on substrate
([#195](#195))
([6ce25cb](6ce25cb))
* resource name
([#201](#201))
([1215dcc](1215dcc))
* resource selector
([#199](#199))
([81bae38](81bae38))
* small fix for tangle connection
([#212](#212))
([557d71e](557d71e))
* source switch reset
([#206](#206))
([1b1f92c](1b1f92c)),
closes [#205](#205)
* typesafety when handling changed properties
([#141](#141))
([692e269](692e269))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Amount to receive is not correct displayed when using the percentage fee handler
5 participants