Aptoide / appcoins-wallet-android

AppCoins Wallet repo
https://appcoins.io
GNU General Public License v3.0
75 stars 45 forks source link

[MOB-587] - Wallet now checks for enough allowance to decide if appro… #785

Closed FredericoSantinho closed 4 years ago

FredericoSantinho commented 4 years ago

What does this PR do?

The purpose of this PR is to check whether an approve transaction is needed to allow a buy transaction. When the allowance is enough to execute the buy, no approve should occur. Otherwise, an approve with the value 0 must be done before making the right approve followed by the buy call.

Database changed?

No

Where should the reviewer start?

How should this be manually tested?

Force an approve with a value greater or equal to the one needed by the buy call, then start the purchase flow, only the buy call should be sent to the blockchain. Do the same with a value lesser than the one needed for the buy. An approve with 0 followed by the right approve and a buy should occur.

What are the relevant tickets?

Tickets related to this pull-request: MOB-587

Questions:

Does this add new dependencies which need to be added? (Eg. new libs, new keys, etc.)

No

Code Review Checklist