Skip to content

Commit

Permalink
temp remove gas validation on BaseInvocationScope
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed May 22, 2024
1 parent 267fc8d commit 8c0f475
Showing 1 changed file with 0 additions and 12 deletions.
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}'.`
);
}
}
}

0 comments on commit 8c0f475

Please sign in to comment.