Skip to content

Commit

Permalink
Revert "fix: add missing return statement"
Browse files Browse the repository at this point in the history
This reverts commit c9d9e12.
  • Loading branch information
z80dev committed Sep 21, 2023
1 parent 37e979e commit f890df7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/ape_test/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@ def alias(self) -> str:
def address(self) -> AddressType:
return self.network_manager.ethereum.decode_address(self.address_str)

def sign_message(self, msg: SignableMessage) -> Optional[MessageSignature]:
signed_msg = EthAccount.sign_message(msg, self.private_key)
return MessageSignature(
v=signed_msg.v,
r=to_bytes(signed_msg.r),
s=to_bytes(signed_msg.s),
)
def sign_message(self, msg: Any, **signer_options) -> Optional[MessageSignature]:
if isinstance(msg, str):
msg = encode_defunct(text=msg)
if isinstance(msg, SignableMessage):
signed_msg = EthAccount.sign_message(msg, self.private_key)
return MessageSignature(
v=signed_msg.v,
r=to_bytes(signed_msg.r),
s=to_bytes(signed_msg.s),
)

def sign_transaction(self, txn: TransactionAPI, **kwargs) -> Optional[TransactionAPI]:
# Signs anything that's given to it
Expand Down

0 comments on commit f890df7

Please sign in to comment.