commit ee6c97f581c4ac7d92fcf38cf47de9060239c824
parent 14ccb8d375515f329fd31abd339ada409e42f17e
Author: nolash <dev@holbrook.no>
Date: Mon, 11 Oct 2021 21:12:59 +0200
Add tx wait method to test rpc
Diffstat:
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/chainlib/eth/cli.py b/chainlib/eth/cli.py
@@ -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
diff --git a/chainlib/eth/unittest/base.py b/chainlib/eth/unittest/base.py
@@ -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']