Skip to content

Commit

Permalink
chore: remove max send amount hook and fees reducer (#5853)
Browse files Browse the repository at this point in the history
### Description

This PR removes the estimated max amount in the FiatExchangeAmount
component, and sets the max amount to the user's token balance. The max
amount estimation only worked for Celo and was inaccurate. Removing this
also allowed removing:
- some unused hooks
- the whole `fees` redux store

The only user flow impacted by this change is the withdraw flow on Celo
(since there was effectively no fee estimation for other networks before
anyway), specifically when a user tries to cash out without leaving
enough balance to pay for gas - most likely when they only have 1 type
of token. For a user in this flow, they will reach the end of the
withdraw flow and not be able to proceed. I'll add an error state
separately.

### Test plan

n/a

### Related issues

- Related to RET-1183

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [ ] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
  • Loading branch information
kathaypacific authored Aug 28, 2024
1 parent a89fed1 commit 2e1bfa0
Show file tree
Hide file tree
Showing 23 changed files with 84 additions and 1,209 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
"svgs": "^4.2.0",
"tslib": "^2.6.3",
"typed-redux-saga": "^1.5.0",
"utf8": "^3.0.0",
"uuid": "^9.0.1",
"victory-native": "^36.9.2",
"viem": "^2.9.28",
Expand Down Expand Up @@ -237,7 +236,6 @@
"@types/redux-mock-store": "^1.0.6",
"@types/seedrandom": "^3.0.5",
"@types/shelljs": "^0.8.11",
"@types/utf8": "^2.1.6",
"@types/uuid": "^9.0.0",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^5.58.0",
Expand Down
1 change: 0 additions & 1 deletion src/app/ErrorMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export enum ErrorMessages {
QR_FAILED_INVALID_ADDRESS = 'qrFailedInvalidAddress',
QR_FAILED_INVALID_RECIPIENT = 'qrFailedInvalidRecipient',
CONTRACT_KIT_INIT_FAILED = 'contractKitInitFailed',
CALCULATE_FEE_FAILED = 'calculateFeeFailed',
ADDRESS_VALIDATION_ERROR = 'addressValidationError',
ADDRESS_VALIDATION_NO_MATCH = 'addressValidationNoMatch',
ADDRESS_VALIDATION_FULL_POORLY_FORMATTED = 'addressValidationFullPoorlyFormatted',
Expand Down
214 changes: 0 additions & 214 deletions src/fees/hooks.test.tsx

This file was deleted.

65 changes: 0 additions & 65 deletions src/fees/hooks.ts

This file was deleted.

72 changes: 0 additions & 72 deletions src/fees/reducer.ts

This file was deleted.

Loading

0 comments on commit 2e1bfa0

Please sign in to comment.