4
0
mirror of git://holbrook.no/eth-monitor.git synced 2024-11-18 19:06:45 +01:00
eth-monitor/eth_monitor/chain.py

27 lines
849 B
Python
Raw Normal View History

2021-06-26 14:04:34 +02:00
# external imports
from chainlib.interface import ChainInterface
from chainlib.eth.block import (
2022-05-10 16:21:49 +02:00
block_latest,
2021-06-26 14:04:34 +02:00
block_by_number,
Block,
)
from chainlib.eth.tx import (
receipt,
Tx,
transaction,
2021-06-26 14:04:34 +02:00
)
class EthChainInterface(ChainInterface):
2023-08-06 15:10:59 +02:00
def __init__(self, dialect_filter=None, batch_limit=1):
super(EthChainInterface, self).__init__(dialect_filter=dialect_filter, batch_limit=batch_limit)
2023-08-06 15:10:59 +02:00
self.batch_limit = batch_limit
2022-05-10 16:21:49 +02:00
self._block_latest = block_latest
2021-06-26 14:04:34 +02:00
self._block_by_number = block_by_number
self._block_from_src = Block.from_src
self._tx_from_src = Tx.from_src
2021-06-26 14:04:34 +02:00
self._tx_receipt = receipt
self._src_normalize = Tx.src_normalize
self._dialect_filter = dialect_filter
self._tx_by_hash = transaction