-
-
Notifications
You must be signed in to change notification settings - Fork 633
Add decoders for balancer swaps and mints/burns #5197
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
Conversation
a0657c4
to
eef4867
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for rebasing it @nebolax ! It was really helpful. Just minor details and I noticed that is missing the accounting file. Can you also add it?
# otherwise this is the event that we have to edit | ||
event.event_type = HistoryEventType.STAKING | ||
event.event_subtype = HistoryEventSubType.RECEIVE_WRAPPED | ||
event.counterparty = CPT_BALANCER_V2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this method the counterparty is wrong, it should be balancer v1
Codecov Report
@@ Coverage Diff @@
## develop #5197 +/- ##
===========================================
- Coverage 71.73% 71.72% -0.02%
===========================================
Files 945 946 +1
Lines 71185 71255 +70
Branches 9009 9123 +114
===========================================
+ Hits 51068 51107 +39
- Misses 18559 18590 +31
Partials 1558 1558
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
eef4867
to
c59c745
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
c2e1811
to
1748219
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left more comments
extra_data={ | ||
'ds_address': ds_address, | ||
'token_address': token_address, | ||
'amount': amount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why keep the amount here? The ActionItem
has an amount field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved it. Due to this change I had to add a new type in the action items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved what? This is still here.
to_notes=None, | ||
extra_data={ | ||
'ds_address': ds_address, | ||
'token_address': token_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep it at the asset
of the ActionItem
? Do you specifically need an address or an asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have not answered this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed this function to return a dictionary instead. I was using actions before because of how I was working with the events but saw that it could be done easier just calling the logic in the _decode_v1_pool_event
function. It doesn't need and it shouldn't be an action
1748219
to
605462b
Compare
605462b
to
0a6f3c2
Compare
0a6f3c2
to
251b141
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments
to_notes=None, | ||
extra_data={ | ||
'ds_address': ds_address, | ||
'token_address': token_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have not answered this
extra_data={ | ||
'ds_address': ds_address, | ||
'token_address': token_address, | ||
'amount': amount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved what? This is still here.
event.event_type = HistoryEventType.TRADE | ||
if asset == event.asset: | ||
event.event_subtype = HistoryEventSubType.RECEIVE | ||
event.notes = f'Receive {event.balance.amount} {asset.symbol} in Balancer v2 from {event.location_label}' # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has remained unchanged and my question has not been answered. Please try to appreciate the time I am putting in the reviews and read them
self, | ||
token: 'EvmToken', | ||
tx_log: EvmTxReceiptLog, # pylint: disable=unused-argument | ||
transaction: EvmTransaction, # pylint: disable=unused-argument | ||
event: HistoryBaseEntry, | ||
action_items: list[ActionItem], # pylint: disable=unused-argument | ||
all_logs: list[EvmTxReceiptLog], | ||
) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire function declaration needs indentation
251b141
to
ba42a4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
- The failed test is avalanche
- The single comment can be done whenever.
When you do the comment also please add a changelog entry for proper decoding of balancer transactions.
self.weth = A_WETH.resolve_to_evm_token() | ||
|
||
def _decode_v1_pool_event(self, all_logs: list[EvmTxReceiptLog]) -> Optional[list[dict[str, Any]]]: # noqa: E501 | ||
"""Read the list of logs in search for a Balancer v1 event and return the information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: sorry did not see that in the last run
"""Read the list of logs in search for a Balancer v1 event and return the information | |
"""Read the list of logs in search of a Balancer v1 event and return the information |
Closes #(issue_number)
Checklist