Skip to content

Commit e049a22

Browse files
feat(services): add faucet fee config (backport #4513) (#4514)
* 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 4abea76) # Conflicts: # ignite/config/chain/base/config.go * conflict --------- Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 8fed582 commit e049a22

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

.github/workflows/test-cov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-go@v5
2020
with:
21-
go-version: "stable"
21+
go-version: "1.23.5"
2222

2323
- run: ./scripts/test-coverage
2424

.github/workflows/test-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- uses: actions/setup-go@v5
4242
with:
43-
go-version: "stable"
43+
go-version: "1.23.5"
4444

4545
- name: Run Integration Tests
4646
env:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424

2525
- uses: actions/setup-go@v5
2626
with:
27-
go-version: "stable"
27+
go-version: "1.23.5"
2828

2929
- run: ./scripts/test

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- [#4513](https://github.com/ignite/cli/pull/4513) Allow to pass tx fees to faucet server
8+
59
### Changes
610

711
- [#4439](https://github.com/ignite/cli/pull/4439) Simplify Ignite CLI dependencies by removing `moby` and `gorilla` dependencies.

ignite/config/chain/base/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ type Faucet struct {
120120

121121
// Port number for faucet server to listen at.
122122
Port uint `yaml:"port,omitempty"`
123+
124+
// TxFee is the tx fee the faucet needs to pay for each transaction.
125+
TxFee string `yaml:"tx_fee,omitempty"`
123126
}
124127

125128
// Init overwrites sdk configurations with given values.

ignite/services/chain/faucet.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ func (c *Chain) Faucet(ctx context.Context) (cosmosfaucet.Faucet, error) {
107107
faucetOptions = append(faucetOptions, cosmosfaucet.Coin(parsedCoin.Amount, amountMax, parsedCoin.Denom))
108108
}
109109

110+
// parse fees to pass to the faucet as fees.
111+
if fee := conf.Faucet.TxFee; fee != "" {
112+
parsedFee, err := sdk.ParseCoinNormalized(fee)
113+
if err != nil {
114+
return cosmosfaucet.Faucet{}, errors.Errorf("%w: %s", err, fee)
115+
}
116+
117+
faucetOptions = append(faucetOptions, cosmosfaucet.FeeAmount(parsedFee.Amount, parsedFee.Denom))
118+
}
119+
110120
if conf.Faucet.RateLimitWindow != "" {
111121
rateLimitWindow, err := time.ParseDuration(conf.Faucet.RateLimitWindow)
112122
if err != nil {

0 commit comments

Comments
 (0)