sygmaprotocol / sygma-widget

Transfer widget for the sygmaprotocol
5 stars 2 forks source link

fix: amount to receive #196

Closed wainola closed 5 months ago

wainola commented 6 months ago

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

Checklist:

wainola commented 6 months ago

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

LyonSsS commented 5 months ago

Currently there are 2 issues on it:

  1. Source Substrate it breaks after using it several time image STR:

  2. Select source Rahala

  3. Destination Sepolia

  4. Select SygUSDC as token

  5. Fill in destination wallet.

  6. Fill in amount.

  7. After switching to many times the input value, it will lose track to update image This issue is not consistent and does not have 100% chance to replicate. amount_toSend

LyonSsS commented 5 months ago

Re tested and there is still an issue: When switching to a new network source, that requires the user to reset the token type drop down, if the user inputs a 2 digit number very fast, the "Amount to receive:" is only going to be calculated only from the first digit number. See gif below switch_2Digits

LyonSsS commented 5 months ago

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

saadahmsiddiqui commented 5 months ago

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