From 5d70550e8b4becb3f4efdb4e8ccee0e423b64251 Mon Sep 17 00:00:00 2001 From: lash Date: Mon, 9 May 2022 19:27:20 +0000 Subject: [PATCH] Revert "Implement mocks on generic tx, block" This reverts commit dd1879bb91ae2d99aae94bd2c5d2e447ea91dd29. --- chaind/filter.py | 2 +- chaind/unittest/common.py | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/chaind/filter.py b/chaind/filter.py index b143b91..1e5386f 100644 --- a/chaind/filter.py +++ b/chaind/filter.py @@ -115,7 +115,7 @@ class StateFilter(SyncFilter): queue_adapter = self.__get_adapter(block, force_reload=True) continue - logg.info('filter registered {} for {} in {}'.format(tx.status_name, tx.hash, block)) + logg.info('filter registered {} for {} in {}'.format(tx.status.name, tx.hash, block)) if self.throttler != None: self.throttler.dec(tx.hash) diff --git a/chaind/unittest/common.py b/chaind/unittest/common.py index 949fd90..39e389d 100644 --- a/chaind/unittest/common.py +++ b/chaind/unittest/common.py @@ -7,11 +7,6 @@ from chainqueue.cache import CacheTokenTx from chainlib.status import Status as TxStatus from chainlib.chain import ChainSpec from chainlib.error import RPCException -from chainlib.tx import ( - Tx, - TxResult, - ) -from chainlib.block import Block class MockCacheAdapter(CacheTokenTx): @@ -39,17 +34,14 @@ class MockDispatcher: pass -class MockTx(Tx): +class MockTx: def __init__(self, tx_hash, status=TxStatus.SUCCESS): - result = TxResult() - result.status = status - super(MockTx, self).__init__(result=result) - self.set_hash(tx_hash) + self.hash = tx_hash + self.status = status -class MockBlock(Block): +class MockBlock: def __init__(self, number): - super(MockBlock, self).__init__() self.number = number