From 54f07a5ebf37bb973b7504fa3795b61702093472 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 17:59:20 +0100 Subject: [PATCH 1/2] feat(services): add faucet fee config (#4513) * feat(services): add faucet fee config * cl * pin 1.23 to ci (ref #4509) * fix (cherry picked from commit 4abea764132ef2f16531ffba755d04452c67a5cf) # Conflicts: # ignite/config/chain/base/config.go --- .github/workflows/test-cov.yml | 2 +- .github/workflows/test-integration.yml | 2 +- .github/workflows/test.yml | 2 +- changelog.md | 26 ++++++++++++++++++++++++++ ignite/config/chain/base/config.go | 7 +++++++ ignite/services/chain/faucet.go | 10 ++++++++++ 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cov.yml b/.github/workflows/test-cov.yml index 977c037325..f85dea5526 100644 --- a/.github/workflows/test-cov.yml +++ b/.github/workflows/test-cov.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: "1.23.5" - run: ./scripts/test-coverage diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index f811e00274..e592c539cf 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: "1.23.5" - name: Run Integration Tests env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 816c28cd74..29b55ef39d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,6 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: "1.23.5" - run: ./scripts/test diff --git a/changelog.md b/changelog.md index 2c8fa3b7e4..163d30386b 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,32 @@ ## Unreleased +### Features + +- [#3707](https://github.com/ignite/cli/pull/3707) and [#4094](https://github.com/ignite/cli/pull/4094) Add collections support. +- [#3977](https://github.com/ignite/cli/pull/3977) Add `chain lint` command to lint the chain's codebase using `golangci-lint` +- [#3770](https://github.com/ignite/cli/pull/3770) Add `scaffold configs` and `scaffold params` commands +- [#4001](https://github.com/ignite/cli/pull/4001) Improve `xgenny` dry run +- [#3967](https://github.com/ignite/cli/issues/3967) Add HD wallet parameters `address index` and `account number` to the chain account config +- [#4004](https://github.com/ignite/cli/pull/4004) Remove all import placeholders using the `xast` pkg +- [#4071](https://github.com/ignite/cli/pull/4071) Support custom proto path +- [#3718](https://github.com/ignite/cli/pull/3718) Add `gen-mig-diffs` tool app to compare scaffold output of two versions of ignite +- [#4100](https://github.com/ignite/cli/pull/4100) Set the `proto-dir` flag only for the `scaffold chain` command and use the proto path from the config +- [#4111](https://github.com/ignite/cli/pull/4111) Remove vuex generation +- [#4113](https://github.com/ignite/cli/pull/4113) Generate chain config documentation automatically +- [#4131](https://github.com/ignite/cli/pull/4131) Support `bytes` as data type in the `scaffold` commands +- [#4300](https://github.com/ignite/cli/pull/4300) Only panics the module in the most top function level +- [#4327](https://github.com/ignite/cli/pull/4327) Use the TxConfig from simState instead create a new one +- [#4326](https://github.com/ignite/cli/pull/4326) Add `buf.build` version to `ignite version` command +- [#4436](https://github.com/ignite/cli/pull/4436) Return tx hash to the faucet API +- [#4437](https://github.com/ignite/cli/pull/4437) Remove module placeholders +- [#4289](https://github.com/ignite/cli/pull/4289), [#4423](https://github.com/ignite/cli/pull/4423), [#4432](https://github.com/ignite/cli/pull/4432) Cosmos SDK v0.52 support +- [#4480](https://github.com/ignite/cli/pull/4480) Add field max length +- [#4477](https://github.com/ignite/cli/pull/4477) IBC v10 support +- [#4166](https://github.com/ignite/cli/issues/4166) Migrate buf config files to v2 +- [#4494](https://github.com/ignite/cli/pull/4494) Automatic migrate the buf configs to v2 +- [#4513](https://github.com/ignite/cli/pull/4513) Allow to pass tx fees to faucet server + ### Changes - [#4439](https://github.com/ignite/cli/pull/4439) Simplify Ignite CLI dependencies by removing `moby` and `gorilla` dependencies. diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index 389ae72b9b..b5b8261fa9 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -119,7 +119,14 @@ type Faucet struct { Host string `yaml:"host,omitempty"` // Port number for faucet server to listen at. +<<<<<<< HEAD Port uint `yaml:"port,omitempty"` +======= + Port uint `yaml:"port,omitempty" doc:"Port number for the faucet server."` + + // TxFee is the tx fee the faucet needs to pay for each transaction. + TxFee string `yaml:"tx_fee,omitempty" doc:"Tx fee the faucet needs to pay for each transaction."` +>>>>>>> 4abea764 (feat(services): add faucet fee config (#4513)) } // Init overwrites sdk configurations with given values. diff --git a/ignite/services/chain/faucet.go b/ignite/services/chain/faucet.go index 9b521ab3fb..60e1727fab 100644 --- a/ignite/services/chain/faucet.go +++ b/ignite/services/chain/faucet.go @@ -107,6 +107,16 @@ func (c *Chain) Faucet(ctx context.Context) (cosmosfaucet.Faucet, error) { faucetOptions = append(faucetOptions, cosmosfaucet.Coin(parsedCoin.Amount, amountMax, parsedCoin.Denom)) } + // parse fees to pass to the faucet as fees. + if fee := conf.Faucet.TxFee; fee != "" { + parsedFee, err := sdk.ParseCoinNormalized(fee) + if err != nil { + return cosmosfaucet.Faucet{}, errors.Errorf("%w: %s", err, fee) + } + + faucetOptions = append(faucetOptions, cosmosfaucet.FeeAmount(parsedFee.Amount, parsedFee.Denom)) + } + if conf.Faucet.RateLimitWindow != "" { rateLimitWindow, err := time.ParseDuration(conf.Faucet.RateLimitWindow) if err != nil { From 5c7c026fa867d83124ac904b7f572fec91d4ad17 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 18:02:30 +0100 Subject: [PATCH 2/2] conflict --- changelog.md | 22 ---------------------- ignite/config/chain/base/config.go | 6 +----- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/changelog.md b/changelog.md index 163d30386b..8c3da5d82c 100644 --- a/changelog.md +++ b/changelog.md @@ -4,28 +4,6 @@ ### Features -- [#3707](https://github.com/ignite/cli/pull/3707) and [#4094](https://github.com/ignite/cli/pull/4094) Add collections support. -- [#3977](https://github.com/ignite/cli/pull/3977) Add `chain lint` command to lint the chain's codebase using `golangci-lint` -- [#3770](https://github.com/ignite/cli/pull/3770) Add `scaffold configs` and `scaffold params` commands -- [#4001](https://github.com/ignite/cli/pull/4001) Improve `xgenny` dry run -- [#3967](https://github.com/ignite/cli/issues/3967) Add HD wallet parameters `address index` and `account number` to the chain account config -- [#4004](https://github.com/ignite/cli/pull/4004) Remove all import placeholders using the `xast` pkg -- [#4071](https://github.com/ignite/cli/pull/4071) Support custom proto path -- [#3718](https://github.com/ignite/cli/pull/3718) Add `gen-mig-diffs` tool app to compare scaffold output of two versions of ignite -- [#4100](https://github.com/ignite/cli/pull/4100) Set the `proto-dir` flag only for the `scaffold chain` command and use the proto path from the config -- [#4111](https://github.com/ignite/cli/pull/4111) Remove vuex generation -- [#4113](https://github.com/ignite/cli/pull/4113) Generate chain config documentation automatically -- [#4131](https://github.com/ignite/cli/pull/4131) Support `bytes` as data type in the `scaffold` commands -- [#4300](https://github.com/ignite/cli/pull/4300) Only panics the module in the most top function level -- [#4327](https://github.com/ignite/cli/pull/4327) Use the TxConfig from simState instead create a new one -- [#4326](https://github.com/ignite/cli/pull/4326) Add `buf.build` version to `ignite version` command -- [#4436](https://github.com/ignite/cli/pull/4436) Return tx hash to the faucet API -- [#4437](https://github.com/ignite/cli/pull/4437) Remove module placeholders -- [#4289](https://github.com/ignite/cli/pull/4289), [#4423](https://github.com/ignite/cli/pull/4423), [#4432](https://github.com/ignite/cli/pull/4432) Cosmos SDK v0.52 support -- [#4480](https://github.com/ignite/cli/pull/4480) Add field max length -- [#4477](https://github.com/ignite/cli/pull/4477) IBC v10 support -- [#4166](https://github.com/ignite/cli/issues/4166) Migrate buf config files to v2 -- [#4494](https://github.com/ignite/cli/pull/4494) Automatic migrate the buf configs to v2 - [#4513](https://github.com/ignite/cli/pull/4513) Allow to pass tx fees to faucet server ### Changes diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index b5b8261fa9..078884e9fe 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -119,14 +119,10 @@ type Faucet struct { Host string `yaml:"host,omitempty"` // Port number for faucet server to listen at. -<<<<<<< HEAD Port uint `yaml:"port,omitempty"` -======= - Port uint `yaml:"port,omitempty" doc:"Port number for the faucet server."` // TxFee is the tx fee the faucet needs to pay for each transaction. - TxFee string `yaml:"tx_fee,omitempty" doc:"Tx fee the faucet needs to pay for each transaction."` ->>>>>>> 4abea764 (feat(services): add faucet fee config (#4513)) + TxFee string `yaml:"tx_fee,omitempty"` } // Init overwrites sdk configurations with given values.