Skip to content
Closed
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
11 changes: 9 additions & 2 deletions chainwrappers/executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

// BuildExecutor constructs a chain-family-specific Executor from ChainAccessor plus metadata.
func BuildExecutor(

Check warning on line 43 in chainwrappers/executors.go

View check run for this annotation

CL-sonarqube-production / SonarQube Code Analysis

Refactor this method to reduce its Cognitive Complexity from 54 to the 30 allowed.

[S3776] Cognitive Complexity of functions should not be too high See more on https://sonarqube.main.prod.cldev.sh/project/issues?id=smartcontractkit_mcms&pullRequest=820&issues=5b7b3d97-6fd4-44cb-8cee-054aff2ea13c&open=5b7b3d97-6fd4-44cb-8cee-054aff2ea13c
chains ChainAccessor,
chainSelector types.ChainSelector,
encoder sdk.Encoder,
Expand Down Expand Up @@ -72,8 +72,15 @@
if err != nil {
return nil, fmt.Errorf("failed to parse EVM chain metadata for selector %d: %w", rawSelector, err)
}
auth.GasPrice = evmChainMetadata.GasPrice
auth.GasLimit = evmChainMetadata.GasLimit
// Only override when the proposal specifies a value; a zero GasLimit forces
// go-ethereum to estimate gas, which calls eth_getCode against the "pending"
// block and fails on chains (e.g. Avalanche Fuji) that no longer support it.
if evmChainMetadata.GasPrice != nil {
auth.GasPrice = evmChainMetadata.GasPrice
Comment on lines +75 to +79
}
if evmChainMetadata.GasLimit != 0 {
auth.GasLimit = evmChainMetadata.GasLimit
}
Comment on lines +79 to +83

return evm.NewExecutor(evmEncoder, client, auth), nil

Expand Down
Loading