fix: Add more logging for batch errors
All checks were successful
Build Docker / Build Image (push) Successful in 44s
All checks were successful
Build Docker / Build Image (push) Successful in 44s
This commit is contained in:
parent
5c61bad9a2
commit
8c61a09e5b
@ -76,9 +76,9 @@ def main(params, authentication):
|
|||||||
responseContent = f'{{"method": "sendbatch","params":[ {batchTX} ]}}'
|
responseContent = f'{{"method": "sendbatch","params":[ {batchTX} ]}}'
|
||||||
response = requests.post(f'http://x:{api_key}@{ip}:12039', data=responseContent)
|
response = requests.post(f'http://x:{api_key}@{ip}:12039', data=responseContent)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
print("Failed to create batch")
|
print("Failed to create batch",flush=True)
|
||||||
print(f'Status code: {response.status_code}')
|
print(f'Status code: {response.status_code}',flush=True)
|
||||||
print(f'Response: {response.text}')
|
print(f'Response: {response.text}',flush=True)
|
||||||
return {"status": "Failed", "transaction": "None"}
|
return {"status": "Failed", "transaction": "None"}
|
||||||
|
|
||||||
batch = response.json()
|
batch = response.json()
|
||||||
@ -86,8 +86,8 @@ def main(params, authentication):
|
|||||||
print("Verifying tx...")
|
print("Verifying tx...")
|
||||||
if batch["error"]:
|
if batch["error"]:
|
||||||
if batch["error"] != "":
|
if batch["error"] != "":
|
||||||
print("Failed to verify batch")
|
print("Failed to verify batch",flush=True)
|
||||||
print(batch["error"]["message"])
|
print(batch["error"]["message"],flush=True)
|
||||||
return {"status": "Failed", "transaction": "None"}
|
return {"status": "Failed", "transaction": "None"}
|
||||||
|
|
||||||
if 'result' in batch:
|
if 'result' in batch:
|
||||||
|
Loading…
Reference in New Issue
Block a user