Skip to content

Commit

Permalink
fix: keyfile accounts now properly handling signablemessage
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Nov 28, 2023
1 parent 6057c3f commit e04a794
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ape_accounts/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,12 @@ def sign_message(self, msg: Any, **signer_options) -> Optional[MessageSignature]

# Convert EIP712Message to SignableMessage for handling below
msg = msg.signable_message
elif isinstance(msg, SignableMessage):
user_approves = self.__autosign or click.confirm(f"{msg}\n\nSign: ")
else:
logger.warning("Unsupported message type, (type=%r, msg=%r)", type(msg), msg)
return None

# msg should be a SignableMessage at this point
if isinstance(msg, SignableMessage):
user_approves = self.__autosign or click.confirm(f"{msg}\n\nSign: ")

if not user_approves:
return None
signed_msg = EthAccount.sign_message(msg, self.__key)
Expand Down

0 comments on commit e04a794

Please sign in to comment.