chainsyncer

Blockchain syncer driver
Log | Files | Refs | LICENSE

commit b7957b8a0b4583decbe06e95cda42424bc457f41
parent 9aded5c56154e1c0caa1988cadec6e623f19ed9d
Author: lash <dev@holbrook.no>
Date:   Wed, 20 Apr 2022 12:58:50 +0000

Rename syncstate to filterstate

Diffstat:
Mchainsyncer/state/__init__.py | 2+-
Mchainsyncer/state/base.py | 2+-
Mchainsyncer/store/base.py | 4++--
Mtests/test_basic.py | 10+++++-----
4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/chainsyncer/state/__init__.py b/chainsyncer/state/__init__.py @@ -1 +1 @@ -from .base import SyncState +from .base import FilterState diff --git a/chainsyncer/state/base.py b/chainsyncer/state/base.py @@ -10,7 +10,7 @@ logg = logging.getLogger(__name__) re_processedname = r'^_?[A-Z,\.]*$' # TODO: properly clarify interface shared with syncfsstore, move to filter module? -class SyncState: +class FilterState: def __init__(self, state_store, scan=None): self.state_store = state_store diff --git a/chainsyncer/store/base.py b/chainsyncer/store/base.py @@ -4,7 +4,7 @@ import logging # local imports from shep.persist import PersistedState from shep.error import StateInvalid -from chainsyncer.state import SyncState +from chainsyncer.state import FilterState from chainsyncer.error import ( LockError, FilterDone, @@ -165,7 +165,7 @@ class SyncStore: def setup_filter_state(self, factory, event_callback): filter_state_backend = PersistedState(factory.add, 0, check_alias=False, event_callback=event_callback) - self.filter_state = SyncState(filter_state_backend, scan=factory.ls) + self.filter_state = FilterState(filter_state_backend, scan=factory.ls) self.filters = [] diff --git a/tests/test_basic.py b/tests/test_basic.py @@ -6,7 +6,7 @@ import logging # local imports from chainsyncer.session import SyncSession -from chainsyncer.state import SyncState +from chainsyncer.state import FilterState from chainsyncer.store.fs import SyncFsStore from chainsyncer.unittest import ( MockStore, @@ -30,13 +30,13 @@ class TestSync(unittest.TestCase): def test_basic(self): store = MockStore(6) - state = SyncState(store) + state = FilterState(store) session = SyncSession(state) def test_sum(self): store = MockStore(6) - state = SyncState(store) + state = FilterState(store) b = b'\x2a' * 32 fltr = MockFilter('foo', z=b) @@ -57,14 +57,14 @@ class TestSync(unittest.TestCase): def test_session_start(self): store = MockStore(6) - state = SyncState(store) + state = FilterState(store) session = SyncSession(state) session.start() def test_state_dynamic(self): store = MockStore() - state = SyncState(store) + state = FilterState(store) b = b'\x0d' * 32 fltr = MockFilter(name='foo', z=b)