From 7a1e869b351f1914c9e18e02d602f165c437d3f3 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 14:14:34 +0100 Subject: [PATCH 1/4] feat(services): add faucet fee config --- changelog.md | 1 + ignite/config/chain/base/config.go | 3 +++ ignite/services/chain/faucet.go | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/changelog.md b/changelog.md index bfb239ab9e..aa36e9eff6 100644 --- a/changelog.md +++ b/changelog.md @@ -26,6 +26,7 @@ - [#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 +- []() 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 a9e6340e63..b34cf206fe 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -90,6 +90,9 @@ type Faucet struct { // Port number for faucet server to listen at. 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."` } // Init overwrites sdk configurations with given values. diff --git a/ignite/services/chain/faucet.go b/ignite/services/chain/faucet.go index 836625788a..173b770659 100644 --- a/ignite/services/chain/faucet.go +++ b/ignite/services/chain/faucet.go @@ -108,6 +108,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 0519daa07c03687884cd2681fbc86b83fa99e638 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 14:15:42 +0100 Subject: [PATCH 2/4] cl --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index aa36e9eff6..4907c282fa 100644 --- a/changelog.md +++ b/changelog.md @@ -26,7 +26,7 @@ - [#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 -- []() Allow to pass tx fees to faucet server +- [#4513](https://github.com/ignite/cli/pull/4513) Allow to pass tx fees to faucet server ### Changes From 7066f56ba32d75c4d4925960bb78eff7ed888f77 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 17:47:57 +0100 Subject: [PATCH 3/4] pin 1.23 to ci (ref #4509) --- .github/workflows/test-cov.yml | 2 +- .github/workflows/test-integration.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cov.yml b/.github/workflows/test-cov.yml index 977c037325..ffded8a25b 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" - run: ./scripts/test-coverage diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 2aa94d5fac..8245036795 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: "1.23" - name: Run Integration Tests env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7016a68ab..4823cab233 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,6 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: "1.23" - run: ./scripts/test From dbfa2053ff1a742e41d604336932a73128911b17 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 17 Feb 2025 17:50:51 +0100 Subject: [PATCH 4/4] fix --- .github/workflows/test-cov.yml | 2 +- .github/workflows/test-integration.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-cov.yml b/.github/workflows/test-cov.yml index ffded8a25b..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: "1.23" + go-version: "1.23.5" - run: ./scripts/test-coverage diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 8245036795..c5d5a8df47 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.23.5" - name: Run Integration Tests env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4823cab233..c180754a37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,6 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.23.5" - run: ./scripts/test