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: expose safe tx eip712 structured data #120

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gnosis/safe/safe_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def safe_version(self) -> str:
return self.contract.functions.VERSION().call()

@property
def safe_tx_hash(self) -> HexBytes:
def eip712_structured_data(self) -> Dict:
data = self.data.hex() if self.data else ""

# Safes >= 1.0.0 Renamed `baseGas` to `dataGas`
Expand Down Expand Up @@ -189,7 +189,11 @@ def safe_tx_hash(self) -> HexBytes:
)
structured_data["domain"]["chainId"] = self.chain_id

return HexBytes(encode_typed_data(structured_data))
return structured_data

@property
def safe_tx_hash(self) -> HexBytes:
return HexBytes(encode_typed_data(self.eip712_structured_data))

@property
def signers(self) -> List[str]:
Expand Down