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

Sending a transaction group does not work when merging transaction.Transaction with raw transaction #178

Closed
pipaman opened this issue Jun 26, 2020 · 0 comments · Fixed by #236
Assignees
Labels
bug Something isn't working FDE
Milestone

Comments

@pipaman
Copy link

pipaman commented Jun 26, 2020

If I create 2 txs one using an transaction.Transaction and the other a raw transaction in this way:

	let params = await algodClient.getTransactionParams();

	let suggestedParams = {
		"genesisHash": params.genesishashb64,
		"genesisID": params.genesisID,
		"firstRound": params.lastRound,
		"lastRound": params.lastRound + 1000,
		"fee": params.minFee,
		"flatFee": true
	};

	let oracleFeeTx = algosdk.makePaymentTxnWithSuggestedParams(consumerAccount.addr,
		oracleOwner, oracleFee, undefined,
		new Uint8Array(0), suggestedParams);

	let oracleTx = {
		"from": oracleTealAddr,
		"to": oracleTealAddr,
		"fee": params.minFee,
		"flatFee": true,
		"amount": 0,
		"firstRound": params.lastRound,
		"lastRound": params.lastRound + 1000,
		"genesisID": params.genesisID,
		"genesisHash": params.genesishashb64,
		"type": "pay"
	};

	// Store both transactions
	let txns = [oracleFeeTx, oracleTx];

	// Group both transactions
	let txgroup = algosdk.assignGroupID(txns);

	// Sign each transaction in the group with
	// correct key
	let signed = []
	oracleFeeTxSigned = oracleFeeTx.signTxn(consumerAccount.sk);
	signed.push(oracleFeeTxSigned);
	let oracleTxSigned = algosdk.signLogicSigTransaction(oracleTx, lsig);
	signed.push(oracleTxSigned.blob)

	let tx = (await algodClient.sendRawTransactions(signed));

I throws and error when sending the transactions:
text:"TransactionPool.Remember: transactionGroup: inconsistent group values: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA != AB7RGLOYELISNZCFA5XJOI2IXZV2TG4LXAH5ZXD2X6B3JLB52GBQ"

If I change the code to use transaction.Transaction objects for all the txs in the group it works:

	let params = await algodClient.getTransactionParams();

	let suggestedParams = {
		"genesisHash": params.genesishashb64,
		"genesisID": params.genesisID,
		"firstRound": params.lastRound,
		"lastRound": params.lastRound + 1000,
		"fee": params.minFee,
		"flatFee": true
	};

	let oracleFeeTx = algosdk.makePaymentTxnWithSuggestedParams(consumerAccount.addr,
		oracleOwner, oracleFee, undefined,
		new Uint8Array(0), suggestedParams);

	let oracleTx = algosdk.makePaymentTxnWithSuggestedParams(oracleTealAddr, 
	    oracleTealAddr, 0, undefined, 
	    new Uint8Array(0), suggestedParams);

	// Store both transactions
	let txns = [oracleFeeTx, oracleTx];

	// Group both transactions
	let txgroup = algosdk.assignGroupID(txns);

	// Sign each transaction in the group with
	// correct key
	let signed = []
	oracleFeeTxSigned = oracleFeeTx.signTxn(consumerAccount.sk);
	signed.push(oracleFeeTxSigned);
	let oracleTxSigned = algosdk.signLogicSigTransactionObject(oracleTx, lsig);
	signed.push(oracleTxSigned.blob)

	let tx = (await algodClient.sendRawTransactions(signed));

The transactions are in this block:
https://betanet.algoexplorer.io/block/4147872

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FDE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants