mirror of
git://holbrook.no/eth-monitor.git
synced 2024-12-21 23:07:31 +01:00
Implement and expose dialect filters for chain interface
This commit is contained in:
parent
d36b3ed673
commit
10e16dcb00
@ -1,3 +1,6 @@
|
||||
- 0.8.5
|
||||
* Instantiate constructor for chain interface superclass
|
||||
* Remove unused settings transform method for sync interface
|
||||
- 0.8.4
|
||||
* Update man pages with rpc batch limit setting
|
||||
- 0.8.3
|
||||
|
@ -8,15 +8,19 @@ from chainlib.eth.block import (
|
||||
from chainlib.eth.tx import (
|
||||
receipt,
|
||||
Tx,
|
||||
transaction,
|
||||
)
|
||||
|
||||
class EthChainInterface(ChainInterface):
|
||||
|
||||
def __init__(self, dialect_filter=None, batch_limit=1):
|
||||
super(EthChainInterface, self).__init__(dialect_filter=dialect_filter, batch_limit=batch_limit)
|
||||
self.batch_limit = batch_limit
|
||||
self._block_latest = block_latest
|
||||
self._block_by_number = block_by_number
|
||||
self._block_from_src = Block.from_src
|
||||
self._tx_from_src = Tx.from_src
|
||||
self._tx_receipt = receipt
|
||||
self._src_normalize = Tx.src_normalize
|
||||
self._dialect_filter = dialect_filter
|
||||
self._tx_by_hash = transaction
|
||||
|
@ -356,22 +356,11 @@ def process_cache_rpc(settings, config):
|
||||
return settings
|
||||
|
||||
|
||||
def process_sync_interface(settings, config):
|
||||
ifc = EthChainInterface(dialect=settings.get('RPC_DIALECT_FILTER'))
|
||||
settings.set('SYNCER_INTERFACE', ifc)
|
||||
return settings
|
||||
|
||||
|
||||
def process_sync(settings, config):
|
||||
dialect_filter = settings.get('RPC_DIALECT_FILTER')
|
||||
settings.set('SYNCER_INTERFACE', EthChainInterface(dialect_filter=dialect_filter, batch_limit=settings.get('RPC_BATCH_LIMIT')))
|
||||
settings = process_sync_range(settings, config)
|
||||
return settings
|
||||
#def process_sync(settings, config):
|
||||
# settings = process_sync_interface(settings, config)
|
||||
# settings = process_sync_backend(settings, config)
|
||||
# settings = process_sync_range(settings, config)
|
||||
# return settings
|
||||
|
||||
|
||||
def process_cache(settings, config):
|
||||
|
@ -1,6 +1,6 @@
|
||||
chainlib-eth~=0.5.0
|
||||
chainlib~=0.5.1
|
||||
chainsyncer~=0.8.2
|
||||
chainlib-eth~=0.5.1
|
||||
chainlib~=0.5.2
|
||||
chainsyncer~=0.8.3
|
||||
leveldir~=0.3.0
|
||||
eth-cache~=0.3.0
|
||||
confini~=0.6.3
|
||||
|
Loading…
Reference in New Issue
Block a user