Fix remaining 0x problems

This commit is contained in:
nolash 2021-10-30 16:49:36 +02:00
parent 5f9634d5a4
commit 53cea0817e
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 10 additions and 5 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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'

View File

@ -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

View File

@ -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