When I create a transaction group, with multiple LogicSigTransaction, sign it, then attempt to submit, I receive the following error AttributeError: 'NoneType' object has no attribute 'dictify'. If I submit these transactions as separate groups, it works fine (each group contains 1 logic sig transaction and other types of transactions in the group (e.g. payment transaction)). Wondering why I cannot submit a group with multiple logic sig transactions?
I am using the tinyman sdk which can be found here
This code probably won’t work, but this is what I am trying to do in general. all_txns is a grouped transaction that contains the logicsig signed transactions from txn_group1 and txn_group2. I group these together, then sign with the private key, then submit through the algod client.
from tinyman.v1.client import TinymanMainnetClient
address = 'input_here'
private_key = 'input_here'
client = TinymanMainnetClient(user_address=address)
ALGO = client.fetch_asset(0)
USDC = client.fetch_asset(31566704)
USDT = client.fetch_asset(312769)
pool1 = client.fetch_pool(ALGO, USDC)
pool2 = client.fetch_pool(ALGO, USDT)
quote1 = pool1.fetch_fixed_input_swap_quote(ALGO(10000)) # 0.01 ALGO
quote2 = pool2.fetch_fixed_input_swap_quote(ALGO(10000)) # 0.01 ALGO
txn_group1 = pool1.prepare_swap_transactions_from_quote(quote1) # this signs the transactions with a logicsig
txn_group2 = pool2.prepare_swap_transactions_from_quote(quote2) # this signs the transactions with a logicsig
all_txns = txn_group1.signed_transactions + txn_gruop2.signed_transactions # combine the transactions from each group into 1 group
result = client.submit(transaction_group, wait=True)
Yes, I know that there are mistakes in this code – this is not the actual code I am running. The program is more complex than this but this example more clearly demonstrates what the issue is.
In the example, I assume that the grouped transactions are already signed (successfully) with the sign_with_logicsig function. The issue is trying to combine two of these groups into 1 big group then sending this single big group.
The problem still remains – how can I submit a group transaction that contains multiple LogicSig transactions? Is it possible? In my original comment I posted a github issue link that has the same issue, but I don’t see much information on it.
I modified the transaction group to be able to support concatenation, to be able to perform simultaneous swaps. I want to concatenate two groups of TinyMan transactions to be able to swap simultaneously as a group… if one transaction fails then I want to other to fail as well – i.e. I don’t want to swap 1 asset if I can’t swap the other as well.
So is there no way around this? Is the approval program requiring 2 transactions from the sender? and the other 2 from the pool address both checked by the NoOp call?