From 15237645b74f1c86b9f4b61cf6ca3d9872ce435f Mon Sep 17 00:00:00 2001 From: overcat <4catcode@gmail.com> Date: Sun, 17 Sep 2023 16:56:43 +0800 Subject: [PATCH] WIP --- examples/soroban_auth_with_stellar_account.py | 3 +-- stellar_sdk/auth.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/soroban_auth_with_stellar_account.py b/examples/soroban_auth_with_stellar_account.py index 51f9d58e..c50fa20a 100644 --- a/examples/soroban_auth_with_stellar_account.py +++ b/examples/soroban_auth_with_stellar_account.py @@ -35,7 +35,6 @@ contract_id=contract_id, function_name=func_name, parameters=args, - source=op_invoker_kp.public_key ) .build() ) @@ -47,7 +46,7 @@ op.auth = [authorize_entry( simulate_resp.results[0].auth[0], op_invoker_kp, simulate_resp.latest_ledger + 50, network_passphrase )] - tx = soroban_server.prepare_transaction(tx) + tx = soroban_server.prepare_transaction(tx, simulate_resp) except PrepareTransactionException as e: print(f"Got exception: {e.simulate_transaction_response}") raise e diff --git a/stellar_sdk/auth.py b/stellar_sdk/auth.py index 6d069e3e..f201cb95 100644 --- a/stellar_sdk/auth.py +++ b/stellar_sdk/auth.py @@ -82,12 +82,12 @@ def authorize_entry( # This structure is defined here: # https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#stellar-account-signatures - addr_auth.signature = scval.to_map( + addr_auth.signature = scval.to_vec([scval.to_map( { scval.to_symbol("public_key"): scval.to_bytes(public_key), scval.to_symbol("signature"): scval.to_bytes(signature), } - ) + )]) return entry