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) #1957

Closed ghost closed 2 years ago

ghost 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 16, 2022 at 10:26AM (UTC)
codecov[bot] commented 2 years ago

Codecov Report

Merging #1957 (e49c371) into develop (5b012ce) will increase coverage by 5.09%. The diff coverage is 79.16%.

@@             Coverage Diff             @@
##           develop    #1957      +/-   ##
===========================================
+ Coverage    55.20%   60.30%   +5.09%     
===========================================
  Files          451      546      +95     
  Lines        20443    23436    +2993     
  Branches      5255     6068     +813     
===========================================
+ Hits         11286    14132    +2846     
- Misses        9128     9278     +150     
+ Partials        29       26       -3     
Impacted Files Coverage Δ
src/families/polkadot/js-getTransactionStatus.ts 45.39% <50.00%> (+37.39%) :arrow_up:
src/families/polkadot/js-signOperation.ts 77.14% <60.00%> (+43.34%) :arrow_up:
src/families/polkadot/specs.ts 67.94% <87.50%> (+43.29%) :arrow_up:
src/families/polkadot/logic.ts 68.68% <100.00%> (+23.78%) :arrow_up:
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%> (-75.39%) :arrow_down:
src/families/bitcoin/networks.ts 5.88% <0.00%> (-74.51%) :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:
... and 344 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 5b012ce...e49c371. Read the comment docs.

ghost commented 2 years ago

Bot says :heavy_check_mark: !