Skip to content

Commit

Permalink
Fix config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Dec 13, 2024
1 parent 08f4851 commit ccf8be7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/chains/evm/config/toml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ func (t *TxmV2) ValidateConfig() (err error) {
if t.Enabled != nil && *t.Enabled {
if t.BlockTime == nil {
err = multierr.Append(err, commonconfig.ErrMissing{Name: "TxmV2.BlockTime", Msg: "must be set if txmv2 feature is enabled"})
return
}
if t.BlockTime.Duration() < 2*time.Second {
err = multierr.Append(err, commonconfig.ErrInvalid{Name: "TxmV2.BlockTime", Msg: "must be equal to or greater than 2 seconds"})
Expand Down
7 changes: 5 additions & 2 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1477,14 +1477,15 @@ func TestConfig_Validate(t *testing.T) {
- Nodes: 2 errors:
- 0.HTTPURL: missing: required for all nodes
- 1.HTTPURL: missing: required for all nodes
- 1: 10 errors:
- 1: 11 errors:
- ChainType: invalid value (Foo): must not be set with this chain id
- Nodes: missing: must have at least one node
- ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit, dualBroadcast or omitted
- HeadTracker.HistoryDepth: invalid value (30): must be greater than or equal to FinalizedBlockOffset
- GasEstimator.BumpThreshold: invalid value (0): cannot be 0 if auto-purge feature is enabled for Foo
- Transactions.AutoPurge.Threshold: missing: needs to be set if auto-purge feature is enabled for Foo
- Transactions.AutoPurge.MinAttempts: missing: needs to be set if auto-purge feature is enabled for Foo
- TxmV2.TxmV2.BlockTime: missing: must be set if txmv2 feature is enabled
- GasEstimator: 2 errors:
- FeeCapDefault: invalid value (101 wei): must be equal to PriceMax (99 wei) since you are using FixedPrice estimation with gas bumping disabled in EIP1559 mode - PriceMax will be used as the FeeCap for transactions instead of FeeCapDefault
- PriceMax: invalid value (1 gwei): must be greater than or equal to PriceDefault
Expand Down Expand Up @@ -1515,7 +1516,9 @@ func TestConfig_Validate(t *testing.T) {
- 4: 2 errors:
- ChainID: missing: required for all chains
- Nodes: missing: must have at least one node
- 5.Transactions.AutoPurge.DetectionApiUrl: invalid value (): must be set for scroll
- 5: 2 errors:
- Transactions.AutoPurge.DetectionApiUrl: invalid value (): must be set for scroll
- TxmV2.TxmV2.BlockTime: missing: must be set if txmv2 feature is enabled
- 6.Nodes: missing: 0th node (primary) must have a valid WSURL when http polling is disabled
- Cosmos: 5 errors:
- 1.ChainID: invalid value (Malaga-420): duplicate - must be unique
Expand Down

0 comments on commit ccf8be7

Please sign in to comment.