Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (metamask): add swap decoder #7092

Merged
merged 1 commit into from Dec 15, 2023
Merged

Conversation

OjusWiZard
Copy link
Member

@OjusWiZard OjusWiZard commented Dec 12, 2023

Closes #7022

Add a Metamask decoder to decode the swaps done through Metamask on Ethereum, Polygon, Arbitrum, and Optimism.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (4834796) 71.67% compared to head (976aa8c) 71.75%.
Report is 14 commits behind head on develop.

Files Patch % Lines
...rontend/app/src/components/helper/ExternalLink.vue 98.38% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7092      +/-   ##
===========================================
+ Coverage    71.67%   71.75%   +0.08%     
===========================================
  Files         1217     1218       +1     
  Lines       105449   105422      -27     
  Branches     12261    12266       +5     
===========================================
+ Hits         75578    75646      +68     
+ Misses       28142    28047      -95     
  Partials      1729     1729              
Flag Coverage Δ
frontend_unit 78.07% <99.04%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OjusWiZard OjusWiZard force-pushed the feat/metamask branch 3 times, most recently from 6807ada to 67b49cf Compare December 13, 2023 13:48
@OjusWiZard OjusWiZard marked this pull request as ready for review December 13, 2023 14:22
docs/changelog.rst Outdated Show resolved Hide resolved
rotkehlchen/chain/ethereum/constants.py Outdated Show resolved Hide resolved
rotkehlchen/chain/arbitrum_one/constants.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/tests/unit/decoders/test_metamask.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/constants.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/constants.py Outdated Show resolved Hide resolved
rotkehlchen/tests/unit/decoders/test_metamask.py Outdated Show resolved Hide resolved
rotkehlchen/tests/unit/decoders/test_metamask.py Outdated Show resolved Hide resolved
@OjusWiZard OjusWiZard force-pushed the feat/metamask branch 2 times, most recently from 60456bc to f1bf1be Compare December 14, 2023 19:12
Copy link
Member

@LefterisJP LefterisJP left a comment

Choose a reason for hiding this comment

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

Looking better. Some more comments.

rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved

for event in context.decoded_events:
# Edit the full amount in the swap's receive event
if (
Copy link
Member

Choose a reason for hiding this comment

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

Why did you resolve this? You are still iterating all events to find an event you have already found. The in_event right?

rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
rotkehlchen/chain/evm/decoding/metamask/decoder.py Outdated Show resolved Hide resolved
Signed-off-by: OjusWiZard <ojuswimail@gmail.com>
Copy link
Member

@LefterisJP LefterisJP left a comment

Choose a reason for hiding this comment

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

LGTM

@LefterisJP LefterisJP merged commit f859f25 into rotki:develop Dec 15, 2023
11 of 14 checks passed
@rotkibot
Copy link

rotki/test-caching/tree/feat/metamask was successfully merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support metamask router
3 participants