7 Commits

Author SHA1 Message Date
nolash
050b6a9aeb Merge remote-tracking branch 'origin/0.0.10-dev' into lash/args-only 2021-10-11 21:14:15 +02:00
nolash
ee6c97f581 Add tx wait method to test rpc 2021-10-11 21:12:59 +02:00
nolash
9018aefcbe Upgrade chainlib, switch to funga for signer 2021-10-11 18:21:46 +02:00
nolash
dee523bada Add raw args option for tx factory 2021-10-10 17:56:30 +02:00
nolash
14ccb8d375 Bump version and deps 2021-10-10 12:18:11 +02:00
nolash
1c021fae2a Bump version 2021-10-07 16:55:51 +02:00
nolash
46fecaf8c8 Add normalize tx in verify sig unittest 2021-10-07 16:55:23 +02:00
5 changed files with 16 additions and 5 deletions

View File

@@ -41,6 +41,7 @@ class Wallet(BaseWallet):
super(Wallet, self).__init__(EIP155Signer, checksummer=checksummer)
# TODO: how is the keystore implemented in rpc here?
class Rpc(BaseRpc):
"""Convenience constructor to set Ethereum defaults for chainlib cli Rpc object

View File

@@ -299,7 +299,7 @@ class TxFactory:
:param chain_spec: Chain spec to use for signer.
:type chain_spec: chainlib.chain.ChainSpec
:param signer: Signer middleware.
:type param: Object implementing interface ofchainlib.eth.connection.sign_transaction_to_wire
:type param: Object implementing interface of chainlib.eth.connection.sign_transaction_to_wire
:param gas_oracle: Backend to generate gas parameters
:type gas_oracle: Object implementing chainlib.eth.gas.GasOracle interface
:param nonce_oracle: Backend to generate gas parameters
@@ -419,6 +419,8 @@ class TxFactory:
return self.build(tx, id_generator=id_generator)
elif tx_format == TxFormat.RLP_SIGNED:
return self.build_raw(tx)
elif tx_format == TxFormat.RAW_ARGS:
return tx['data']
raise NotImplementedError('tx formatting {} not implemented'.format(tx_format))

View File

@@ -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,
@@ -22,6 +23,7 @@ from hexathon import (
add_0x,
strip_0x,
)
from chainlib.eth.tx import receipt
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
from crypto_dev_signer.encoding import private_key_to_address
@@ -80,6 +82,11 @@ class TestRPCConnection(RPCConnection):
return jsonrpc_result(r, error_parser)
def wait(self, tx_hash_hex):
o = receipt(tx_hash_hex)
return self.do(o)
def eth_blockNumber(self, p):
block = self.backend.get_block_by_number('latest')
return block['number']
@@ -184,7 +191,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=''):

View File

@@ -1,7 +1,7 @@
crypto-dev-signer>=0.4.15a4,<=0.4.15
funga-eth>=0.5.0a1,<0.6.0
pysha3==1.0.2
hexathon~=0.0.1a8
websocket-client==0.57.0
potaahto~=0.0.1a1
chainlib==0.0.9a10
chainlib==0.0.10a1
confini>=0.4.1a1,<0.5.0

View File

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