style: apply any / all automated lint fixes (#15644)
This commit is contained in:
parent
64ab721a08
commit
a9546bfad0
@ -2,6 +2,7 @@ package flag
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
|
||||
"cosmossdk.io/core/coins"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
@ -2,6 +2,7 @@ package flag
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
cosmos_proto "github.com/cosmos/cosmos-proto"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
@ -210,7 +210,7 @@ func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cip
|
||||
// Bug compatibility with C bcrypt implementations. They use the trailing
|
||||
// NULL in the key string during expansion.
|
||||
// We copy the key to prevent changing the underlying array.
|
||||
ckey := append(key[:len(key):len(key)], 0) //nolint:gocritic // used in original https://cs.opensource.google/go/x/crypto/+/master:bcrypt/bcrypt.go
|
||||
ckey := append(key[:len(key):len(key)], 0)
|
||||
|
||||
c, err := blowfish.NewSaltedCipher(ckey, csalt)
|
||||
if err != nil {
|
||||
|
||||
@ -16,7 +16,7 @@ func Test_genPrivKey(t *testing.T) {
|
||||
copy(onePadded[32-len(oneB):32], oneB)
|
||||
t.Logf("one padded: %v, len=%v", onePadded, len(onePadded))
|
||||
|
||||
validOne := append(empty, onePadded...) //nolint:gocritic // append is fine here
|
||||
validOne := append(empty, onePadded...)
|
||||
tests := []struct {
|
||||
name string
|
||||
notSoRand []byte
|
||||
|
||||
@ -26,7 +26,7 @@ func (s *StringSuite) TestUnsafeStrToBytes() {
|
||||
b := unsafeConvertStr()
|
||||
runtime.GC()
|
||||
<-time.NewTimer(2 * time.Millisecond).C
|
||||
b2 := append(b, 'd') //nolint:gocritic // append is fine here
|
||||
b2 := append(b, 'd')
|
||||
s.Equal("abc", string(b))
|
||||
s.Equal("abcd", string(b2))
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ func TestDiffKVStores(t *testing.T) {
|
||||
|
||||
// Same keys, different value. Comparisons will be nil as prefixes are skipped.
|
||||
prefix := []byte("prefix:")
|
||||
k1Prefixed := append(prefix, k1...) //nolint:gocritic // append is fine here
|
||||
k1Prefixed := append(prefix, k1...)
|
||||
store1.Set(k1Prefixed, v1)
|
||||
store2.Set(k1Prefixed, v2)
|
||||
checkDiffResults(t, store1, store2)
|
||||
|
||||
@ -45,7 +45,7 @@ type Server struct {
|
||||
|
||||
func (h Server) Start() error {
|
||||
h.logger.Info(fmt.Sprintf("Rosetta server listening on add %s", h.addr))
|
||||
return http.ListenAndServe(h.addr, h.h) //nolint:gosec // users are recommended to operate a proxy in front of this server
|
||||
return http.ListenAndServe(h.addr, h.h) //nolint:gosec // users are recommended to operate a proxy in front of this server
|
||||
}
|
||||
|
||||
func NewServer(settings Settings) (Server, error) {
|
||||
|
||||
@ -251,7 +251,7 @@ func (ak AccountKeeper) decodeAccount(bz []byte) sdk.AccountI {
|
||||
}
|
||||
|
||||
// MarshalAccount protobuf serializes an Account interface
|
||||
func (ak AccountKeeper) MarshalAccount(accountI sdk.AccountI) ([]byte, error) { //nolint:interfacer
|
||||
func (ak AccountKeeper) MarshalAccount(accountI sdk.AccountI) ([]byte, error) {
|
||||
return ak.cdc.MarshalInterface(accountI)
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 100
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -23,9 +23,7 @@ var (
|
||||
_ sdk.ModuleAccountI = (*ModuleAccount)(nil)
|
||||
)
|
||||
|
||||
// NewBaseAccount creates a new BaseAccount object
|
||||
//
|
||||
//nolint:interfacer
|
||||
// NewBaseAccount creates a new BaseAccount object.
|
||||
func NewBaseAccount(address sdk.AccAddress, pubKey cryptotypes.PubKey, accountNumber, sequence uint64) *BaseAccount {
|
||||
acc := &BaseAccount{
|
||||
Address: address.String(),
|
||||
|
||||
@ -27,7 +27,6 @@ func NewBaseAccountWithPubKey(pubkey cryptotypes.PubKey) (*BaseAccount, error) {
|
||||
return baseAccount, nil
|
||||
}
|
||||
|
||||
//nolint:gosec // this isn't an hardcoded credential
|
||||
const ModuleCredentialType = "ModuleCredential"
|
||||
|
||||
var _ cryptotypes.PubKey = &ModuleCredential{}
|
||||
|
||||
@ -21,8 +21,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins, endTime int64, delayed bool) *MsgCreateVestingAccount {
|
||||
return &MsgCreateVestingAccount{
|
||||
FromAddress: fromAddr.String(),
|
||||
@ -70,8 +68,6 @@ func (msg MsgCreateVestingAccount) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// NewMsgCreatePermanentLockedAccount returns a reference to a new MsgCreatePermanentLockedAccount.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgCreatePermanentLockedAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgCreatePermanentLockedAccount {
|
||||
return &MsgCreatePermanentLockedAccount{
|
||||
FromAddress: fromAddr.String(),
|
||||
@ -113,8 +109,6 @@ func (msg MsgCreatePermanentLockedAccount) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// NewMsgCreatePeriodicVestingAccount returns a reference to a new MsgCreatePeriodicVestingAccount.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, periods []Period) *MsgCreatePeriodicVestingAccount {
|
||||
return &MsgCreatePeriodicVestingAccount{
|
||||
FromAddress: fromAddr.String(),
|
||||
|
||||
@ -28,8 +28,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgGrant creates a new MsgGrant
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgGrant(granter, grantee sdk.AccAddress, a Authorization, expiration *time.Time) (*MsgGrant, error) {
|
||||
m := &MsgGrant{
|
||||
Granter: granter.String(),
|
||||
@ -109,8 +107,6 @@ func (msg MsgGrant) UnpackInterfaces(unpacker cdctypes.AnyUnpacker) error {
|
||||
}
|
||||
|
||||
// NewMsgRevoke creates a new MsgRevoke
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgRevoke(granter, grantee sdk.AccAddress, msgTypeURL string) MsgRevoke {
|
||||
return MsgRevoke{
|
||||
Granter: granter.String(),
|
||||
@ -153,8 +149,6 @@ func (msg MsgRevoke) GetSignBytes() []byte {
|
||||
}
|
||||
|
||||
// NewMsgExec creates a new MsgExecAuthorized
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgExec(grantee sdk.AccAddress, msgs []sdk.Msg) MsgExec {
|
||||
msgsAny := make([]*cdctypes.Any, len(msgs))
|
||||
for i, msg := range msgs {
|
||||
|
||||
@ -27,9 +27,9 @@ var (
|
||||
|
||||
// Simulation operation weights constants
|
||||
const (
|
||||
OpWeightMsgGrant = "op_weight_msg_grant" //nolint:gosec
|
||||
OpWeightRevoke = "op_weight_msg_revoke" //nolint:gosec
|
||||
OpWeightExec = "op_weight_msg_execute" //nolint:gosec
|
||||
OpWeightMsgGrant = "op_weight_msg_grant"
|
||||
OpWeightRevoke = "op_weight_msg_revoke"
|
||||
OpWeightExec = "op_weight_msg_execute"
|
||||
)
|
||||
|
||||
// authz operations weights
|
||||
|
||||
@ -108,7 +108,7 @@ func TestMigrateDenomMetaData(t *testing.T) {
|
||||
newKey := denomMetadataIter.Key()
|
||||
|
||||
// make sure old entry is deleted
|
||||
oldKey := append(newKey, newKey[0:]...) //nolint:gocritic // append is ok here
|
||||
oldKey := append(newKey, newKey[0:]...)
|
||||
bz := denomMetadataStore.Get(oldKey)
|
||||
require.Nil(t, bz)
|
||||
|
||||
|
||||
@ -18,10 +18,10 @@ import (
|
||||
|
||||
// Simulation operation weights constants
|
||||
const (
|
||||
OpWeightMsgSend = "op_weight_msg_send" //nolint:gosec
|
||||
OpWeightMsgMultiSend = "op_weight_msg_multisend" //nolint:gosec
|
||||
DefaultWeightMsgSend = 100 // from simappparams.DefaultWeightMsgSend
|
||||
DefaultWeightMsgMultiSend = 10 // from simappparams.DefaultWeightMsgMultiSend
|
||||
OpWeightMsgSend = "op_weight_msg_send"
|
||||
OpWeightMsgMultiSend = "op_weight_msg_multisend"
|
||||
DefaultWeightMsgSend = 100 // from simappparams.DefaultWeightMsgSend
|
||||
DefaultWeightMsgMultiSend = 10 // from simappparams.DefaultWeightMsgMultiSend
|
||||
)
|
||||
|
||||
// WeightedOperations returns all the operations from the module with their respective weights
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 100
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -20,7 +20,7 @@ var (
|
||||
|
||||
// NewMsgSend - construct a msg to send coins from one account to another.
|
||||
//
|
||||
//nolint:interfacer
|
||||
|
||||
func NewMsgSend(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgSend {
|
||||
return &MsgSend{FromAddress: fromAddr.String(), ToAddress: toAddr.String(), Amount: amount}
|
||||
}
|
||||
@ -116,8 +116,6 @@ func (in Input) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewInput - create a transaction input, used with MsgMultiSend
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewInput(addr sdk.AccAddress, coins sdk.Coins) Input {
|
||||
return Input{
|
||||
Address: addr.String(),
|
||||
@ -143,8 +141,6 @@ func (out Output) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewOutput - create a transaction output, used with MsgMultiSend
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewOutput(addr sdk.AccAddress, coins sdk.Coins) Output {
|
||||
return Output{
|
||||
Address: addr.String(),
|
||||
|
||||
@ -14,37 +14,28 @@ const (
|
||||
)
|
||||
|
||||
// NewQueryBalanceRequest creates a new instance of QueryBalanceRequest.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewQueryBalanceRequest(addr sdk.AccAddress, denom string) *QueryBalanceRequest {
|
||||
return &QueryBalanceRequest{Address: addr.String(), Denom: denom}
|
||||
}
|
||||
|
||||
// NewQueryAllBalancesRequest creates a new instance of QueryAllBalancesRequest.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewQueryAllBalancesRequest(addr sdk.AccAddress, req *query.PageRequest, resolveDenom bool) *QueryAllBalancesRequest {
|
||||
return &QueryAllBalancesRequest{Address: addr.String(), Pagination: req, ResolveDenom: resolveDenom}
|
||||
}
|
||||
|
||||
// NewQuerySpendableBalancesRequest creates a new instance of a
|
||||
// QuerySpendableBalancesRequest.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewQuerySpendableBalancesRequest(addr sdk.AccAddress, req *query.PageRequest) *QuerySpendableBalancesRequest {
|
||||
return &QuerySpendableBalancesRequest{Address: addr.String(), Pagination: req}
|
||||
}
|
||||
|
||||
// NewQuerySpendableBalanceByDenomRequest creates a new instance of a
|
||||
// QuerySpendableBalanceByDenomRequest.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewQuerySpendableBalanceByDenomRequest(addr sdk.AccAddress, denom string) *QuerySpendableBalanceByDenomRequest {
|
||||
return &QuerySpendableBalanceByDenomRequest{Address: addr.String(), Denom: denom}
|
||||
}
|
||||
|
||||
// QueryTotalSupplyParams defines the params for the following queries:
|
||||
//
|
||||
// - 'custom/bank/totalSupply'
|
||||
type QueryTotalSupplyParams struct {
|
||||
Page, Limit int
|
||||
@ -56,7 +47,6 @@ func NewQueryTotalSupplyParams(page, limit int) QueryTotalSupplyParams {
|
||||
}
|
||||
|
||||
// QuerySupplyOfParams defines the params for the following queries:
|
||||
//
|
||||
// - 'custom/bank/totalSupplyOf'
|
||||
type QuerySupplyOfParams struct {
|
||||
Denom string
|
||||
|
||||
@ -15,8 +15,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgVerifyInvariant creates a new MsgVerifyInvariant object
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgVerifyInvariant(sender sdk.AccAddress, invModeName, invRoute string) *MsgVerifyInvariant {
|
||||
return &MsgVerifyInvariant{
|
||||
Sender: sender.String(),
|
||||
|
||||
@ -19,10 +19,10 @@ import (
|
||||
|
||||
// Simulation operation weights constants
|
||||
const (
|
||||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec
|
||||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec
|
||||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec
|
||||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec
|
||||
OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address"
|
||||
OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward"
|
||||
OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission"
|
||||
OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool"
|
||||
|
||||
DefaultWeightMsgSetWithdrawAddress int = 50
|
||||
DefaultWeightMsgWithdrawDelegationReward int = 50
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 50
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -4,7 +4,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
//nolint:interfacer
|
||||
func NewGenesisState(
|
||||
params Params, fp FeePool, dwis []DelegatorWithdrawInfo, pp sdk.ConsAddress, r []ValidatorOutstandingRewardsRecord,
|
||||
acc []ValidatorAccumulatedCommissionRecord, historical []ValidatorHistoricalRewardsRecord,
|
||||
|
||||
@ -32,8 +32,6 @@ func (res QueryDelegatorTotalRewardsResponse) String() string {
|
||||
}
|
||||
|
||||
// NewDelegationDelegatorReward constructs a DelegationDelegatorReward.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewDelegationDelegatorReward(valAddr sdk.ValAddress, reward sdk.DecCoins) DelegationDelegatorReward {
|
||||
return DelegationDelegatorReward{ValidatorAddress: valAddr.String(), Reward: reward}
|
||||
}
|
||||
|
||||
@ -21,8 +21,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgSubmitEvidence returns a new MsgSubmitEvidence with a signer/submitter.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgSubmitEvidence(s sdk.AccAddress, evi exported.Evidence) (*MsgSubmitEvidence, error) {
|
||||
msg, ok := evi.(proto.Message)
|
||||
if !ok {
|
||||
|
||||
@ -13,8 +13,6 @@ import (
|
||||
var _ types.UnpackInterfacesMessage = &Grant{}
|
||||
|
||||
// NewGrant creates a new FeeAllowanceGrant.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewGrant(granter, grantee sdk.AccAddress, feeAllowance FeeAllowanceI) (Grant, error) {
|
||||
msg, ok := feeAllowance.(proto.Message)
|
||||
if !ok {
|
||||
|
||||
@ -20,8 +20,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgGrantAllowance creates a new MsgGrantAllowance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgGrantAllowance(feeAllowance FeeAllowanceI, granter, grantee sdk.AccAddress) (*MsgGrantAllowance, error) {
|
||||
msg, ok := feeAllowance.(proto.Message)
|
||||
if !ok {
|
||||
@ -74,7 +72,7 @@ func (msg MsgGrantAllowance) UnpackInterfaces(unpacker types.AnyUnpacker) error
|
||||
// NewMsgRevokeAllowance returns a message to revoke a fee allowance for a given
|
||||
// granter and grantee
|
||||
//
|
||||
//nolint:interfacer
|
||||
|
||||
func NewMsgRevokeAllowance(granter, grantee sdk.AccAddress) MsgRevokeAllowance {
|
||||
return MsgRevokeAllowance{Granter: granter.String(), Grantee: grantee.String()}
|
||||
}
|
||||
|
||||
@ -29,8 +29,6 @@ var (
|
||||
)
|
||||
|
||||
// Simulation operation weights constants
|
||||
//
|
||||
//nolint:gosec // these are not hard-coded credentials.
|
||||
const (
|
||||
OpWeightMsgDeposit = "op_weight_msg_deposit"
|
||||
OpWeightMsgVote = "op_weight_msg_vote"
|
||||
|
||||
@ -7,8 +7,6 @@ import (
|
||||
)
|
||||
|
||||
// NewDeposit creates a new Deposit instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit {
|
||||
return Deposit{proposalID, depositor.String(), amount}
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgSubmitProposal creates a new MsgSubmitProposal.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgSubmitProposal(
|
||||
messages []sdk.Msg,
|
||||
initialDeposit sdk.Coins,
|
||||
@ -127,8 +125,6 @@ func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err
|
||||
}
|
||||
|
||||
// NewMsgDeposit creates a new MsgDeposit instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) *MsgDeposit {
|
||||
return &MsgDeposit{proposalID, depositor.String(), amount}
|
||||
}
|
||||
@ -162,8 +158,6 @@ func (msg MsgDeposit) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// NewMsgVote creates a message to cast a vote on an active proposal
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption, metadata string) *MsgVote {
|
||||
return &MsgVote{proposalID, voter.String(), option, metadata}
|
||||
}
|
||||
@ -193,8 +187,6 @@ func (msg MsgVote) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// NewMsgVoteWeighted creates a message to cast a vote on an active proposal
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions, metadata string) *MsgVoteWeighted {
|
||||
return &MsgVoteWeighted{proposalID, voter.String(), options, metadata}
|
||||
}
|
||||
@ -248,9 +240,7 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress {
|
||||
return []sdk.AccAddress{voter}
|
||||
}
|
||||
|
||||
// NewMsgExecLegacyContent creates a new MsgExecLegacyContent instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
// NewMsgExecLegacyContent creates a new MsgExecLegacyContent instance.
|
||||
func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExecLegacyContent {
|
||||
return &MsgExecLegacyContent{
|
||||
Content: content,
|
||||
@ -307,9 +297,7 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
||||
return []sdk.AccAddress{authority}
|
||||
}
|
||||
|
||||
// NewMsgCancelProposal creates a new MsgCancelProposal instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
// NewMsgCancelProposal creates a new MsgCancelProposal instance.
|
||||
func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal {
|
||||
return &MsgCancelProposal{
|
||||
ProposalId: proposalID,
|
||||
|
||||
@ -18,8 +18,6 @@ const (
|
||||
)
|
||||
|
||||
// NewVote creates a new Vote instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions, metadata string) Vote {
|
||||
return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options, Metadata: metadata}
|
||||
}
|
||||
|
||||
@ -7,8 +7,6 @@ import (
|
||||
)
|
||||
|
||||
// NewDeposit creates a new Deposit instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit {
|
||||
return Deposit{proposalID, depositor.String(), amount}
|
||||
}
|
||||
|
||||
@ -32,8 +32,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgSubmitProposal creates a new MsgSubmitProposal.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) {
|
||||
m := &MsgSubmitProposal{
|
||||
InitialDeposit: initialDeposit,
|
||||
@ -134,7 +132,7 @@ func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err
|
||||
|
||||
// NewMsgDeposit creates a new MsgDeposit instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
|
||||
func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) *MsgDeposit {
|
||||
return &MsgDeposit{proposalID, depositor.String(), amount}
|
||||
}
|
||||
@ -167,8 +165,6 @@ func (msg MsgDeposit) GetSigners() []sdk.AccAddress {
|
||||
}
|
||||
|
||||
// NewMsgVote creates a message to cast a vote on an active proposal
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *MsgVote {
|
||||
return &MsgVote{proposalID, voter.String(), option}
|
||||
}
|
||||
@ -197,9 +193,7 @@ func (msg MsgVote) GetSigners() []sdk.AccAddress {
|
||||
return []sdk.AccAddress{voter}
|
||||
}
|
||||
|
||||
// NewMsgVoteWeighted creates a message to cast a vote on an active proposal
|
||||
//
|
||||
//nolint:interfacer
|
||||
// NewMsgVoteWeighted creates a message to cast a vote on an active proposal.
|
||||
func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted {
|
||||
return &MsgVoteWeighted{proposalID, voter.String(), options}
|
||||
}
|
||||
|
||||
@ -9,9 +9,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// NewVote creates a new Vote instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
// NewVote creates a new Vote instance.
|
||||
func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions) Vote {
|
||||
return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options}
|
||||
}
|
||||
|
||||
@ -41,8 +41,6 @@ var (
|
||||
)
|
||||
|
||||
// Simulation operation weights constants
|
||||
//
|
||||
//nolint:gosec // these are not hardcoded credentials.
|
||||
const (
|
||||
OpMsgCreateGroup = "op_weight_msg_create_group"
|
||||
OpMsgUpdateGroupAdmin = "op_weight_msg_update_group_admin"
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 100
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -26,7 +26,7 @@ func (s *StringSuite) TestUnsafeStrToBytes() {
|
||||
b := unsafeConvertStr()
|
||||
runtime.GC()
|
||||
<-time.NewTimer(2 * time.Millisecond).C
|
||||
b2 := append(b, 'd') //nolint:gocritic // append is fine here
|
||||
b2 := append(b, 'd')
|
||||
s.Equal("abc", string(b))
|
||||
s.Equal("abcd", string(b2))
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 100
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -18,8 +18,6 @@ var (
|
||||
)
|
||||
|
||||
// NewMsgUnjail creates a new MsgUnjail instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgUnjail(validatorAddr sdk.ValAddress) *MsgUnjail {
|
||||
return &MsgUnjail{
|
||||
ValidatorAddr: validatorAddr.String(),
|
||||
|
||||
@ -8,8 +8,6 @@ import (
|
||||
)
|
||||
|
||||
// NewValidatorSigningInfo creates a new ValidatorSigningInfo instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewValidatorSigningInfo(
|
||||
consAddr sdk.ConsAddress, startHeight, indexOffset int64,
|
||||
jailedUntil time.Time, tombstoned bool, missedBlocksCounter int64,
|
||||
|
||||
@ -57,7 +57,7 @@ func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegati
|
||||
|
||||
// GetValidatorDelegations returns all delegations to a specific validator.
|
||||
// Useful for querier.
|
||||
func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation) { //nolint:interfacer
|
||||
func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
|
||||
iterator := storetypes.KVStorePrefixIterator(store, types.DelegationKey)
|
||||
|
||||
@ -17,8 +17,6 @@ import (
|
||||
)
|
||||
|
||||
// Simulation operation weights constants
|
||||
//
|
||||
//nolint:gosec // these are not hardcoded credentials
|
||||
const (
|
||||
DefaultWeightMsgCreateValidator int = 100
|
||||
DefaultWeightMsgEditValidator int = 5
|
||||
|
||||
@ -15,7 +15,7 @@ import (
|
||||
const (
|
||||
DefaultWeightMsgUpdateParams int = 100
|
||||
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec
|
||||
OpWeightMsgUpdateParams = "op_weight_msg_update_params"
|
||||
)
|
||||
|
||||
// ProposalMsgs defines the module weighted proposals' contents
|
||||
|
||||
@ -14,8 +14,6 @@ import (
|
||||
var _ DelegationI = Delegation{}
|
||||
|
||||
// NewDelegation creates a new delegation object
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) Delegation {
|
||||
return Delegation{
|
||||
DelegatorAddress: delegatorAddr.String(),
|
||||
@ -115,8 +113,6 @@ func UnmarshalUBDE(cdc codec.BinaryCodec, value []byte) (ubd UnbondingDelegation
|
||||
}
|
||||
|
||||
// NewUnbondingDelegation - create a new unbonding delegation object
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewUnbondingDelegation(
|
||||
delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress,
|
||||
creationHeight int64, minTime time.Time, balance math.Int, id uint64,
|
||||
@ -213,7 +209,6 @@ func (e RedelegationEntry) OnHold() bool {
|
||||
return e.UnbondingOnHoldRefCount > 0
|
||||
}
|
||||
|
||||
//nolint:interfacer
|
||||
func NewRedelegation(
|
||||
delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress,
|
||||
creationHeight int64, minTime time.Time, balance math.Int, sharesDst sdk.Dec, id uint64,
|
||||
@ -311,8 +306,6 @@ func (d DelegationResponses) String() (out string) {
|
||||
}
|
||||
|
||||
// NewRedelegationResponse crates a new RedelegationEntryResponse instance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewRedelegationResponse(
|
||||
delegatorAddr sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress, entries []RedelegationEntryResponse,
|
||||
) RedelegationResponse {
|
||||
|
||||
@ -33,7 +33,7 @@ var (
|
||||
// NewMsgCreateValidator creates a new MsgCreateValidator instance.
|
||||
// Delegator address and validator address are the same.
|
||||
func NewMsgCreateValidator(
|
||||
valAddr sdk.ValAddress, pubKey cryptotypes.PubKey, //nolint:interfacer
|
||||
valAddr sdk.ValAddress, pubKey cryptotypes.PubKey,
|
||||
selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation math.Int,
|
||||
) (*MsgCreateValidator, error) {
|
||||
var pkAny *codectypes.Any
|
||||
@ -120,8 +120,6 @@ func (msg MsgCreateValidator) UnpackInterfaces(unpacker codectypes.AnyUnpacker)
|
||||
}
|
||||
|
||||
// NewMsgEditValidator creates a new MsgEditValidator instance
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec, newMinSelfDelegation *math.Int) *MsgEditValidator {
|
||||
return &MsgEditValidator{
|
||||
Description: description,
|
||||
@ -170,8 +168,6 @@ func (msg MsgEditValidator) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewMsgDelegate creates a new MsgDelegate instance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) *MsgDelegate {
|
||||
return &MsgDelegate{
|
||||
DelegatorAddress: delAddr.String(),
|
||||
@ -212,8 +208,6 @@ func (msg MsgDelegate) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgBeginRedelegate(
|
||||
delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin,
|
||||
) *MsgBeginRedelegate {
|
||||
@ -260,8 +254,6 @@ func (msg MsgBeginRedelegate) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewMsgUndelegate creates a new MsgUndelegate instance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) *MsgUndelegate {
|
||||
return &MsgUndelegate{
|
||||
DelegatorAddress: delAddr.String(),
|
||||
@ -302,8 +294,6 @@ func (msg MsgUndelegate) ValidateBasic() error {
|
||||
}
|
||||
|
||||
// NewMsgCancelUnbondingDelegation creates a new MsgCancelUnbondingDelegation instance.
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewMsgCancelUnbondingDelegation(delAddr sdk.AccAddress, valAddr sdk.ValAddress, creationHeight int64, amount sdk.Coin) *MsgCancelUnbondingDelegation {
|
||||
return &MsgCancelUnbondingDelegation{
|
||||
DelegatorAddress: delAddr.String(),
|
||||
|
||||
@ -39,8 +39,6 @@ var (
|
||||
var _ ValidatorI = Validator{}
|
||||
|
||||
// NewValidator constructs a new Validator
|
||||
//
|
||||
//nolint:interfacer
|
||||
func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, description Description) (Validator, error) {
|
||||
pkAny, err := codectypes.NewAnyWithValue(pubKey)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user