Skip to content

Commit

Permalink
Rename FallbackGasPriceUAtom to FallbackGasPrice (#9802)
Browse files Browse the repository at this point in the history
* rename FallbackGasPriceUAtom to FallbackGasPrice

* revert config.md formatting

* update chainlink-cosmos version

* run make config-docs
  • Loading branch information
calvwang9 authored Jul 17, 2023
1 parent 2139327 commit ae4faa5
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion core/chains/cosmos/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func newChain(id string, cfg coscfg.Config, db *sqlx.DB, ks keystore.Cosmos, log
gpe := cosmosclient.NewMustGasPriceEstimator([]cosmosclient.GasPricesEstimator{
cosmosclient.NewClosureGasPriceEstimator(func() (map[string]sdk.DecCoin, error) {
return map[string]sdk.DecCoin{
"uatom": sdk.NewDecCoinFromDec("uatom", cfg.FallbackGasPriceUAtom()),
"uatom": sdk.NewDecCoinFromDec("uatom", cfg.FallbackGasPrice()),
}, nil
}),
}, lggr)
Expand Down
8 changes: 4 additions & 4 deletions core/chains/cosmos/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ func setFromChain(c, f *coscfg.Chain) {
if f.ConfirmPollPeriod != nil {
c.ConfirmPollPeriod = f.ConfirmPollPeriod
}
if f.FallbackGasPriceUAtom != nil {
c.FallbackGasPriceUAtom = f.FallbackGasPriceUAtom
if f.FallbackGasPrice != nil {
c.FallbackGasPrice = f.FallbackGasPrice
}
if f.FCDURL != nil {
c.FCDURL = f.FCDURL
Expand Down Expand Up @@ -323,8 +323,8 @@ func (c *CosmosConfig) ConfirmPollPeriod() time.Duration {
return c.Chain.ConfirmPollPeriod.Duration()
}

func (c *CosmosConfig) FallbackGasPriceUAtom() sdk.Dec {
return sdkDecFromDecimal(c.Chain.FallbackGasPriceUAtom)
func (c *CosmosConfig) FallbackGasPrice() sdk.Dec {
return sdkDecFromDecimal(c.Chain.FallbackGasPrice)
}

func (c *CosmosConfig) FCDURL() url.URL {
Expand Down
4 changes: 2 additions & 2 deletions core/chains/cosmos/cosmostxm/txm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func TestTxm_Integration(t *testing.T) {
chainID := cosmotest.RandomChainID()
fallbackGasPrice := sdk.NewDecCoinFromDec("uatom", sdk.MustNewDecFromStr("0.01"))
chain := cosmos.CosmosConfig{ChainID: &chainID, Enabled: ptr(true), Chain: coscfg.Chain{
FallbackGasPriceUAtom: ptr(decimal.RequireFromString("0.01")),
GasLimitMultiplier: ptr(decimal.RequireFromString("1.5")),
FallbackGasPrice: ptr(decimal.RequireFromString("0.01")),
GasLimitMultiplier: ptr(decimal.RequireFromString("1.5")),
}}
cfg, db := heavyweight.FullTestDBNoFixturesV2(t, "cosmos_txm", func(c *chainlink.Config, s *chainlink.Secrets) {
c.Cosmos = cosmos.CosmosConfigs{&chain}
Expand Down
4 changes: 2 additions & 2 deletions core/config/docs/chains-cosmos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ BlockRate = '6s' # Default
BlocksUntilTxTimeout = 30 # Default
# ConfirmPollPeriod sets how often check for tx confirmation.
ConfirmPollPeriod = '1s' # Default
# FallbackGasPriceUAtom sets a fallback gas price to use when the estimator is not available.
FallbackGasPriceUAtom = '0.015' # Default
# FallbackGasPrice sets a fallback gas price to use when the estimator is not available.
FallbackGasPrice = '0.015' # Default
# FCDURL sets the FCD (Full Client Daemon) URL.
FCDURL = 'http://cosmos.com' # Example
# GasLimitMultiplier scales the estimated gas limit.
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ require (
github.com/shirou/gopsutil/v3 v3.22.12 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789 // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230612131011-369bfb503592 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230622060316-7ce48476dd7d // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906 h1:u7Lw7oqLEjADlJPJQnzlCLNSbj038QttaKY0lCa3V78=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906/go.mod h1:MH+MRJaG4SZAbRq5g7//AFY9H9sg5+lLDQnm85aHP6A=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789 h1:S+JQhiaZGYk3zuNXksH52j90n+dZA0HKOH5XpYMNfwc=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789/go.mod h1:pZJODK8XXR/XOs/1Jqnxgrlga2LLoAQHbM+gStkO63U=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3 h1:rlNWHk15A2im/e9U95q4AkHZk5Wbc77lpx6ys4kUyCE=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3/go.mod h1:MfZBUifutkv3aK7abyw5YmTJbqt8iFwcQDFikrxC/uI=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230612131011-369bfb503592 h1:3Ul/LkULxrolCVguHUFnWJamgUDsSGISlm/DzclstmE=
Expand Down
22 changes: 11 additions & 11 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,16 @@ func TestConfig_Marshal(t *testing.T) {
ChainID: ptr("Malaga-420"),
Enabled: ptr(true),
Chain: coscfg.Chain{
BlockRate: relayutils.MustNewDuration(time.Minute),
BlocksUntilTxTimeout: ptr[int64](12),
ConfirmPollPeriod: relayutils.MustNewDuration(time.Second),
FallbackGasPriceUAtom: mustDecimal("0.001"),
FCDURL: relayutils.MustParseURL("http://cosmos.com"),
GasLimitMultiplier: mustDecimal("1.2"),
MaxMsgsPerBatch: ptr[int64](17),
OCR2CachePollPeriod: relayutils.MustNewDuration(time.Minute),
OCR2CacheTTL: relayutils.MustNewDuration(time.Hour),
TxMsgTimeout: relayutils.MustNewDuration(time.Second),
BlockRate: relayutils.MustNewDuration(time.Minute),
BlocksUntilTxTimeout: ptr[int64](12),
ConfirmPollPeriod: relayutils.MustNewDuration(time.Second),
FallbackGasPrice: mustDecimal("0.001"),
FCDURL: relayutils.MustParseURL("http://cosmos.com"),
GasLimitMultiplier: mustDecimal("1.2"),
MaxMsgsPerBatch: ptr[int64](17),
OCR2CachePollPeriod: relayutils.MustNewDuration(time.Minute),
OCR2CacheTTL: relayutils.MustNewDuration(time.Hour),
TxMsgTimeout: relayutils.MustNewDuration(time.Second),
},
Nodes: []*coscfg.Node{
{Name: ptr("primary"), TendermintURL: relayutils.MustParseURL("http://tender.mint")},
Expand Down Expand Up @@ -954,7 +954,7 @@ Enabled = true
BlockRate = '1m0s'
BlocksUntilTxTimeout = 12
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.001'
FallbackGasPrice = '0.001'
FCDURL = 'http://cosmos.com'
GasLimitMultiplier = '1.2'
MaxMsgsPerBatch = 17
Expand Down
2 changes: 1 addition & 1 deletion core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Enabled = true
BlockRate = '1m0s'
BlocksUntilTxTimeout = 12
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.001'
FallbackGasPrice = '0.001'
FCDURL = 'http://cosmos.com'
GasLimitMultiplier = '1.2'
MaxMsgsPerBatch = 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ ChainID = 'Ibiza-808'
BlockRate = '6s'
BlocksUntilTxTimeout = 30
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.015'
FallbackGasPrice = '0.015'
FCDURL = ''
GasLimitMultiplier = '1.5'
MaxMsgsPerBatch = 13
Expand All @@ -467,7 +467,7 @@ ChainID = 'Malaga-420'
BlockRate = '6s'
BlocksUntilTxTimeout = 20
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.015'
FallbackGasPrice = '0.015'
FCDURL = ''
GasLimitMultiplier = '1.5'
MaxMsgsPerBatch = 100
Expand Down
8 changes: 4 additions & 4 deletions core/web/cosmos_chains_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Enabled = true
BlockRate = '6s'
BlocksUntilTxTimeout = 30
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '9.999'
FallbackGasPrice = '9.999'
FCDURL = ''
GasLimitMultiplier = '1.55555'
MaxMsgsPerBatch = 100
Expand Down Expand Up @@ -79,8 +79,8 @@ Nodes = []
ChainID: ptr(validId),
Enabled: ptr(true),
Chain: coscfg.Chain{
FallbackGasPriceUAtom: ptr(decimal.RequireFromString("9.999")),
GasLimitMultiplier: ptr(decimal.RequireFromString("1.55555")),
FallbackGasPrice: ptr(decimal.RequireFromString("9.999")),
GasLimitMultiplier: ptr(decimal.RequireFromString("1.55555")),
}})

wantedResult := tc.want(t, controller.app)
Expand Down Expand Up @@ -109,7 +109,7 @@ func Test_CosmosChainsController_Index(t *testing.T) {
ChainID: ptr(cosmostest.RandomChainID()),
Enabled: ptr(true),
Chain: coscfg.Chain{
FallbackGasPriceUAtom: ptr(decimal.RequireFromString("9.999")),
FallbackGasPrice: ptr(decimal.RequireFromString("9.999")),
},
}
chainB := &cosmos.CosmosConfig{
Expand Down
2 changes: 1 addition & 1 deletion core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Enabled = true
BlockRate = '1m0s'
BlocksUntilTxTimeout = 12
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.001'
FallbackGasPrice = '0.001'
FCDURL = 'http://cosmos.com'
GasLimitMultiplier = '1.2'
MaxMsgsPerBatch = 17
Expand Down
4 changes: 2 additions & 2 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ ChainID = 'Ibiza-808'
BlockRate = '6s'
BlocksUntilTxTimeout = 30
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.015'
FallbackGasPrice = '0.015'
FCDURL = ''
GasLimitMultiplier = '1.5'
MaxMsgsPerBatch = 13
Expand All @@ -467,7 +467,7 @@ ChainID = 'Malaga-420'
BlockRate = '6s'
BlocksUntilTxTimeout = 20
ConfirmPollPeriod = '1s'
FallbackGasPriceUAtom = '0.015'
FallbackGasPrice = '0.015'
FCDURL = ''
GasLimitMultiplier = '1.5'
MaxMsgsPerBatch = 100
Expand Down
8 changes: 4 additions & 4 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4703,7 +4703,7 @@ Enabled = true # Default
BlockRate = '6s' # Default
BlocksUntilTxTimeout = 30 # Default
ConfirmPollPeriod = '1s' # Default
FallbackGasPriceUAtom = '0.015' # Default
FallbackGasPrice = '0.015' # Default
FCDURL = 'http://cosmos.com' # Example
GasLimitMultiplier = '1.5' # Default
MaxMsgsPerBatch = 100 # Default
Expand Down Expand Up @@ -4743,11 +4743,11 @@ ConfirmPollPeriod = '1s' # Default
```
ConfirmPollPeriod sets how often check for tx confirmation.

### FallbackGasPriceUAtom
### FallbackGasPrice
```toml
FallbackGasPriceUAtom = '0.015' # Default
FallbackGasPrice = '0.015' # Default
```
FallbackGasPriceUAtom sets a fallback gas price to use when the estimator is not available.
FallbackGasPrice sets a fallback gas price to use when the estimator is not available.

### FCDURL
```toml
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ require (
github.com/shirou/gopsutil/v3 v3.22.12
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230612131011-369bfb503592
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230622060316-7ce48476dd7d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906 h1:u7Lw7oqLEjADlJPJQnzlCLNSbj038QttaKY0lCa3V78=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906/go.mod h1:MH+MRJaG4SZAbRq5g7//AFY9H9sg5+lLDQnm85aHP6A=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789 h1:S+JQhiaZGYk3zuNXksH52j90n+dZA0HKOH5XpYMNfwc=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789/go.mod h1:pZJODK8XXR/XOs/1Jqnxgrlga2LLoAQHbM+gStkO63U=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3 h1:rlNWHk15A2im/e9U95q4AkHZk5Wbc77lpx6ys4kUyCE=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3/go.mod h1:MfZBUifutkv3aK7abyw5YmTJbqt8iFwcQDFikrxC/uI=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230612131011-369bfb503592 h1:3Ul/LkULxrolCVguHUFnWJamgUDsSGISlm/DzclstmE=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ
github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo=
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230525203711-20bed74ac906 h1:u7Lw7oqLEjADlJPJQnzlCLNSbj038QttaKY0lCa3V78=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230714113758-258965668789 h1:S+JQhiaZGYk3zuNXksH52j90n+dZA0HKOH5XpYMNfwc=
github.com/smartcontractkit/chainlink-env v0.34.2 h1:wo3srthdNAHuYsNvKAl0Vbm4R7TyQtaQmRoZyaWzQC8=
github.com/smartcontractkit/chainlink-env v0.34.2/go.mod h1:hMOkTDW5k0C5B5lup1+xpPiZQPkq84YGLuFDVdTKU7A=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230620171700-bbcb3a99b7d3 h1:rlNWHk15A2im/e9U95q4AkHZk5Wbc77lpx6ys4kUyCE=
Expand Down

0 comments on commit ae4faa5

Please sign in to comment.