Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
glevco committed Mar 20, 2024
1 parent 59fb234 commit 1f362af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions hathor/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
TransactionRocksDBStorage,
TransactionStorage,
)
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
from hathor.util import Random, get_environment_info, not_none
from hathor.verification.verification_service import VerificationService
from hathor.verification.vertex_verifiers import VertexVerifiers
Expand Down Expand Up @@ -132,7 +131,7 @@ def __init__(self) -> None:
self._tx_storage_cache_capacity: Optional[int] = None

self._indexes_manager: Optional[IndexesManager] = None
self._tx_storage: Optional[BaseTransactionStorage] = None
self._tx_storage: Optional[TransactionStorage] = None
self._event_storage: Optional[EventStorage] = None

self._reactor: Optional[Reactor] = None
Expand Down Expand Up @@ -394,7 +393,7 @@ def _get_or_create_indexes_manager(self) -> IndexesManager:

return self._indexes_manager

def _get_or_create_tx_storage(self) -> BaseTransactionStorage:
def _get_or_create_tx_storage(self) -> TransactionStorage:
indexes = self._get_or_create_indexes_manager()

if self._tx_storage is not None:
Expand Down Expand Up @@ -617,7 +616,7 @@ def enable_event_queue(self) -> 'Builder':
self._enable_event_queue = True
return self

def set_tx_storage(self, tx_storage: BaseTransactionStorage) -> 'Builder':
def set_tx_storage(self, tx_storage: TransactionStorage) -> 'Builder':
self.check_if_can_modify()
self._tx_storage = tx_storage
return self
Expand Down
4 changes: 2 additions & 2 deletions hathor/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from hathor.transaction import BaseTransaction, Block, MergeMinedBlock, Transaction, TxVersion, sum_weights
from hathor.transaction.exceptions import TxValidationError
from hathor.transaction.storage.exceptions import TransactionDoesNotExist
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
from hathor.transaction.storage.transaction_storage import TransactionStorage
from hathor.transaction.storage.tx_allow_scope import TxAllowScope
from hathor.types import Address, VertexId
from hathor.util import EnvironmentInfo, LogDuration, Random, calculate_min_significant_weight, not_none
Expand Down Expand Up @@ -97,7 +97,7 @@ def __init__(self,
consensus_algorithm: ConsensusAlgorithm,
daa: DifficultyAdjustmentAlgorithm,
peer_id: PeerId,
tx_storage: BaseTransactionStorage,
tx_storage: TransactionStorage,
p2p_manager: ConnectionsManager,
event_manager: EventManager,
feature_service: FeatureService,
Expand Down
1 change: 1 addition & 0 deletions hathor/transaction/storage/transaction_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class TransactionStorage(ABC):

pubsub: Optional[PubSubManager]
indexes: Optional[IndexesManager]
_latest_n_height_tips: list[HeightInfo]

log = get_logger()

Expand Down
4 changes: 2 additions & 2 deletions tests/p2p/test_sync_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Trigger,
)
from hathor.transaction.storage import TransactionRocksDBStorage
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
from hathor.transaction.storage.transaction_storage import TransactionStorage
from hathor.transaction.storage.traversal import DFSWalk
from hathor.types import VertexId
from hathor.util import not_none
Expand All @@ -32,7 +32,7 @@ class BaseRandomSimulatorTestCase(SimulatorTestCase):

seed_config = 2

def _get_partial_blocks(self, tx_storage: BaseTransactionStorage) -> set[VertexId]:
def _get_partial_blocks(self, tx_storage: TransactionStorage) -> set[VertexId]:
with tx_storage.allow_partially_validated_context():
partial_blocks = set()
for tx in tx_storage.get_all_transactions():
Expand Down
4 changes: 2 additions & 2 deletions tests/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from hathor.reactor import ReactorProtocol as Reactor, get_global_reactor
from hathor.simulator.clock import MemoryReactorHeapClock
from hathor.transaction import BaseTransaction
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
from hathor.transaction.storage.transaction_storage import TransactionStorage
from hathor.util import Random, not_none
from hathor.wallet import BaseWallet, HDWallet, Wallet
from tests.test_memory_reactor_clock import TestMemoryReactorClock
Expand Down Expand Up @@ -190,7 +190,7 @@ def create_peer( # type: ignore[no-untyped-def]
network: str,
peer_id: PeerId | None = None,
wallet: BaseWallet | None = None,
tx_storage: BaseTransactionStorage | None = None,
tx_storage: TransactionStorage | None = None,
unlock_wallet: bool = True,
wallet_index: bool = False,
capabilities: list[str] | None = None,
Expand Down

0 comments on commit 1f362af

Please sign in to comment.