Skip to content

Commit

Permalink
fix a situation, when we lose transaction timeout setting for network…
Browse files Browse the repository at this point in the history
…s… (#12415)

* fix a situation, when we lose transaction timeout setting for networks that are not overwritten

* add gas limit for Fiji, fix a situation when new networks were ignored

* fix lints
  • Loading branch information
Tofel authored Mar 14, 2024
1 parent 6eeb3bc commit 9f656e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions integration-tests/testconfig/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ name = "Fuji"
chain_id = "43113"
transaction_timeout = "3m"
transfer_gas_fee = 21_000
gas_limit = 8_000_000
# legacy transactions
gas_price = 30_000_000_000
# EIP-1559 transactions
Expand Down
13 changes: 11 additions & 2 deletions integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,22 +586,31 @@ func handleDefaultConfigOverride(logger zerolog.Logger, filename, configurationN
for i, old_network := range oldConfig.Seth.Networks {
for _, target_network := range target.Seth.Networks {
if old_network.ChainID == target_network.ChainID {
oldConfig.Seth.Networks[i].TxnTimeout = old_network.TxnTimeout
oldConfig.Seth.Networks[i].TxnTimeout = target_network.TxnTimeout
}
}
}
}

// override instead of merging
if (newConfig.Seth != nil && len(newConfig.Seth.Networks) > 0) && (oldConfig != nil && oldConfig.Seth != nil && len(oldConfig.Seth.Networks) > 0) {
networksToUse := map[string]*seth.Network{}
for i, old_network := range oldConfig.Seth.Networks {
for _, new_network := range newConfig.Seth.Networks {
if old_network.ChainID == new_network.ChainID {
oldConfig.Seth.Networks[i] = new_network
break
}
if _, ok := networksToUse[new_network.ChainID]; !ok {
networksToUse[new_network.ChainID] = new_network
}
}
networksToUse[old_network.ChainID] = oldConfig.Seth.Networks[i]
}
target.Seth.Networks = []*seth.Network{}
for _, network := range networksToUse {
target.Seth.Networks = append(target.Seth.Networks, network)
}
target.Seth.Networks = oldConfig.Seth.Networks
}

return nil
Expand Down

0 comments on commit 9f656e9

Please sign in to comment.