Delete old unused modules (#398)

This commit is contained in:
Jonathan Zernik 2020-11-06 12:51:07 -05:00 committed by GitHub
parent a90a34aa06
commit a69a2bd859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 99 deletions

View file

@ -1,14 +0,0 @@
from abc import ABC, abstractmethod
from typing import Optional
class BlockchainClient(ABC):
"""Used to get info from the blockchain."""
@abstractmethod
def get_latest_block_height(self) -> int:
pass
@abstractmethod
def get_block_hash(self, block_height: int) -> Optional[bytes]:
pass

View file

@ -1,23 +0,0 @@
from typing import Optional
from bitcoin.core import lx
from squeaknode.common.blockchain_client import BlockchainClient
class DummyBlockchainClient(BlockchainClient):
"""Gets only the genesis block of the main chain."""
def __init__(self) -> None:
pass
def get_latest_block_height(self) -> int:
return 0
def get_block_hash(self, block_height: int) -> Optional[bytes]:
# return the genesis block hash
if block_height == 0:
return lx(
"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
)
return None

View file

@ -1,3 +0,0 @@
def greet():
"""Return a greeting."""
return "hello"

View file

@ -1,57 +0,0 @@
import logging
import threading
from squeaknode.network.peer_client import PeerClient
from squeaknode.node.peer_task import PeerSyncTask
logger = logging.getLogger(__name__)
LOOKUP_BLOCK_INTERVAL = 1008 # 1 week
# class PeerUpload(PeerSyncTask):
# def __init__(
# self,
# peer,
# squeak_store,
# postgres_db,
# lightning_client,
# ):
# super().__init__(peer, squeak_store, postgres_db, lightning_client)
# def upload(
# self,
# block_height,
# lookup_block_interval=LOOKUP_BLOCK_INTERVAL,
# ):
# # Get list of sharing addresses.
# addresses = self._get_sharing_addresses()
# logger.debug("Sharing addresses: {}".format(addresses))
# min_block = block_height - lookup_block_interval
# max_block = block_height
# # Get remote hashes
# remote_hashes = self._get_remote_hashes(addresses, min_block, max_block)
# logger.debug("Got remote hashes: {}".format(len(remote_hashes)))
# for hash in remote_hashes:
# logger.debug("remote hash: {}".format(hash.hex()))
# # Get local hashes
# local_hashes = self._get_local_hashes(addresses, min_block, max_block)
# logger.debug("Got local hashes: {}".format(len(local_hashes)))
# for hash in local_hashes:
# logger.debug("local hash: {}".format(hash.hex()))
# # Get hashes to upload
# hashes_to_upload = set(local_hashes) - set(remote_hashes)
# logger.debug("Hashes to upload: {}".format(len(hashes_to_upload)))
# for hash in hashes_to_upload:
# logger.debug("hash to upload: {}".format(hash.hex()))
# # Upload squeaks for the hashes
# # TODO: catch exception uploading individual squeak
# for hash in hashes_to_upload:
# if self.stopped():
# return
# self._upload_squeak(hash)

View file

@ -21,8 +21,6 @@ class SqueakMaker:
block_height = block_info.block_height
block_hash = bytes.fromhex(block_info.block_hash)
timestamp = self._get_current_time_s()
logger.info("Creating squeak with block height: {}".format(block_height))
logger.info("Creating squeak with block hash: {}".format(block_hash))
if replyto_hash is None or len(replyto_hash) == 0:
return MakeSqueakFromStr(
signing_key,