Skip to content

Commit

Permalink
Merge branch 'fix_network_override' into experiment_automatic_gas
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Mar 14, 2024
2 parents 98b4519 + 31a2bd4 commit 22b3d06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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
12 changes: 11 additions & 1 deletion integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,24 @@ func handleDefaultConfigOverride(logger zerolog.Logger, filename, configurationN

// 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
} else {
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 22b3d06

Please sign in to comment.