LedgerHQ / ledger-live-common

⛔️ DEPRECATED - Common ground for the Ledger Wallet apps
http://ledger-live-tools.now.sh
Apache License 2.0
136 stars 171 forks source link

LIVE-1292 Cover Polkadot existential deposit edge case #1953

Closed alexalouit closed 2 years ago

alexalouit commented 2 years ago

Context (issues, jira)

https://ledgerhq.atlassian.net/browse/LIVE-1292

Description / Usage

When trying to emptied an account, it doesn't work. This happens when the balance is at ~1 DOT, this is a limitation of the Polkadot blockchain. The logic of Ledger Live Common was not adapted, this PR fix this.

This PR also contains a fix on the optimistic operation which does not contain the correct type when it is a send max.

Expectations

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ledger-live-common ✅ Ready (Inspect) Visit Preview May 12, 2022 at 9:36AM (UTC)
codecov[bot] commented 2 years ago

Codecov Report

Merging #1953 (26de976) into develop (5b8d2fc) will decrease coverage by 9.67%. The diff coverage is 12.50%.

:exclamation: Current head 26de976 differs from pull request most recent head 437622f. Consider uploading reports for the commit 437622f to get more accurate results

@@             Coverage Diff             @@
##           develop    #1953      +/-   ##
===========================================
- Coverage    69.14%   59.46%   -9.68%     
===========================================
  Files          545      510      -35     
  Lines        23534    21132    -2402     
  Branches      6194     5693     -501     
===========================================
- Hits         16273    12567    -3706     
- Misses        7219     8543    +1324     
+ Partials        42       22      -20     
Impacted Files Coverage Δ
src/families/polkadot/js-getTransactionStatus.ts 7.89% <0.00%> (-0.11%) :arrow_down:
src/families/polkadot/js-signOperation.ts 24.28% <0.00%> (-9.52%) :arrow_down:
src/families/polkadot/logic.ts 34.34% <100.00%> (-15.66%) :arrow_down:
src/families/bitcoin/networks.ts 5.88% <0.00%> (-82.36%) :arrow_down:
src/families/crypto_org/api/sdk.ts 16.85% <0.00%> (-78.66%) :arrow_down:
src/families/celo/hw-app-celo.ts 3.38% <0.00%> (-77.97%) :arrow_down:
src/families/bitcoin/js-signOperation.ts 21.53% <0.00%> (-76.93%) :arrow_down:
src/families/celo/js-getFeesForTransaction.ts 26.66% <0.00%> (-73.34%) :arrow_down:
src/hw/signTransaction/ripple.ts 27.27% <0.00%> (-72.73%) :arrow_down:
src/families/celo/js-buildTransaction.ts 27.27% <0.00%> (-72.73%) :arrow_down:
... and 173 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5b8d2fc...437622f. Read the comment docs.