Split up backend modules

This commit is contained in:
nolash
2021-04-10 00:30:08 +02:00
parent 3b40f0e6f6
commit 7f0936b3e4
7 changed files with 62 additions and 55 deletions

View File

@@ -5,7 +5,7 @@ import unittest
from chainlib.chain import ChainSpec
# local imports
from chainsyncer.backend import SyncerBackend
from chainsyncer.backend.memory import MemBackend
# testutil imports
from tests.base import TestBase
@@ -15,7 +15,7 @@ class TestBasic(TestBase):
def test_hello(self):
chain_spec = ChainSpec('evm', 'bloxberg', 8996, 'foo')
backend = SyncerBackend(chain_spec, 'foo')
backend = MemBackend(chain_spec, 'foo')
if __name__ == '__main__':

View File

@@ -8,7 +8,7 @@ from chainlib.chain import ChainSpec
# local imports
from chainsyncer.db.models.base import SessionBase
from chainsyncer.db.models.filter import BlockchainSyncFilter
from chainsyncer.backend import SyncerBackend
from chainsyncer.backend.sql import SyncerBackend
# testutil imports
from tests.base import TestBase
@@ -67,6 +67,7 @@ class TestDatabase(TestBase):
session.close()
def test_backend_retrieve(self):
s = SyncerBackend.live(self.chain_spec, 42)
s.register_filter('foo')

View File

@@ -9,7 +9,7 @@ import shutil
from chainlib.chain import ChainSpec
# local imports
from chainsyncer.backend_file import SyncerFileBackend
from chainsyncer.backend.file import SyncerFileBackend
logging.basicConfig(level=logging.DEBUG)
logg = logging.getLogger().getChild(__name__)