You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to modify the hermes configuration file using this function, I wanted to apply the following changes
varchannelIDs [][]stringfor_, c:=rangechannels {
channelIDs=append(channelIDs, []string{c.PortID, c.ChannelID})
}
channelIDs=append(channelIDs, []string{"ica*", "*"})
overrides:=map[string]any{
"chains": []map[string]interface{}{
{
"id": chainID,
"packet_filter": map[string]interface{}{
"policy": "allow",
// we explicitly override the full list, this allows this function to provide a complete set of channels to watch."list": channelIDs,
},
},
},
}
returnh.ModifyTomlConfigFile(ctx, ".hermes/config.toml", overrides)
i.e. explicitly adding the packet_filter field for chainID. The current behaviour of RecursiveModifyToml will ignore slices of maps, I think it would be desirable to be able to merge lists of maps this way.
Things may get tricky when you are trying to append/prepend/insert items in the merging logic, but I think it would be fine to even just require providing the same number of items, e.g. the above example would become
overrides:=map[string]any{
"chains": []map[string]interface{}{
{
"packet_filter": map[string]interface{}{
"policy": "allow",
// we explicitly override the full list, this allows this function to provide a complete set of channels to watch."list": channelIDs,
},
},
},
{}, // <--- empty map
}
to modify the first chain in a 2 chain setup
The text was updated successfully, but these errors were encountered:
When attempting to modify the hermes configuration file using this function, I wanted to apply the following changes
i.e. explicitly adding the packet_filter field for
chainID
. The current behaviour ofRecursiveModifyToml
will ignore slices of maps, I think it would be desirable to be able to merge lists of maps this way.Things may get tricky when you are trying to append/prepend/insert items in the merging logic, but I think it would be fine to even just require providing the same number of items, e.g. the above example would become
to modify the first chain in a 2 chain setup
The text was updated successfully, but these errors were encountered: