Add tx wait method to test rpc
This commit is contained in:
parent
14ccb8d375
commit
ee6c97f581
@ -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
|
||||
|
||||
|
@ -23,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
|
||||
@ -81,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']
|
||||
|
Loading…
Reference in New Issue
Block a user