Rename syncstate to filterstate

This commit is contained in:
lash 2022-04-20 12:58:50 +00:00
parent 9aded5c561
commit b7957b8a0b
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
from .base import SyncState
from .base import FilterState

View File

@ -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

View File

@ -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 = []

View File

@ -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)