Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gas and fee error on 0.82.0 #2375

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: "Release PR to npm"
runs-on: ubuntu-latest
# comment out if:false to enable release PR to npm
if: false
# if: false
permissions: write-all
steps:
- name: Checkout
Expand Down
12 changes: 0 additions & 12 deletions packages/program/src/functions/base-invocation-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,24 +471,12 @@ export class BaseInvocationScope<TReturn = any> {
const gasLimitSpecified = !!this.txParameters?.gasLimit || this.hasCallParamsGasLimit;
const gasPriceSpecified = !!this.txParameters?.gasPrice;

const { gasLimit, gasPrice } = transactionRequest;

if (!gasLimitSpecified) {
transactionRequest.gasLimit = gasUsed;
} else if (gasLimit.lt(gasUsed)) {
throw new FuelError(
ErrorCode.GAS_LIMIT_TOO_LOW,
`Gas limit '${gasLimit}' is lower than the required: '${gasUsed}'.`
);
}

if (!gasPriceSpecified) {
transactionRequest.gasPrice = minGasPrice;
} else if (gasPrice.lt(minGasPrice)) {
throw new FuelError(
ErrorCode.GAS_PRICE_TOO_LOW,
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
);
}
}
}
Loading