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

Port py-eth-sig-utils to eip712-structs #121

Merged
merged 4 commits into from
Nov 5, 2021

Conversation

banteg
Copy link
Contributor

@banteg banteg commented Nov 4, 2021

Followed @Uxio0 suggestion from here #120 (review)

Rewrote EIP712 code of SafeTx to match the library used in Protocol. Removed py-eth-sig-utils dependency.

Copy link
Member

@Uxio0 Uxio0 left a comment

Choose a reason for hiding this comment

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

Very nice PR, what do you think about the change I proposed?

structured_data["domain"]["chainId"] = self.chain_id
if safe_version >= Version("1.0.0"):

class SafeTx(EIP712Struct):
Copy link
Member

@Uxio0 Uxio0 Nov 5, 2021

Choose a reason for hiding this comment

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

I wouldn't define this class in an if, I think it's better to do it at the beginning of the safe_tx.py file. Then define 2 classes, LegacySafeTx and SafeTx and use them on the if clause

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, pushed this change.

@Uxio0 Uxio0 changed the title port py-eth-sig-utils to eip712-structs Port py-eth-sig-utils to eip712-structs Nov 5, 2021
Copy link
Member

@Uxio0 Uxio0 left a comment

Choose a reason for hiding this comment

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

Nice PR, thanks!

@Uxio0 Uxio0 merged commit 7811590 into safe-global:master Nov 5, 2021
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.

None yet

2 participants