|
9 | 9 | "math/rand"
|
10 | 10 | "net/http"
|
11 | 11 | "net/url"
|
| 12 | + "strconv" |
12 | 13 | "time"
|
13 | 14 |
|
14 | 15 | "github.com/cosmos/relayer/v2/relayer/chains/cosmos"
|
@@ -87,6 +88,12 @@ type ChainInfo struct {
|
87 | 88 | MaxGasAmount uint64 `json:"max_gas_amount"`
|
88 | 89 | ExtraCodecs []string `json:"extra_codecs"`
|
89 | 90 | ExtensionOptions []provider.ExtensionOption `json:"extension_options"`
|
| 91 | + Fees struct { |
| 92 | + FeeTokens []struct { |
| 93 | + Denom string `json:"denom"` |
| 94 | + LowGasPrice float64 `json:"low_gas_price"` |
| 95 | + } `json:"fee_tokens"` |
| 96 | + } `json:"fees"` |
90 | 97 | }
|
91 | 98 |
|
92 | 99 | // NewChainInfo returns a ChainInfo that is uninitialized other than the provided zap.Logger.
|
@@ -292,14 +299,18 @@ func (c ChainInfo) GetChainConfig(ctx context.Context, forceAdd, testnet bool, n
|
292 | 299 | debug := viper.GetBool("debug")
|
293 | 300 | home := viper.GetString("home")
|
294 | 301 |
|
295 |
| - assetList, err := c.GetAssetList(ctx, testnet, name) |
296 |
| - if err != nil { |
297 |
| - return nil, err |
298 |
| - } |
299 |
| - |
300 | 302 | var gasPrices string
|
301 |
| - if len(assetList.Assets) > 0 { |
302 |
| - gasPrices = fmt.Sprintf("%.2f%s", 0.01, assetList.Assets[0].Base) |
| 303 | + if len(c.Fees.FeeTokens) > 0 { |
| 304 | + gasPrices = strconv.FormatFloat(c.Fees.FeeTokens[0].LowGasPrice, 'f', -1, 64) + c.Fees.FeeTokens[0].Denom |
| 305 | + } else { |
| 306 | + assetList, err := c.GetAssetList(ctx, testnet, name) |
| 307 | + if err != nil { |
| 308 | + return nil, err |
| 309 | + } |
| 310 | + |
| 311 | + if len(assetList.Assets) > 0 { |
| 312 | + gasPrices = fmt.Sprintf("%.2f%s", 0.01, assetList.Assets[0].Base) |
| 313 | + } |
303 | 314 | }
|
304 | 315 |
|
305 | 316 | rpc, err := c.GetRandomRPCEndpoint(ctx, forceAdd)
|
|
0 commit comments