bug: update API unlocker format.

This commit is contained in:
UpstreamData
2024-02-09 14:25:14 -07:00
parent 5c5d688ffa
commit 554d99ca08
2 changed files with 6 additions and 3 deletions

View File

@@ -165,7 +165,7 @@ class BaseMinerRPCAPI:
for func in
# each function in self
dir(self)
if not func == "commands"
if not func in ["commands", "open_api"]
if callable(getattr(self, func)) and
# no __ or _ methods
not func.startswith("__") and not func.startswith("_") and

View File

@@ -349,7 +349,7 @@ class BTMinerRPCAPI(BaseMinerRPCAPI):
stage1_req = (
await c.post(
"https://wmt.pyasic.org/v1/stage1",
json={"ip": self.ip},
json={"ip": str(self.ip)},
follow_redirects=True,
)
).json()
@@ -359,7 +359,10 @@ class BTMinerRPCAPI(BaseMinerRPCAPI):
stage2_req = (
await c.post(
"https://wmt.pyasic.org/v1/stage2",
json={"ip": self.ip, "stage1_result": stage1_res.decode("utf-8")},
json={
"ip": str(self.ip),
"stage1_result": stage1_res.decode("utf-8"),
},
)
).json()
for command in stage2_req: