def submit(self, nonce):
command = {'command': 'submission', 'args': {'nonce': nonce, 'wallet_id': self.wallet_id}}
message = json.dumps(command)
await self.socket.send(message)
message = await self.socket.recv()
response = json.loads(message)
print("Submission result: {0}".format(response))
if 'error' in response:
print("Error during submission : {0}".format(response["error"]))
if 'challenge_name' in response:
# we got a new challenge
challenge = Challenge()
challenge.fill_from_challenge(response)
return challenge
return None
评论列表
文章目录