Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Enable tips parameter #142

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ linters:
- typecheck
- unconvert
- unused
# - errcheck
- errcheck
- thelper
- testifylint

issues:
exclude-rules:
Expand Down
3 changes: 3 additions & 0 deletions proto/feemarket/feemarket/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@ message Params {
// DistributeFees is a boolean that determines whether the fees are burned or
// distributed to all stakers.
bool distribute_fees = 12;

// EnableTips is a boolean that determines whether tips are enabled.
bool enable_tips = 13;
}
4 changes: 3 additions & 1 deletion tests/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*ab
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap())
if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil {
panic(err)
}
return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState)
}

Expand Down
25 changes: 20 additions & 5 deletions tests/app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
/* Handle staking state. */

// iterate through redelegations, reset creation height
app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
err = app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) {
for i := range red.Entries {
red.Entries[i].CreationHeight = 0
}
Expand All @@ -177,9 +177,12 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
}
return false
})
if err != nil {
panic(err)
}

// iterate through unbonding delegations, reset creation height
app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) {
err = app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) {
for i := range ubd.Entries {
ubd.Entries[i].CreationHeight = 0
}
Expand All @@ -189,6 +192,9 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
}
return false
})
if err != nil {
panic(err)
}

// Iterate through validators by power descending, reset bond heights, and
// update bond intra-tx counters.
Expand All @@ -208,7 +214,10 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
validator.Jailed = true
}

app.StakingKeeper.SetValidator(ctx, validator)
err = app.StakingKeeper.SetValidator(ctx, validator)
if err != nil {
panic(err)
}
counter++
}

Expand All @@ -225,12 +234,18 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []
/* Handle slashing state. */

// reset start height on signing infos
app.SlashingKeeper.IterateValidatorSigningInfos(
err = app.SlashingKeeper.IterateValidatorSigningInfos(
ctx,
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
info.StartHeight = 0
app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
err = app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info)
if err != nil {
panic(err)
}
return false
},
)
if err != nil {
log.Fatal(err)
}
}
38 changes: 20 additions & 18 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/skip-mev/feemarket/tests/e2e

go 1.22.3
go 1.22.6

toolchain go1.23.0

replace (
cosmossdk.io/client/v2 => cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79
Expand All @@ -15,16 +17,16 @@ replace (

require (
cosmossdk.io/math v1.3.0
github.com/cometbft/cometbft v0.38.8
github.com/cosmos/cosmos-sdk v0.50.7
github.com/cometbft/cometbft v0.38.11
github.com/cosmos/cosmos-sdk v0.50.9
github.com/pelletier/go-toml/v2 v2.2.2
github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610
github.com/skip-mev/feemarket v1.0.1
github.com/skip-mev/slinky v1.0.0
github.com/strangelove-ventures/interchaintest/v8 v8.4.0
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.64.1
google.golang.org/grpc v1.65.0
)

require (
Expand All @@ -36,15 +38,15 @@ require (
cloud.google.com/go/storage v1.41.0 // indirect
cosmossdk.io/api v0.7.5 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/core v0.11.1 // indirect
cosmossdk.io/depinject v1.0.0 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/store v1.1.0 // indirect
cosmossdk.io/x/evidence v0.1.1 // indirect
cosmossdk.io/x/feegrant v0.1.1 // indirect
cosmossdk.io/x/tx v0.13.3 // indirect
cosmossdk.io/x/upgrade v0.1.3 // indirect
cosmossdk.io/x/tx v0.13.4 // indirect
cosmossdk.io/x/upgrade v0.1.4 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
Expand Down Expand Up @@ -80,7 +82,7 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.5.0 // indirect
github.com/cosmos/gogoproto v1.6.0 // indirect
github.com/cosmos/iavl v1.1.2 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect
github.com/cosmos/ibc-go/v8 v8.2.1 // indirect
Expand Down Expand Up @@ -235,21 +237,21 @@ require (
go.opentelemetry.io/otel/sdk v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/api v0.180.0 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading