ape
ape copied to clipboard
Add `recover_signer`
Overview
It'd be nice to have a utility function to return the signer address of a message for verification purposes. Thankfully, eth-account
exposes an easy method for signature verification that we can make even easier.
Specification
Add the following to src/ape/types/signatures.py
:
def recover_signer(msg: SignableMessage, sig: MessageSignature) -> AddressType:
return eth_account.Account.recover_message(msg.signable_message, signature=sig.encode_vrs())
Dependencies
n/a