Compare commits
7 Commits
lash/cli-e
...
lash/args-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
050b6a9aeb | ||
|
|
ee6c97f581
|
||
|
|
9018aefcbe
|
||
|
|
dee523bada
|
||
|
|
14ccb8d375
|
||
|
|
1c021fae2a
|
||
|
|
46fecaf8c8
|
@@ -41,6 +41,7 @@ class Wallet(BaseWallet):
|
|||||||
super(Wallet, self).__init__(EIP155Signer, checksummer=checksummer)
|
super(Wallet, self).__init__(EIP155Signer, checksummer=checksummer)
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: how is the keystore implemented in rpc here?
|
||||||
class Rpc(BaseRpc):
|
class Rpc(BaseRpc):
|
||||||
"""Convenience constructor to set Ethereum defaults for chainlib cli Rpc object
|
"""Convenience constructor to set Ethereum defaults for chainlib cli Rpc object
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ class TxFactory:
|
|||||||
:param chain_spec: Chain spec to use for signer.
|
:param chain_spec: Chain spec to use for signer.
|
||||||
:type chain_spec: chainlib.chain.ChainSpec
|
:type chain_spec: chainlib.chain.ChainSpec
|
||||||
:param signer: Signer middleware.
|
: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
|
:param gas_oracle: Backend to generate gas parameters
|
||||||
:type gas_oracle: Object implementing chainlib.eth.gas.GasOracle interface
|
:type gas_oracle: Object implementing chainlib.eth.gas.GasOracle interface
|
||||||
:param nonce_oracle: Backend to generate gas parameters
|
:param nonce_oracle: Backend to generate gas parameters
|
||||||
@@ -419,6 +419,8 @@ class TxFactory:
|
|||||||
return self.build(tx, id_generator=id_generator)
|
return self.build(tx, id_generator=id_generator)
|
||||||
elif tx_format == TxFormat.RLP_SIGNED:
|
elif tx_format == TxFormat.RLP_SIGNED:
|
||||||
return self.build_raw(tx)
|
return self.build_raw(tx)
|
||||||
|
elif tx_format == TxFormat.RAW_ARGS:
|
||||||
|
return tx['data']
|
||||||
raise NotImplementedError('tx formatting {} not implemented'.format(tx_format))
|
raise NotImplementedError('tx formatting {} not implemented'.format(tx_format))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -22,6 +23,7 @@ from hexathon import (
|
|||||||
add_0x,
|
add_0x,
|
||||||
strip_0x,
|
strip_0x,
|
||||||
)
|
)
|
||||||
|
from chainlib.eth.tx import receipt
|
||||||
|
|
||||||
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
|
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
|
||||||
from crypto_dev_signer.encoding import private_key_to_address
|
from crypto_dev_signer.encoding import private_key_to_address
|
||||||
@@ -80,6 +82,11 @@ class TestRPCConnection(RPCConnection):
|
|||||||
return jsonrpc_result(r, error_parser)
|
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):
|
def eth_blockNumber(self, p):
|
||||||
block = self.backend.get_block_by_number('latest')
|
block = self.backend.get_block_by_number('latest')
|
||||||
return block['number']
|
return block['number']
|
||||||
@@ -184,7 +191,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=''):
|
||||||
|
|||||||
@@ -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
|
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.10a1
|
||||||
confini>=0.4.1a1,<0.5.0
|
confini>=0.4.1a1,<0.5.0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = chainlib-eth
|
name = chainlib-eth
|
||||||
version = 0.0.9a13
|
version = 0.0.10a2
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user