Skip to content

Commit a94b3f8

Browse files
authored
chore: update python-hathorlib to v0.8.0 (#137)
1 parent 46f7899 commit a94b3f8

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ structlog = "~22.3.0"
2424
prometheus-client = "^0.9.0"
2525
idna_ssl = "^1.1.0"
2626
asynctest = "^0.13.0"
27-
hathorlib = {version = "^0.7.0", extras = ["client"]}
27+
hathorlib = {version = "^0.8.0", extras = ["client"]}
2828
dataclasses = {version = "^0.8", python = ">=3.6,<3.7"}
2929
python-healthchecklib = "^0.1.0"
3030

tests/test_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def test_refresh_tx_job(self):
762762
job_data = args[1]
763763
self.assertEqual(job_data["clean"], False)
764764
self.assertEqual(
765-
job_data["data"], current_job.get_header_without_nonce().hex()
765+
job_data["data"], current_job.get_mining_header_without_nonce().hex()
766766
)
767767

768768
conn.send_request.reset_mock()
@@ -799,7 +799,7 @@ def test_refresh_tx_job(self):
799799

800800
self.assertEqual(job_data["clean"], True)
801801
self.assertEqual(
802-
job_data["data"], conn.current_job.get_header_without_nonce().hex()
802+
job_data["data"], conn.current_job.get_mining_header_without_nonce().hex()
803803
)
804804

805805
def test_miner_block_submission_after_receiving_tx(self):

txstratum/jobs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def mark_as_failed(self, message: str) -> None:
115115
self.status = JobStatus.FAILED
116116
self.message = message
117117

118-
def get_header_without_nonce(self) -> bytes:
118+
def get_mining_header_without_nonce(self) -> bytes:
119119
"""Return job's header without nonce."""
120-
return self._tx.get_header_without_nonce()
120+
return self._tx.get_mining_header_without_nonce()
121121

122122
def get_nonce_size(self) -> int:
123123
"""Return job's nonce size."""
@@ -191,7 +191,7 @@ def get_weight(self) -> float:
191191
raise NotImplementedError
192192

193193
@abstractmethod
194-
def get_header_without_nonce(self) -> bytes:
194+
def get_mining_header_without_nonce(self) -> bytes:
195195
"""Return job's header without nonce."""
196196
raise NotImplementedError
197197

@@ -245,9 +245,9 @@ def update_timestamp(self, *, force: bool = False) -> None:
245245
"""Update job timestamp."""
246246
self._tx.timestamp = int(txstratum.time.time())
247247

248-
def get_header_without_nonce(self) -> bytes:
248+
def get_mining_header_without_nonce(self) -> bytes:
249249
"""Return job's header without nonce."""
250-
return self._tx.get_header_without_nonce()
250+
return self._tx.get_mining_header_without_nonce()
251251

252252
def get_nonce_size(self) -> int:
253253
"""Return job's nonce size."""
@@ -298,9 +298,9 @@ def update_timestamp(self, *, force: bool = False) -> None:
298298
return
299299
self._block.timestamp = now
300300

301-
def get_header_without_nonce(self) -> bytes:
301+
def get_mining_header_without_nonce(self) -> bytes:
302302
"""Return job's header without nonce."""
303-
return self._block.get_header_without_nonce()
303+
return self._block.get_mining_header_without_nonce()
304304

305305
def get_nonce_size(self) -> int:
306306
"""Return job's nonce size."""

txstratum/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def update_job(self, job: "MinerJob", *, clean: bool) -> None:
584584

585585
# Send new job to the miner.
586586
job_data = {
587-
"data": job.get_header_without_nonce().hex(),
587+
"data": job.get_mining_header_without_nonce().hex(),
588588
"job_id": job.uuid.hex(),
589589
"nonce_size": job.get_nonce_size(),
590590
"weight": float(job.share_weight),

0 commit comments

Comments
 (0)