Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomic Transfer with LSIG signed transaction fails #385

Open
gl-pgege opened this issue Jun 22, 2021 · 1 comment
Open

Atomic Transfer with LSIG signed transaction fails #385

gl-pgege opened this issue Jun 22, 2021 · 1 comment
Labels

Comments

@gl-pgege
Copy link

Hi,

I am trying to execute an atomic transfer that involves closing out an escrow account but I keep getting the following error:

"TransactionPool.Remember: transactionGroup: incomplete group: XGHNMDXO6YA6PPCZYTVUBRW7PL4SV2WT2DJTDAN44VYCOIIN5XXQ != ZWRKHURTT4MLBQ5RQBYJIU6Y5MGNYADCBQMCXNAEKJBK56O74LBA ({{} [X54OMVL63PM3OHNCU2DKNWFUK5GKBFMY5CL4PP4PMBWJGAXXRN6Q RIMM47EE2JYZJ4EU72NCX4PCICXUV55TIPBUYYMFK4MMBG5CFBFA]})"

Here is my code, I have performed the same task with other types of transactions. However, I only run into this problem when closing out an escrow account.

    const params = await client.getTransactionParams().do();
    params.fee = 1000;
    params.flatFee = true;

    const escrowProgram = await compileProgram(client, escrowProgramSource);

    const lsig = algodsdk.makeLogicSig(escrowProgram);
    const escrowAddress = lsig.address();
    
    const appArgs = [
        new Uint8Array(Buffer.from('deposit')),
    ];

    const appWithdrawCheckTxn = algodsdk.makeApplicationNoOpTxn(
        developer, params, APP_ID, appArgs);

    const paymentTxnObject = {
        from: escrowAddress,
        to: GLOBAL_ZERO_ADDRESS,
        amount: CONTRACT_AMOUNT,
        closeRemainderTo: developer,
        suggestedParams: params,
        note: undefined
    }

    const withdrawFromEscrowTxn = algodsdk.makePaymentTxnWithSuggestedParamsFromObject(paymentTxnObject);
    
    const txns = [appWithdrawCheckTxn, withdrawFromEscrowTxn];
    const transactionGroup = algodsdk.assignGroupID(txns);

    const signedAppWithdrawCheckTxn = transactionGroup[0].signTxn(developerAccount.sk);
    const signedWithdrawFromEscrowTxn = algodsdk.signLogicSigTransactionObject(transactionGroup[1], lsig);

    const signedTxGroup = [];
    signedTxGroup.push(signedAppWithdrawCheckTxn);
    signedTxGroup.push(signedWithdrawFromEscrowTxn.blob);
    
    const tx = await client.sendRawTransaction(signedTxGroup).do();
@Eric-Warehime
Copy link
Contributor

The change needed here is probably similar to algorand/py-algorand-sdk#218 -- improving the error messaging. Although I'm not sure whether or not the error handling needs to be improved client side or server side since the TransactionPool.Remember... output would be coming from algod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@Eric-Warehime @gl-pgege @yaovi-a and others