Skip to content

Commit

Permalink
fix: change sticker hashrate to GH for Hammer and VolcMiner (#264)
Browse files Browse the repository at this point in the history
* change sticker hashrate to GH

* clean up hashrate for Hammer/Volcminer

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jpcomps and pre-commit-ci[bot] authored Jan 2, 2025
1 parent 23890fa commit 748279c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pyasic/miners/backends/hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ async def _get_hashrate(self, rpc_summary: dict = None) -> Optional[AlgoHashRate
if rpc_summary is not None:
try:
return self.algo.hashrate(
rate=float(rpc_summary["SUMMARY"][0]["GHS 5s"]),
unit=self.algo.unit.GH,
rate=float(rpc_summary["SUMMARY"][0]["MHS 5s"]),
unit=self.algo.unit.MH,
).into(self.algo.unit.default)
except (LookupError, ValueError, TypeError):
pass
Expand Down Expand Up @@ -229,7 +229,7 @@ async def _get_hashboards(self, rpc_stats: dict = None) -> List[HashBoard]:
hashrate = boards[1].get(f"chain_rate{i}")
if hashrate:
hashboard.hashrate = self.algo.hashrate(
rate=float(hashrate), unit=self.algo.unit.GH
rate=float(hashrate), unit=self.algo.unit.MH
).into(self.algo.unit.default)

chips = boards[1].get(f"chain_acn{i}")
Expand Down Expand Up @@ -358,7 +358,7 @@ async def _get_expected_hashrate(
try:
expected_rate = rpc_stats["STATS"][1].get("total_rateideal")
if expected_rate is None:
expected_rate = self.sticker_hashrate
return self.sticker_hashrate
try:
rate_unit = rpc_stats["STATS"][1]["rate_unit"]
except KeyError:
Expand Down
4 changes: 3 additions & 1 deletion pyasic/miners/hammer/blackminer/DX/D10.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pyasic.device.algorithm.hashrate.unit.scrypt import ScryptUnit
from pyasic.device.algorithm.scrypt import ScryptHashRate
from pyasic.miners.backends import BlackMiner
from pyasic.miners.device.models import D10


class HammerD10(BlackMiner, D10):
sticker_hashrate = 5000
sticker_hashrate = ScryptHashRate(rate=5.0, unit=ScryptUnit.GH)
4 changes: 3 additions & 1 deletion pyasic/miners/volcminer/blackminer/DX/D1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pyasic.device.algorithm.hashrate.unit.scrypt import ScryptUnit
from pyasic.device.algorithm.scrypt import ScryptHashRate
from pyasic.miners.backends import BlackMiner
from pyasic.miners.device.models import D1


class VolcMinerD1(BlackMiner, D1):
sticker_hashrate = 15150
sticker_hashrate = ScryptHashRate(rate=15.15, unit=ScryptUnit.GH)

0 comments on commit 748279c

Please sign in to comment.