Skip to content

Commit 20d492d

Browse files
committed
review changes
1 parent da846f4 commit 20d492d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

hathor/builder/builder.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
TransactionRocksDBStorage,
4747
TransactionStorage,
4848
)
49-
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
5049
from hathor.util import Random, get_environment_info, not_none
5150
from hathor.verification.verification_service import VerificationService
5251
from hathor.verification.vertex_verifiers import VertexVerifiers
@@ -132,7 +131,7 @@ def __init__(self) -> None:
132131
self._tx_storage_cache_capacity: Optional[int] = None
133132

134133
self._indexes_manager: Optional[IndexesManager] = None
135-
self._tx_storage: Optional[BaseTransactionStorage] = None
134+
self._tx_storage: Optional[TransactionStorage] = None
136135
self._event_storage: Optional[EventStorage] = None
137136

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

395394
return self._indexes_manager
396395

397-
def _get_or_create_tx_storage(self) -> BaseTransactionStorage:
396+
def _get_or_create_tx_storage(self) -> TransactionStorage:
398397
indexes = self._get_or_create_indexes_manager()
399398

400399
if self._tx_storage is not None:
@@ -617,7 +616,7 @@ def enable_event_queue(self) -> 'Builder':
617616
self._enable_event_queue = True
618617
return self
619618

620-
def set_tx_storage(self, tx_storage: BaseTransactionStorage) -> 'Builder':
619+
def set_tx_storage(self, tx_storage: TransactionStorage) -> 'Builder':
621620
self.check_if_can_modify()
622621
self._tx_storage = tx_storage
623622
return self

hathor/manager.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
from hathor.transaction import BaseTransaction, Block, MergeMinedBlock, Transaction, TxVersion, sum_weights
5959
from hathor.transaction.exceptions import TxValidationError
6060
from hathor.transaction.storage.exceptions import TransactionDoesNotExist
61-
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
61+
from hathor.transaction.storage.transaction_storage import TransactionStorage
6262
from hathor.transaction.storage.tx_allow_scope import TxAllowScope
6363
from hathor.types import Address, VertexId
6464
from hathor.util import EnvironmentInfo, LogDuration, Random, calculate_min_significant_weight, not_none
@@ -97,7 +97,7 @@ def __init__(self,
9797
consensus_algorithm: ConsensusAlgorithm,
9898
daa: DifficultyAdjustmentAlgorithm,
9999
peer_id: PeerId,
100-
tx_storage: BaseTransactionStorage,
100+
tx_storage: TransactionStorage,
101101
p2p_manager: ConnectionsManager,
102102
event_manager: EventManager,
103103
feature_service: FeatureService,

hathor/transaction/storage/transaction_storage.py

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class TransactionStorage(ABC):
7373

7474
pubsub: Optional[PubSubManager]
7575
indexes: Optional[IndexesManager]
76+
_latest_n_height_tips: list[HeightInfo]
7677

7778
log = get_logger()
7879

tests/p2p/test_sync_v2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Trigger,
2020
)
2121
from hathor.transaction.storage import TransactionRocksDBStorage
22-
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
22+
from hathor.transaction.storage.transaction_storage import TransactionStorage
2323
from hathor.transaction.storage.traversal import DFSWalk
2424
from hathor.types import VertexId
2525
from hathor.util import not_none
@@ -32,7 +32,7 @@ class BaseRandomSimulatorTestCase(SimulatorTestCase):
3232

3333
seed_config = 2
3434

35-
def _get_partial_blocks(self, tx_storage: BaseTransactionStorage) -> set[VertexId]:
35+
def _get_partial_blocks(self, tx_storage: TransactionStorage) -> set[VertexId]:
3636
with tx_storage.allow_partially_validated_context():
3737
partial_blocks = set()
3838
for tx in tx_storage.get_all_transactions():

tests/unittest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from hathor.reactor import ReactorProtocol as Reactor, get_global_reactor
2323
from hathor.simulator.clock import MemoryReactorHeapClock
2424
from hathor.transaction import BaseTransaction
25-
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
25+
from hathor.transaction.storage.transaction_storage import TransactionStorage
2626
from hathor.util import Random, not_none
2727
from hathor.wallet import BaseWallet, HDWallet, Wallet
2828
from tests.test_memory_reactor_clock import TestMemoryReactorClock
@@ -190,7 +190,7 @@ def create_peer( # type: ignore[no-untyped-def]
190190
network: str,
191191
peer_id: PeerId | None = None,
192192
wallet: BaseWallet | None = None,
193-
tx_storage: BaseTransactionStorage | None = None,
193+
tx_storage: TransactionStorage | None = None,
194194
unlock_wallet: bool = True,
195195
wallet_index: bool = False,
196196
capabilities: list[str] | None = None,

0 commit comments

Comments
 (0)