Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
Move db settings from utils to child chain
Browse files Browse the repository at this point in the history
  • Loading branch information
bun919tw committed Aug 21, 2018
1 parent 6e1c634 commit d5a8d7a
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions plasma_cash/dependency_config.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import os

from plasma_cash.child_chain.child_chain import ChildChain
from plasma_cash.child_chain.db.leveldb import LevelDb
from plasma_cash.child_chain.db.memory_db import MemoryDb
from plasma_cash.client.child_chain_client import ChildChainClient
from plasma_cash.config import PROJECT_DIR, db_config, plasma_config
from plasma_cash.root_chain.deployer import Deployer
from plasma_cash.utils.db.leveldb import LevelDb
from plasma_cash.utils.db.memory_db import MemoryDb


class DependencyContainer(object):
def __init__(self):
self._root_chain = None
self._child_chain = None
self._child_chain_client = None
self._client = None
self._db = None

def get_db(self):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from mockito import ANY, when

from plasma_cash.child_chain.block import Block
from plasma_cash.utils.db.exceptions import BlockAlreadyExistsException
from plasma_cash.utils.db.leveldb import LevelDb
from plasma_cash.child_chain.db.exceptions import BlockAlreadyExistsException
from plasma_cash.child_chain.db.leveldb import LevelDb
from unit_tests.unstub_mixin import UnstubMixin


Expand Down Expand Up @@ -35,7 +35,7 @@ class TestLevelDb(UnstubMixin):
@pytest.fixture(scope='function')
def db(self):
db = FakeLevelDb()
(when('plasma_cash.utils.db.leveldb.plyvel')
(when('plasma_cash.child_chain.db.leveldb.plyvel')
.DB(ANY, create_if_missing=True).thenReturn(db))
return LevelDb('test_db')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from plasma_cash.utils.db.exceptions import BlockAlreadyExistsException
from plasma_cash.utils.db.memory_db import MemoryDb
from plasma_cash.child_chain.db.exceptions import BlockAlreadyExistsException
from plasma_cash.child_chain.db.memory_db import MemoryDb


class TestMemoryDb(object):
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/child_chain/test_child_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from plasma_cash.child_chain.block import Block
from plasma_cash.child_chain.child_chain import ChildChain
from plasma_cash.child_chain.db.memory_db import MemoryDb
from plasma_cash.child_chain.exceptions import (InvalidBlockNumException,
InvalidBlockSignatureException,
InvalidTxSignatureException,
Expand All @@ -15,7 +16,6 @@
TxAmountMismatchException,
TxWithSameUidAlreadyExists)
from plasma_cash.child_chain.transaction import Transaction
from plasma_cash.utils.db.memory_db import MemoryDb
from unit_tests.unstub_mixin import UnstubMixin


Expand Down

0 comments on commit d5a8d7a

Please sign in to comment.