From 8d96df2878777700cd3bc435c532f178347ca54b Mon Sep 17 00:00:00 2001 From: artpav <19916123+artemijspavlovs@users.noreply.github.com> Date: Sun, 24 Nov 2024 09:34:42 +0200 Subject: [PATCH] fix: handle custom env manual input gas price (#1130) --- cmd/rollapp/setup/setup.go | 15 ++++++++++++--- utils/config/config.go | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/rollapp/setup/setup.go b/cmd/rollapp/setup/setup.go index c193fb97..c46a63c2 100644 --- a/cmd/rollapp/setup/setup.go +++ b/cmd/rollapp/setup/setup.go @@ -761,9 +761,18 @@ func populateSequencerMetadata(raCfg roller.RollappConfig) error { Telegram: "", X: "", } - defaultGasPrice, ok := github_com_cosmos_cosmos_sdk_types.NewIntFromString( - raCfg.HubData.GasPrice, - ) + + var defaultGasPrice cosmossdktypes.Int + var ok bool + + if raCfg.HubData.GasPrice != "" { + defaultGasPrice, ok = github_com_cosmos_cosmos_sdk_types.NewIntFromString( + raCfg.HubData.GasPrice, + ) + } else { + defaultGasPrice = cosmossdktypes.NewInt(2000000000) + ok = true + } if !ok { return errors.New("failed to parse gas price") } diff --git a/utils/config/config.go b/utils/config/config.go index a848bdca..82eada28 100644 --- a/utils/config/config.go +++ b/utils/config/config.go @@ -72,6 +72,7 @@ func createCustomHubDataManually() CustomHubData { ID: id, RpcUrl: rpcUrl, ApiUrl: restUrl, + GasPrice: gasPrice, DymensionHash: commit, } return hd