Skip to content

Commit 7c46764

Browse files
committed
Linter
1 parent 1d535e9 commit 7c46764

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

simsx/context.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package simsx
2+
3+
import (
4+
"context"
5+
"time"
6+
7+
sdk "github.com/cosmos/cosmos-sdk/types"
8+
)
9+
10+
// BlockTime read header block time from sdk context
11+
func BlockTime(ctx context.Context) time.Time {
12+
sdkCtx := sdk.UnwrapSDKContext(ctx)
13+
return sdkCtx.BlockTime()
14+
}

simsx/environment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func (r *XRand) Uint64InRange(min, max uint64) uint64 {
428428
if min >= max {
429429
panic("min must be less than max")
430430
}
431-
return uint64(r.Int63n(int64(max-min)) + int64(min)) // nolint:gosec // test code
431+
return uint64(r.Int63n(int64(max-min)) + int64(min))
432432
}
433433

434434
// Uint32InRange returns a pseudo-random uint32 number in the range [min, max].
@@ -437,7 +437,7 @@ func (r *XRand) Uint32InRange(min, max uint32) uint32 {
437437
if min >= max {
438438
panic("min must be less than max")
439439
}
440-
return uint32(r.Intn(int(max-min))) + min // nolint:gosec // test code
440+
return uint32(r.Intn(int(max-min))) + min
441441
}
442442

443443
func (r *XRand) PositiveSDKIntn(max math.Int) (math.Int, error) {

x/authz/simulation/operations.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
)
4444

