Skip to content

Commit

Permalink
Merge 11930f8 into e9a6561
Browse files Browse the repository at this point in the history
  • Loading branch information
may01 authored Dec 31, 2024
2 parents e9a6561 + 11930f8 commit 462b24d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ export const getFee = async (
const simulation = await aptosClient.simulateTransaction(publicKeyEd, tx);
const completedTx = simulation[0];

if (!completedTx.success) {
const expectedGas = BigNumber(gasLimit * gasPrice);
const isUnderMaxSpendable = !transaction.amount
.plus(expectedGas)
.isGreaterThan(account.spendableBalance);

if (isUnderMaxSpendable && !completedTx.success) {
switch (true) {
case completedTx.vm_status.includes("SEQUENCE_NUMBER"): {
res.errors.sequenceNumber = completedTx.vm_status;
Expand Down

0 comments on commit 462b24d

Please sign in to comment.