From 46fecaf8c87bb3cc99361d5bf78d03a5082b849e Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 7 Oct 2021 16:55:23 +0200 Subject: [PATCH] Add normalize tx in verify sig unittest --- chainlib/eth/unittest/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chainlib/eth/unittest/base.py b/chainlib/eth/unittest/base.py index e10d11b..533c168 100644 --- a/chainlib/eth/unittest/base.py +++ b/chainlib/eth/unittest/base.py @@ -5,6 +5,7 @@ import logging # external imports import eth_tester import coincurve +from chainlib.encode import TxHexNormalizer from chainlib.connection import ( RPCConnection, error_parser, @@ -184,7 +185,8 @@ class TestRPCConnection(RPCConnection): pk_bytes = self.backend.keystore.get(tx.sender) pk = coincurve.PrivateKey(secret=pk_bytes) 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=''):