chainlib-eth

Ethereum implementation of the chainlib interface
Log | Files | Refs | README | LICENSE

commit 53cea0817e854372b789899707776da8a60ef497
parent 5f9634d5a448dd6c27e4d0607ee451d3557748e2
Author: nolash <dev@holbrook.no>
Date:   Sat, 30 Oct 2021 16:49:36 +0200

Fix remaining 0x problems

Diffstat:
Mchainlib/eth/gas.py | 2+-
Mchainlib/eth/nonce.py | 2+-
Mchainlib/eth/runnable/gas.py | 5++++-
Mchainlib/eth/runnable/get.py | 2++
Mrequirements.txt | 2+-
Msetup.cfg | 2+-
6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/chainlib/eth/gas.py b/chainlib/eth/gas.py @@ -55,7 +55,7 @@ def balance(address, id_generator=None, height=BlockSpec.LATEST): j = JSONRPCRequest(id_generator) o = j.template() o['method'] = 'eth_getBalance' - o['params'].append(address) + o['params'].append(add_0x(address)) height = to_blockheight_param(height) o['params'].append(height) return j.finalize(o) diff --git a/chainlib/eth/nonce.py b/chainlib/eth/nonce.py @@ -44,7 +44,7 @@ class NonceOracle(BaseNonceOracle): """ def __init__(self, address, id_generator=None): self.id_generator = id_generator - super(NonceOracle, self).__init__(address) + super(NonceOracle, self).__init__(add_0x(address)) def get_nonce(self): diff --git a/chainlib/eth/runnable/gas.py b/chainlib/eth/runnable/gas.py @@ -26,7 +26,10 @@ from chainlib.eth.gas import Gas from chainlib.eth.gas import balance as gas_balance from chainlib.chain import ChainSpec from chainlib.eth.runnable.util import decode_for_puny_humans -from chainlib.eth.address import is_same_address +from chainlib.eth.address import ( + is_same_address, + is_checksum_address, + ) import chainlib.eth.cli logging.basicConfig(level=logging.WARNING) diff --git a/chainlib/eth/runnable/get.py b/chainlib/eth/runnable/get.py @@ -63,6 +63,7 @@ item = add_0x(args.item) def get_transaction(conn, tx_hash, id_generator): + tx_hash = add_0x(tx_hash) j = JSONRPCRequest(id_generator=id_generator) o = j.template() o['method'] = 'eth_getTransactionByHash' @@ -104,6 +105,7 @@ def get_transaction(conn, tx_hash, id_generator): def get_address(conn, address, id_generator, height): + address = add_0x(address) j = JSONRPCRequest(id_generator=id_generator) o = j.template() o['method'] = 'eth_getCode' diff --git a/requirements.txt b/requirements.txt @@ -3,5 +3,5 @@ pysha3==1.0.2 hexathon~=0.0.1a8 websocket-client==0.57.0 potaahto~=0.0.1a1 -chainlib==0.0.10a9 +chainlib==0.0.10a10 confini>=0.4.2rc3,<0.5.0 diff --git a/setup.cfg b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainlib-eth -version = 0.0.10a18 +version = 0.0.10a20 description = Ethereum implementation of the chainlib interface author = Louis Holbrook author_email = dev@holbrook.no