diff options
Diffstat (limited to 'test/scripts/e2e_subs/goal/goal.py')
-rwxr-xr-x | test/scripts/e2e_subs/goal/goal.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/scripts/e2e_subs/goal/goal.py b/test/scripts/e2e_subs/goal/goal.py index d36241fd7..5d0dd7db0 100755 --- a/test/scripts/e2e_subs/goal/goal.py +++ b/test/scripts/e2e_subs/goal/goal.py @@ -6,7 +6,7 @@ import os import subprocess import algosdk -import algosdk.future.transaction as txn +import algosdk.transaction as txn import algosdk.encoding as enc @@ -158,6 +158,19 @@ class Goal: except algosdk.error.AlgodHTTPError as e: return (None, e) + def send_details(self, tx): + stx = self.sign(tx) + headers = {"Content-Type": "application/x-binary", + "X-Algo-API-Token": self.algod.algod_token, + } + url = self.algod.algod_address + "/v2/transactions" + return (url, headers, enc.msgpack_encode(stx)) + + def curl_command(self, tx): + (url, headers, b64data) = self.send_details(tx) + H = " ".join(['-H "' + k + ':' + v + '"' for k,v in headers.items()]) + return f"echo {b64data} | base64 -d | curl -s {url} {H} --data-binary @-" + def send_group(self, txns, confirm=True): # Need unsigned transactions to calculate the group This pulls # out the unsigned tx if tx is sigged, logicsigged or |