Txn stimulation error

"Failed to deserialize input into SignedTransaction: invalid value: integer `4`, expected variant index 0 <= i < 4"

Here is the code

 const transaction = await aptosClient.publishPackageTransaction({
        account: account.accountAddress,
        metadataBytes,
        moduleBytecode: byteCode,
    });
    const stimulationResult = await aptosClient.transaction.simulate.simple({
        transaction
    });
    if(!stimulationResult[0].success) {
        throw new Error(stimulationResult[0].vm_status)
    }
    const pendingTxn = await aptosClient.signAndSubmitTransaction({
        signer: account,
        transaction
    })
    await aptosClient.waitForTransaction({
        transactionHash: pendingTxn.hash
    })

Have generally been seeing deserialization errors when using Move syntax not supported on our network. Can you confirm that you are not using Move 2 or any new syntax? Have you tried this with a basic module to test?

1 Like

If I comment stimulation code, the txn succeeds. Plus not using move 2

so the simulation fails but the actual transaction executes?

1 Like

Yes, impleted this in here

Right now the simulate txn code is commented