Hey everyone,
I called the smart contract on the mainnet using js-sdk. After receiving txHash I awaited for the confirmation using waitTxConfirm(hash)
sdk function. Then after 1 confirmation , I get tx not found when querying for the hash.
- contract call result:
result {
hash: 'th_N7G5dWz37z9S7Y5BeFQLinbS8wHmCQz5vw4YUvhKv9T3jE3Bz',
rawTx: 'tx_+M8LAfhCuECjFoQ0+53xZfWQQwGOFXJjM6EkR/03RcKIuuiDAEUCGQLR/mUaGQmEFf3Dr1dkwqdTs5h00HqV2NqCu8NqZqYMuIf4hSsBoQF7YX+i6NHksXm84S2CbftFuVDwlUQtUDM6obp+Mxm+vBGhBZB9g8MTrxWORZZaF9lmtDHRgJtsebWAZIyM8aGcvW+UA4amKiiZuAAAAIMYF/iEO5rKAKorEUzXC5YbnwCgFjlt1rf7HwH32MH58v+LNJCDW1+SWsqUGPAIDDxvE5CWG2Ts',
result: {
callerId: 'ak_wLbhjhs2TZ3vztaK9hb8rKRDBjip3N4xqDKLtAhvcwRMyCUmA',
callerNonce: 17,
contractId: 'ct_26dp1nJUjMrbpbGdvduwA4J8FsYVU5uEBXwq7xwoSmyHxaRgYL',
gasPrice: 1000000000,
gasUsed: 1887,
height: 397965,
log: [ [Object] ],
returnType: 'ok',
returnValue: 'cb_P4fvHVw='
},
txData: {
blockHash: 'mh_2S3fEPFn1LN5pN79mU96VcCAC3Rxa4ngszaJ5Raii3gvBbiS7c',
blockHeight: 397965,
hash: 'th_N7G5dWz37z9S7Y5BeFQLinbS8wHmCQz5vw4YUvhKv9T3jE3Bz',
signatures: [
'sg_NLX9XkEbApNG2jj5Nnr5HgUpRG4KNTgCicAPUmgEPy9xBAW2THa48Vre4ckNCPtnyh32i6uwTydQFot9ddARwTHbQbLjk'
],
tx: {
abiVersion: 3,
amount: 0,
callData: 'cb_KxFM1wuWG58AoBY5bda3+x8B99jB+fL/izSQg1tfklrKlBjwCAw8bxOQ1BPABQ==',
callerId: 'ak_wLbhjhs2TZ3vztaK9hb8rKRDBjip3N4xqDKLtAhvcwRMyCUmA',
contractId: 'ct_26dp1nJUjMrbpbGdvduwA4J8FsYVU5uEBXwq7xwoSmyHxaRgYL',
fee: 182700000000000,
gas: 1579000,
gasPrice: 1000000000,
nonce: 17,
type: 'ContractCallTx',
version: 1
},
callerId: 'ak_wLbhjhs2TZ3vztaK9hb8rKRDBjip3N4xqDKLtAhvcwRMyCUmA',
callerNonce: 17,
contractId: 'ct_26dp1nJUjMrbpbGdvduwA4J8FsYVU5uEBXwq7xwoSmyHxaRgYL',
gasPrice: 1000000000,
gasUsed: 1887,
height: 397965,
log: [ [Object] ],
returnType: 'ok',
returnValue: 'cb_P4fvHVw=',
rawTx: 'tx_+M8LAfhCuECjFoQ0+53xZfWQQwGOFXJjM6EkR/03RcKIuuiDAEUCGQLR/mUaGQmEFf3Dr1dkwqdTs5h00HqV2NqCu8NqZqYMuIf4hSsBoQF7YX+i6NHksXm84S2CbftFuVDwlUQtUDM6obp+Mxm+vBGhBZB9g8MTrxWORZZaF9lmtDHRgJtsebWAZIyM8aGcvW+UA4amKiiZuAAAAIMYF/iEO5rKAKorEUzXC5YbnwCgFjlt1rf7HwH32MH58v+LNJCDW1+SWsqUGPAIDDxvE5CWG2Ts'
},
decode: [Function: decode],
decodedResult: [],
decodedEvents: [
{
address: 'ct_26dp1nJUjMrbpbGdvduwA4J8FsYVU5uEBXwq7xwoSmyHxaRgYL',
data: 'cb_Xfbg4g==',
topics: [Array],
name: 'WalletAdded',
decoded: [Array]
}
]
}
- await confirmation
await client.waitForTxConfirm("th_N7G5dWz37z9S7Y5BeFQLinbS8wHmCQz5vw4YUvhKv9T3jE3Bz", { confirm: 1, interval: 20000, attempts: 40 })
height = await client.height()
console.log("fetched height", height)
The height output is: 397966.
But I queried for the hash and received the Tx Not Found status. I looked for the micro block and I can see it here: mh_2S3fEPFn1LN5pN79mU96VcCAC3Rxa4ngszaJ5Raii3gvBbiS7c - Micro block transactions of Aeternity - AEKnow
My transaction is there but can’t open the details, the details are: NULL.
What is the issue here? And what is the proper way for awaiting the transaction to be mined? Thanks!