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

v8.0.x cleanups #2077

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ func RegisterSwaggerAPI(rtr *mux.Router) {
rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
}

func (app *GaiaApp) OnTxSucceeded(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
func (app *GaiaApp) OnTxSucceeded(_ sdk.Context, _, _ string, _ []byte, _ []byte) {
}

func (app *GaiaApp) OnTxFailed(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
func (app *GaiaApp) OnTxFailed(_ sdk.Context, _, _ string, _ []byte, _ []byte) {
}

// TestingApp functions
Expand All @@ -400,6 +400,6 @@ func (app *GaiaApp) GetTxConfig() client.TxConfig {
type EmptyAppOptions struct{}

// Get implements AppOptions
func (ao EmptyAppOptions) Get(o string) interface{} {
func (ao EmptyAppOptions) Get(_ string) interface{} {
return nil
}
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

type EmptyAppOptions struct{}

func (ao EmptyAppOptions) Get(o string) interface{} {
func (ao EmptyAppOptions) Get(_ string) interface{} {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) {

type EmptyAppOptions struct{}

func (EmptyAppOptions) Get(o string) interface{} { return nil }
func (EmptyAppOptions) Get(_ string) interface{} { return nil }

func Setup(t *testing.T) *gaiaapp.GaiaApp {
t.Helper()
Expand Down
3 changes: 1 addition & 2 deletions app/upgrades/v7/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ const (
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
UpgradeName: UpgradeName,
StoreUpgrades: store.StoreUpgrades{
Added: []string{icahosttypes.StoreKey},
},
Expand Down
3 changes: 0 additions & 3 deletions app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ import (
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"

"github.com/cosmos/gaia/v8/app/keepers"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
vm[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()
Expand Down
1 change: 1 addition & 0 deletions cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func (ac appCreator) newApp(
baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))),
baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))),
baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))),
)
}

Expand Down
198 changes: 109 additions & 89 deletions go.mod

Large diffs are not rendered by default.

552 changes: 358 additions & 194 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/e2e/e2e_globalfee_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
)

func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string, fees string) { //nolint:unparam
func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string) {
s.writeGovParamChangeProposalGlobalFees(s.chainA, newGlobalfee)
chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp"))
submitGovFlags := []string{"param-change", configFile(proposalGlobalFeeFilename)}
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/e2e_globalfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *IntegrationTestSuite) testGlobalFees() {
// prepare gov globalfee proposal
emptyGlobalFee := sdk.DecCoins{}
proposalCounter++
s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter, standardFees.String())
s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter)
paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String()

s.T().Logf("test case: empty global fee, globalfee=%s, min_gas_price=%s", emptyGlobalFee.String(), minGasPrice+uatomDenom)
Expand Down Expand Up @@ -140,7 +140,7 @@ func (s *IntegrationTestSuite) testGlobalFees() {
// prepare gov globalfee proposal
lowGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt))}
proposalCounter++
s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter, standardFees.String())
s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter)

paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String()
paidFeeAmtLowMinGasHighGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt).
Expand Down Expand Up @@ -190,7 +190,7 @@ func (s *IntegrationTestSuite) testGlobalFees() {
// prepare gov globalfee proposal
highGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(highGlobalFeeAmt))}
proposalCounter++
s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom)
s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter)

paidFeeAmt = math.LegacyMustNewDecFromStr(highGlobalFeeAmt).Mul(math.LegacyNewDec(gas)).String()
paidFeeAmtHigherMinGasLowerGalobalFee := math.LegacyMustNewDecFromStr(minGasPrice).
Expand Down Expand Up @@ -224,7 +224,7 @@ func (s *IntegrationTestSuite) testGlobalFees() {
sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt)),
}.Sort()
proposalCounter++
s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom)
s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter)

// equal to min_gas_price
paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String()
Expand Down Expand Up @@ -330,5 +330,5 @@ func (s *IntegrationTestSuite) testGlobalFees() {
oldfees, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom)
s.Require().NoError(err)
proposalCounter++
s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter, paidFeeAmt+photonDenom)
s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter)
}
16 changes: 8 additions & 8 deletions x/globalfee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
})
}

func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error {
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
var data types.GenesisState
err := marshaler.UnmarshalJSON(message, &data)
if err != nil {
Expand All @@ -51,10 +51,10 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client
return nil
}

func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {
}

func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) {
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
Expand All @@ -69,7 +69,7 @@ func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
}

func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) {
func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}

type AppModule struct {
Expand Down Expand Up @@ -99,7 +99,7 @@ func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) jso
return marshaler.MustMarshalJSON(&genState)
}

func (a AppModule) RegisterInvariants(registry sdk.InvariantRegistry) {
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

func (a AppModule) Route() sdk.Route {
Expand All @@ -110,18 +110,18 @@ func (a AppModule) QuerierRoute() string {
return types.QuerierRoute
}

func (a AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier {
func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier {
return nil
}

func (a AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace))
}

func (a AppModule) BeginBlock(context sdk.Context, block abci.RequestBeginBlock) {
func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

func (a AppModule) EndBlock(context sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate {
func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return nil
}

Expand Down