Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Fix an issue with ERC20 info when using EIP 1559 transactions #654

Merged
merged 3 commits into from
Sep 6, 2021

Conversation

FrederikBolding
Copy link
Contributor

@FrederikBolding FrederikBolding commented Sep 2, 2021

This should fix an issue where ERC20 information wasn't provided to the Ledger when using EIP 1559 transactions!

Looks to work, but might need a sanity check 😄

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #654 (a3dcb89) into master (3c16bd2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head a3dcb89 differs from pull request most recent head 943a921. Consider uploading reports for the commit 943a921 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
+ Coverage   40.91%   40.93%   +0.02%     
==========================================
  Files          74       74              
  Lines        4407     4409       +2     
  Branches      721      723       +2     
==========================================
+ Hits         1803     1805       +2     
- Misses       2587     2590       +3     
+ Partials       17       14       -3     
Impacted Files Coverage Δ
packages/hw-app-eth/src/Eth.ts 85.02% <100.00%> (+0.06%) ⬆️
packages/hw-transport-http/src/HttpTransport.ts 0.00% <0.00%> (ø)
...ckages/hw-transport-http/src/WebSocketTransport.ts 0.00% <0.00%> (ø)
...s/react-native-hw-transport-ble/src/awaitsBleOn.ts 0.00% <0.00%> (ø)

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 3c16bd2...943a921. Read the comment docs.

Copy link
Contributor

@pscott pscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Moving the decodedTx up and putting the chainId in it is indeed a proper way to deal with this.

Left a single request for change :D

decodedTx = {
data: rlpDecoded[5],
to: rlpDecoded[3],
chainId: rlpTx[6],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rlpTx[6] is only valid for post EIP-155 transactions (see https://eips.ethereum.org/EIPS/eip-155)
If rlpTx.length < 6 then the chainId should default to 1 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change 👍

@gre gre merged commit 6ba1f9a into LedgerHQ:master Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants