Merge pull request #125 from status-im/getSenderReturn

Alternative form of getSender that raises and returns address
This commit is contained in:
coffeepots 2018-08-29 18:07:04 +01:00 committed by GitHub
commit 372ea24c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -58,3 +58,7 @@ proc getSender*(transaction: Transaction, output: var EthAddress): bool =
output = pubKey.toCanonicalAddress()
result = true
proc getSender*(transaction: Transaction): EthAddress =
## Raises error on failure to recover public key
if not transaction.getSender(result):
raise newException(ValidationError, "Could not derive sender address from transaction")