Merge branch 'lash/normalize-verify-sig' into 'master'

refactor: Normalize signature verification

See merge request chaintool/chainlib-eth!9
This commit is contained in:
Louis Holbrook 2021-10-18 10:07:03 +00:00
commit 2011ce8bb8
3 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import logging
# external imports # external imports
import eth_tester import eth_tester
import coincurve import coincurve
from chainlib.encode import TxHexNormalizer
from chainlib.connection import ( from chainlib.connection import (
RPCConnection, RPCConnection,
error_parser, error_parser,
@ -184,7 +185,8 @@ class TestRPCConnection(RPCConnection):
pk_bytes = self.backend.keystore.get(tx.sender) pk_bytes = self.backend.keystore.get(tx.sender)
pk = coincurve.PrivateKey(secret=pk_bytes) pk = coincurve.PrivateKey(secret=pk_bytes)
result_address = private_key_to_address(pk) result_address = private_key_to_address(pk)
assert strip_0x(result_address) == strip_0x(tx.sender) tx_normalize = TxHexNormalizer()
assert tx_normalize.wallet_address(strip_0x(result_address)) == tx_normalize.wallet_address(strip_0x(tx.sender))
def sign_transaction(self, tx, passphrase=''): def sign_transaction(self, tx, passphrase=''):

View File

@ -3,5 +3,5 @@ pysha3==1.0.2
hexathon~=0.0.1a8 hexathon~=0.0.1a8
websocket-client==0.57.0 websocket-client==0.57.0
potaahto~=0.0.1a1 potaahto~=0.0.1a1
chainlib==0.0.9a10 chainlib==0.0.9rc1
confini>=0.4.1a1,<0.5.0 confini>=0.4.1a1,<0.5.0

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = chainlib-eth name = chainlib-eth
version = 0.0.9a13 version = 0.0.9rc3
description = Ethereum implementation of the chainlib interface description = Ethereum implementation of the chainlib interface
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no