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

Decode creation data when using Gelato's relay #2267

Merged
merged 3 commits into from
Oct 22, 2024
Merged

Conversation

Uxio0
Copy link
Member

@Uxio0 Uxio0 commented Oct 18, 2024

@Uxio0 Uxio0 requested a review from a team as a code owner October 18, 2024 14:15
self.assertEqual(
result.initializer,
b"\xb6>\x80\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbd\x89\xa1\xceM\xde6\x8f\xfa\xb0\xec5Pn\xec\xe0\xb1\xff\xdcT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfd\x072\xdc\x9e0?\t\xfc\xef:s\x88\xad\x10\xa84Y\xec\x99\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Z\xfez\x11\xe7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008\x19\xb8\x00\xc6{\xe6@)\xc19<\x8b.\r\rb}\xad\xe2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\xfeQ\xf6C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)\xfc\xb4;FS\x1b\xca\x00=\xdc\x8f\xcbg\xff\xe9\x19\x00\xc7b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
)
Copy link
Member

Choose a reason for hiding this comment

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

This file test contains this long bytes, for me, it makes sense move them to another file to keep the tests more readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, done

@@ -0,0 +1,21 @@
gelato_relay_1_balance_v2_abi = [
Copy link
Member

Choose a reason for hiding this comment

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

Why in the init file? Would be better in a file called gelato_relay_abi.py? In the same file we could keep several versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, done

@@ -229,6 +233,15 @@ def _decode_creation_data(self, data: Union[bytes, str]) -> list[ProxyCreationDa
if not data:
return []

# Try to decode using Gelato Relayer
try:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm wrong but looks like the gelato decoding is not searching the creation data in the provide data.
I mean, it looks like a previous step to prepare the data to be decoded. I'd say that the gelato decoder could be outside of this function _decode_creation_data to prepare the data for it.
Anyway, no strong opinion but at least I would like to update the documentation of this function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, done

@Uxio0
Copy link
Member Author

Uxio0 commented Oct 22, 2024

@moisses89 just applied your suggestions

@Uxio0 Uxio0 merged commit 03b70bd into main Oct 22, 2024
5 checks passed
@Uxio0 Uxio0 deleted the decode-gelato-creation branch October 22, 2024 11:14
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2024
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.

Support transactions created via Gelato relay in /creation endpoint
2 participants