Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ isort:

proto_dir = ./hathor/protos
proto_srcs = $(wildcard $(proto_dir)/*.proto)
proto_outputs = $(patsubst %.proto,%_pb2.py,$(proto_srcs)) $(patsubst %.proto,%_pb2_grpc.py,$(proto_srcs)) $(patsubst %.proto,%_pb2.pyi,$(proto_srcs))
proto_srcs_old = $(proto_dir)/transaction_storage.proto
proto_outputs = $(patsubst %.proto,%_pb2.py,$(proto_srcs)) $(patsubst %.proto,%_pb2.pyi,$(proto_srcs))
proto_outputs_old = $(patsubst %.proto,%_pb2_grpc.py,$(proto_srcs) $(proto_srcs_old))
GRPC_TOOLS_VERSION = "$(shell python -m grpc_tools.protoc --version 2>/dev/null || true)"
#ifdef GRPC_TOOLS_VERSION
ifneq ($(GRPC_TOOLS_VERSION),"")
Expand All @@ -94,8 +96,6 @@ endif
# all proto_srcs are added as deps so when a change on any of them triggers all to be rebuilt
%_pb2.pyi %_pb2.py: %.proto $(proto_srcs)
$(protoc) -I. --python_out=. --mypy_out=. $<
%_pb2_grpc.py: %.proto $(proto_srcs)
$(protoc) -I. --grpc_python_out=. $< || true

.PHONY: protos
protos: $(proto_outputs)
Expand All @@ -104,7 +104,7 @@ protos: $(proto_outputs)

.PHONY: clean-protos
clean-protos:
rm -f $(proto_outputs)
rm -f $(proto_outputs) $(proto_outputs_old)

.PHONY: clean-pyc
clean-pyc:
Expand Down
94 changes: 0 additions & 94 deletions hathor/protos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,56 +22,6 @@
TxInput,
TxOutput,
)
from hathor.protos.transaction_storage_pb2 import (
ANY_ORDER,
ANY_TYPE,
ASC_ORDER,
BLOCK_TYPE,
FOR_CACHING,
LEFT_RIGHT_ORDER_CHILDREN,
LEFT_RIGHT_ORDER_SPENT,
NO_FILTER,
ONLY_NEWER,
ONLY_OLDER,
TOPOLOGICAL_ORDER,
TRANSACTION_TYPE,
AddValueRequest,
CountRequest,
CountResponse,
Empty,
ExistsRequest,
ExistsResponse,
FirstTimestampRequest,
FirstTimestampResponse,
GetRequest,
GetResponse,
GetValueRequest,
GetValueResponse,
Interval,
LatestTimestampRequest,
LatestTimestampResponse,
ListItemResponse,
ListNewestRequest,
ListRequest,
ListTipsRequest,
MarkAsRequest,
MarkAsResponse,
RemoveRequest,
RemoveResponse,
RemoveValueRequest,
SaveRequest,
SaveResponse,
SortedTxsRequest,
)

try:
from hathor.protos.transaction_storage_pb2_grpc import (
TransactionStorageServicer,
TransactionStorageStub,
add_TransactionStorageServicer_to_server,
)
except ImportError:
pass

__all__ = [
'BaseTransaction',
Expand All @@ -81,50 +31,6 @@
'TxOutput',
'BitcoinAuxPow',
'Metadata',
'ExistsRequest',
'ExistsResponse',
'GetRequest',
'GetResponse',
'SaveRequest',
'SaveResponse',
'RemoveRequest',
'RemoveResponse',
'CountRequest',
'CountResponse',
'LatestTimestampRequest',
'LatestTimestampResponse',
'AddValueRequest',
'GetValueRequest',
'GetValueResponse',
'RemoveValueRequest',
'Empty',
'FirstTimestampRequest',
'FirstTimestampResponse',
'MarkAsRequest',
'MarkAsResponse',
'ListRequest',
'ListTipsRequest',
'ListNewestRequest',
'ListItemResponse',
'Interval',
'SortedTxsRequest',
'TokenCreationTransaction',
'TransactionStorageStub',
'TransactionStorageServicer',
'ANY_TYPE',
'TRANSACTION_TYPE',
'BLOCK_TYPE',
'NO_FILTER',
'ONLY_NEWER',
'ONLY_OLDER',
'ANY_ORDER',
'ASC_ORDER',
'TOPOLOGICAL_ORDER',
'ONLY_NEWER',
'ONLY_OLDER',
'FOR_CACHING',
'LEFT_RIGHT_ORDER_CHILDREN',
'LEFT_RIGHT_ORDER_SPENT',
'VOIDED',
'add_TransactionStorageServicer_to_server',
]
180 changes: 0 additions & 180 deletions hathor/protos/transaction_storage.proto

This file was deleted.

9 changes: 0 additions & 9 deletions hathor/transaction/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
from hathor.transaction.storage.memory_storage import TransactionMemoryStorage
from hathor.transaction.storage.transaction_storage import TransactionStorage

try:
from hathor.transaction.storage.remote_storage import TransactionRemoteStorage, create_transaction_storage_server
from hathor.transaction.storage.subprocess_storage import TransactionSubprocessStorage
except ImportError:
pass

try:
from hathor.transaction.storage.rocksdb_storage import TransactionRocksDBStorage
except ImportError:
Expand All @@ -35,8 +29,5 @@
'TransactionCompactStorage',
'TransactionCacheStorage',
'TransactionBinaryStorage',
'TransactionSubprocessStorage',
'TransactionRemoteStorage',
'TransactionRocksDBStorage',
'create_transaction_storage_server',
]
4 changes: 2 additions & 2 deletions hathor/transaction/storage/binary_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
TransactionDoesNotExist,
TransactionMetadataDoesNotExist,
)
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage, TransactionStorageAsyncFromSync
from hathor.transaction.storage.transaction_storage import BaseTransactionStorage
from hathor.transaction.transaction_metadata import TransactionMetadata

if TYPE_CHECKING:
from hathor.transaction import BaseTransaction


class TransactionBinaryStorage(BaseTransactionStorage, TransactionStorageAsyncFromSync):
class TransactionBinaryStorage(BaseTransactionStorage):
def __init__(self, path='./', with_index=True):
self.tx_path = os.path.join(path, 'tx')
os.makedirs(self.tx_path, exist_ok=True)
Expand Down
Loading