Skip to content

Commit

Permalink
remove state override if not supported (#365)
Browse files Browse the repository at this point in the history
* remove state override if not supported

* negate

---------

Co-authored-by: mouseless <[email protected]>
  • Loading branch information
mouseless0x and mouseless0x authored Dec 2, 2024
1 parent 3ea094a commit 113ab8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ export class RpcHandler implements IRpcEndpoint {
): Promise<EstimateUserOperationGasResponseResult> {
this.ensureEntryPointIsSupported(entryPoint)

// Remove state override if not supported by network.
if (!this.config.balanceOverride) {
stateOverrides = undefined
}

if (userOperation.maxFeePerGas === 0n) {
throw new RpcError(
"user operation max fee per gas must be larger than 0 during gas estimation"
Expand Down

0 comments on commit 113ab8f

Please sign in to comment.