4545
// WeightedOperations returns all the operations from the module with their respective weights
46-
// Deprecated: will be removed in the future in favour of msg factory
46+
// Deprecated: will be removed in the future in favor of msg factory
4747
func WeightedOperations(
4848
registry cdctypes.InterfaceRegistry,
4949
appParams simtypes.AppParams,
@@ -90,7 +90,7 @@ func WeightedOperations(
9090
}
9191

9292
// SimulateMsgGrant generates a MsgGrant with random values.
93-
// Deprecated: will be removed in the future in favour of msg factory
93+
// Deprecated: will be removed in the future in favor of msg factory
9494
func SimulateMsgGrant(
9595
cdc *codec.ProtoCodec,
9696
txCfg client.TxConfig,
@@ -164,7 +164,7 @@ func generateRandomAuthorization(r *rand.Rand, spendLimit sdk.Coins) authz.Autho
164164
}
165165

166166
// SimulateMsgRevoke generates a MsgRevoke with random values.
167-
// Deprecated: will be removed in the future in favour of msg factory
167+
// Deprecated: will be removed in the future in favor of msg factory
168168
func SimulateMsgRevoke(
169169
cdc *codec.ProtoCodec,
170170
txCfg client.TxConfig,
@@ -234,7 +234,7 @@ func SimulateMsgRevoke(
234234
}
235235

236236
// SimulateMsgExec generates a MsgExec with random values.
237-
// Deprecated: will be removed in the future in favour of msg factory
237+
// Deprecated: will be removed in the future in favor of msg factory
238238
func SimulateMsgExec(
239239
cdc *codec.ProtoCodec,
240240
txCfg client.TxConfig,

x/feegrant/simulation/operations.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var (
3131
TypeMsgRevokeAllowance = sdk.MsgTypeURL(&feegrant.MsgRevokeAllowance{})
3232
)
3333

34-
// Deprecated: will be removed in the future in favour of msg factory
34+
// Deprecated: will be removed in the future in favor of msg factory
3535
func WeightedOperations(
3636
registry codectypes.InterfaceRegistry,
3737
appParams simtypes.AppParams,
@@ -74,7 +74,7 @@ func WeightedOperations(
7474
}
7575

7676
// SimulateMsgGrantAllowance generates MsgGrantAllowance with random values.
77-
// Deprecated: will be removed in the future in favour of msg factory
77+
// Deprecated: will be removed in the future in favor of msg factory
7878
func SimulateMsgGrantAllowance(
7979
cdc *codec.ProtoCodec,
8080
txConfig client.TxConfig,
@@ -130,7 +130,7 @@ func SimulateMsgGrantAllowance(
130130
}
131131

132132
// SimulateMsgRevokeAllowance generates a MsgRevokeAllowance with random values.
133-
// Deprecated: will be removed in the future in favour of msg factory
133+
// Deprecated: will be removed in the future in favor of msg factory
134134
func SimulateMsgRevokeAllowance(
135135
cdc *codec.ProtoCodec,
136136
txConfig client.TxConfig,

x/gov/module.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
328328
// simulate governance proposals.
329329
// Deprecated: migrate to ProposalMsgsX. This method is ignored when ProposalMsgsX exists and will be removed in the future.
330330
func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { //nolint:staticcheck // used for legacy testing
331-
return simulation.ProposalContents()
331+
return simulation.ProposalContents() //nolint:staticcheck // backwards compatibility
332332
}
333333

334334
// ProposalMsgs returns all the gov msgs used to simulate governance proposals.
@@ -375,5 +375,5 @@ func (am AppModule) WeightedOperationsX(weights simsx.WeightSource, reg simsx.Re
375375
reg.Add(weights.Get("msg_vote", 67), simulation.MsgVoteFactory(am.keeper, state))
376376
reg.Add(weights.Get("msg_weighted_vote", 33), simulation.MsgWeightedVoteFactory(am.keeper, state))
377377
reg.Add(weights.Get("cancel_proposal", 5), simulation.MsgCancelProposalFactory(am.keeper, state))
378-
reg.Add(weights.Get("legacy_text_proposal", 5), simulation.MsgSubmitLegacyProposalFactory(am.keeper, simulation.SimulateLegacyTextProposalContent))
378+
reg.Add(weights.Get("legacy_text_proposal", 5), simulation.MsgSubmitLegacyProposalFactory(am.keeper, simulation.SimulateLegacyTextProposalContent)) //nolint:staticcheck // used for legacy proposal types
379379
}

x/gov/simulation/operations.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const (
4444
)
4545

4646
// WeightedOperations returns all the operations from the module with their respective weights
47-
// Deprecated: will be removed in the future in favour of msg factory
47+
// Deprecated: will be removed in the future in favor of msg factory
4848
func WeightedOperations(
4949
appParams simtypes.AppParams,
5050
txGen client.TxConfig,
@@ -144,7 +144,7 @@ func WeightedOperations(
144144
// SimulateMsgSubmitProposal simulates creating a msg Submit Proposal
145145
// voting on the proposal, and subsequently slashing the proposal. It is implemented using
146146
// future operations.
147-
// Deprecated: will be removed in the future in favour of msg factory
147+
// Deprecated: will be removed in the future in favor of msg factory
148148
func SimulateMsgSubmitProposal(
149149
txGen client.TxConfig,
150150
ak types.AccountKeeper,
@@ -167,7 +167,7 @@ func SimulateMsgSubmitProposal(
167167
// SimulateMsgSubmitLegacyProposal simulates creating a msg Submit Proposal
168168
// voting on the proposal, and subsequently slashing the proposal. It is implemented using
169169
// future operations.
170-
// Deprecated: will be removed in the future in favour of msg factory
170+
// Deprecated: will be removed in the future in favor of msg factory
171171
func SimulateMsgSubmitLegacyProposal(
172172
txGen client.TxConfig,
173173
ak types.AccountKeeper,
@@ -453,7 +453,7 @@ func operationSimulateMsgVote(
453453
}
454454

455455
// SimulateMsgVoteWeighted generates a MsgVoteWeighted with random values.
456-
// Deprecated: will be removed in the future in favour of msg factory
456+
// Deprecated: will be removed in the future in favor of msg factory
457457
func SimulateMsgVoteWeighted(
458458
txGen client.TxConfig,
459459
ak types.AccountKeeper,
@@ -528,7 +528,7 @@ func operationSimulateMsgVoteWeighted(
528528
}
529529

530530
// SimulateMsgCancelProposal generates a MsgCancelProposal.
531-
// Deprecated: will be removed in the future in favour of msg factory
531+
// Deprecated: will be removed in the future in favor of msg factory
532532
func SimulateMsgCancelProposal(
533533
txGen client.TxConfig,
534534
ak types.AccountKeeper,

x/gov/simulation/proposals.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ func SimulateTextProposal(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk
3535
// ProposalContents defines the module weighted proposals' contents
3636
//
3737
// Deprecated: will be removed in the future
38-
//
39-
//nolint:staticcheck // used for legacy testing
4038
func ProposalContents() []simtypes.WeightedProposalContent {
4139
return []simtypes.WeightedProposalContent{
4240
simulation.NewWeightedProposalContent(
@@ -50,8 +48,6 @@ func ProposalContents() []simtypes.WeightedProposalContent {
5048
// SimulateTextProposalContent returns a random text proposal content.
5149
//
5250
// Deprecated: will be removed in the future
53-
//
54-
//nolint:staticcheck // used for legacy testing
5551
func SimulateLegacyTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content {
5652
return v1beta1.NewTextProposal(
5753
simtypes.RandStringOfLength(r, 140),

0 commit comments

Comments
 (0)