Skip to content

Commit

Permalink
cli: bypass aptos simulation in devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Dec 13, 2024
1 parent ead139c commit f35756a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions clients/js/src/aptos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,16 @@ export async function callEntryFunc(
);

// simulate transaction before submitting
const sim = await client.simulateTransaction(accountFrom, rawTxn);
sim.forEach((tx) => {
if (!tx.success) {
console.error(JSON.stringify(tx, null, 2));
throw new Error(`Transaction failed: ${tx.vm_status}`);
}
});
if (network !== "Devnet") {
// TODO: determine why simulation is no longer working for devnet after 4.5.0 upgrade
const sim = await client.simulateTransaction(accountFrom, rawTxn);
sim.forEach((tx) => {
if (!tx.success) {
console.error(JSON.stringify(tx, null, 2));
throw new Error(`Transaction failed: ${tx.vm_status}`);
}
});
}

// simulation successful... let's do it
const bcsTxn = AptosClient.generateBCSTransaction(accountFrom, rawTxn);
Expand Down

0 comments on commit f35756a

Please sign in to comment.