From 1094a7ceb673833b4c527c8becf15da16a929809 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 17:51:32 +0100 Subject: [PATCH] fix: linter errors --- .../keeper/msg_server_upload_morse_state.go | 10 ++++----- x/migration/module/simulation.go | 22 +++++++++---------- x/migration/simulation/upload_morse_state.go | 5 +++-- x/migration/types/codec.go | 6 ++--- .../types/message_upload_morse_state_test.go | 1 + 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/x/migration/keeper/msg_server_upload_morse_state.go b/x/migration/keeper/msg_server_upload_morse_state.go index f65a8a33f..d648ec9a9 100644 --- a/x/migration/keeper/msg_server_upload_morse_state.go +++ b/x/migration/keeper/msg_server_upload_morse_state.go @@ -3,16 +3,16 @@ package keeper import ( "context" - "github.com/pokt-network/poktroll/x/migration/types" sdk "github.com/cosmos/cosmos-sdk/types" -) + "github.com/pokt-network/poktroll/x/migration/types" +) -func (k msgServer) UploadMorseState(goCtx context.Context, msg *types.MsgUploadMorseState) (*types.MsgUploadMorseStateResponse, error) { +func (k msgServer) UploadMorseState(goCtx context.Context, msg *types.MsgUploadMorseState) (*types.MsgUploadMorseStateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: Handling the message - _ = ctx + // TODO: Handling the message + _ = ctx return &types.MsgUploadMorseStateResponse{}, nil } diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index e21413a83..74bcd9a3e 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -23,7 +23,7 @@ var ( ) const ( - opWeightMsgUploadMorseState = "op_weight_msg_upload_morse_state" + opWeightMsgUploadMorseState = "op_weight_msg_upload_morse_state" // TODO: Determine the simulation weight value defaultWeightMsgUploadMorseState int = 100 @@ -37,7 +37,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } migrationGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&migrationGenesis) @@ -69,14 +69,14 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg( - opWeightMsgUploadMorseState, - defaultWeightMsgUploadMorseState, - func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper) - return nil - }, -), -// this line is used by starport scaffolding # simapp/module/OpMsg + simulation.NewWeightedProposalMsg( + opWeightMsgUploadMorseState, + defaultWeightMsgUploadMorseState, + func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { + migrationsimulation.SimulateMsgUploadMorseState(am.accountKeeper, am.bankKeeper, am.keeper) + return nil + }, + ), + // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/simulation/upload_morse_state.go b/x/migration/simulation/upload_morse_state.go index 5b95864a1..e8fb24b84 100644 --- a/x/migration/simulation/upload_morse_state.go +++ b/x/migration/simulation/upload_morse_state.go @@ -3,11 +3,12 @@ package simulation import ( "math/rand" - "github.com/pokt-network/poktroll/x/migration/keeper" - "github.com/pokt-network/poktroll/x/migration/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" ) func SimulateMsgUploadMorseState( diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index 3710778b2..7eec035d4 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -9,9 +9,9 @@ import ( func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUploadMorseState{}, -) -// this line is used by starport scaffolding # 3 + &MsgUploadMorseState{}, + ) + // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, diff --git a/x/migration/types/message_upload_morse_state_test.go b/x/migration/types/message_upload_morse_state_test.go index 9908bbe9c..84a2814a8 100644 --- a/x/migration/types/message_upload_morse_state_test.go +++ b/x/migration/types/message_upload_morse_state_test.go @@ -5,6 +5,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/sample" )