def setUp(self):
        self.node = MockGatewayNode(
            gateway_helpers.get_gateway_opts(8000, max_block_interval=0)
        )

        self.node_connection = Mock()
        self.node_connection.is_active = MagicMock(return_value=True)
        self.node.set_known_total_difficulty = MagicMock()

        self.node.node_conn = self.node_connection

        self.block_queuing_service = BtcBlockQueuingService(self.node)
        self.node.block_queuing_service = self.block_queuing_service
        self.node.block_cleanup_service = BtcNormalBlockCleanupService(self.node, 1)
        self.block_hashes = []
        self.block_msg = self._get_sample_block()
        self.block_queuing_service.store_block_data(self.block_msg.block_hash(), self.block_msg)
        self.node.get_tx_service().track_seen_short_ids(self.block_msg.block_hash(), [])
Ejemplo n.º 2
0
 def build_block_queuing_service(
     self, connection: AbstractGatewayBlockchainConnection
 ) -> PushBlockQueuingService:
     return BtcBlockQueuingService(self, connection)
Ejemplo n.º 3
0
 def build_block_queuing_service(self) -> PushBlockQueuingService:
     return BtcBlockQueuingService(self)