Summary
detectTxSuccess in @autonomys/auto-utils always returns false, regardless of whether the transaction succeeded. This causes signAndSendTx to report success: false even for confirmed, in-block transactions.
Root Cause
In packages/auto-utils/src/utils/detectTxSuccess.ts, a return true inside Array.forEach() returns from the arrow function callback — not from detectTxSuccess itself. The function always falls through to return false.
// Current (broken)
const detectTxSuccess = (events) => {
events.forEach(({ event: { method, section } }) => {
if (expectSuccessfulTxEvent.indexOf(`${section}.${method}`) > -1)
return true // ← returns from the forEach callback, not detectTxSuccess
})
return false // ← always reached
}
Suggested Fix
Replace forEach with some:
const detectTxSuccess = (events) => {
return events.some(({ event: { method, section } }) => {
return expectSuccessfulTxEvent.indexOf(`${section}.${method}`) > -1
})
}
Impact
Every consumer of signAndSendTx that checks result.success will always see false, even for successful transactions. The transaction itself still lands on-chain — the bug is only in the success reporting.
Reproduction
import { transfer } from '@autonomys/auto-consensus'
import { signAndSendTx } from '@autonomys/auto-utils'
const result = await signAndSendTx(sender, tx)
console.log(result.success) // always false
console.log(result.txHash) // valid hash — tx actually succeeded
console.log(result.blockHash) // valid hash — tx is in a block
Workaround
Infer success from the presence of txHash and blockHash instead of trusting result.success:
const success = !!(result.txHash && result.blockHash)
Version
@autonomys/auto-utils@1.6.9
Summary
detectTxSuccessin@autonomys/auto-utilsalways returnsfalse, regardless of whether the transaction succeeded. This causessignAndSendTxto reportsuccess: falseeven for confirmed, in-block transactions.Root Cause
In
packages/auto-utils/src/utils/detectTxSuccess.ts, areturn trueinsideArray.forEach()returns from the arrow function callback — not fromdetectTxSuccessitself. The function always falls through toreturn false.Suggested Fix
Replace
forEachwithsome:Impact
Every consumer of
signAndSendTxthat checksresult.successwill always seefalse, even for successful transactions. The transaction itself still lands on-chain — the bug is only in the success reporting.Reproduction
Workaround
Infer success from the presence of
txHashandblockHashinstead of trustingresult.success:Version
@autonomys/auto-utils@1.6.9