Skip to content

Commit

Permalink
Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Jun 18, 2024
1 parent 561c630 commit de2efd7
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ func newFileBackendKeyringConfig(name, dir string, buf io.Reader) keyring.Config

func newRealPrompt(dir string, buf io.Reader) func(string) (string, error) {
return func(prompt string) (string, error) {
keyhashStored := false
var keyhashStored bool
keyhashFilePath := filepath.Join(dir, "keyhash")

var keyhash []byte
Expand Down
2 changes: 1 addition & 1 deletion types/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ func (d *Dec) MarshalTo(data []byte) (n int, err error) {
// Unmarshal implements the gogo proto custom type interface.
func (d *Dec) Unmarshal(data []byte) error {
if len(data) == 0 {
d = nil
d = nil //nolint: wastedassign

Check warning on line 747 in types/decimal.go

View check run for this annotation

Codecov / codecov/patch

types/decimal.go#L747

Added line #L747 was not covered by tests
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion types/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func (i *Int) MarshalTo(data []byte) (n int, err error) {
// Unmarshal implements the gogo proto custom type interface.
func (i *Int) Unmarshal(data []byte) error {
if len(data) == 0 {
i = nil
i = nil //nolint: wastedassign

Check warning on line 406 in types/int.go

View check run for this annotation

Codecov / codecov/patch

types/int.go#L406

Added line #L406 was not covered by tests
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion types/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (u *Uint) MarshalTo(data []byte) (n int, err error) {
// Unmarshal implements the gogo proto custom type interface.
func (u *Uint) Unmarshal(data []byte) error {
if len(data) == 0 {
u = nil
u = nil //nolint: wastedassign

Check warning on line 181 in types/uint.go

View check run for this annotation

Codecov / codecov/patch

types/uint.go#L181

Added line #L181 was not covered by tests
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions x/auth/ante/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ func (svd *SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
if !simulate {
if !genesis {
sigKey := fmt.Sprintf("%d:%d", signerData.AccountNumber, signerData.Sequence)
// TODO could we use `tx.(*wrapper).getBodyBytes()` instead of `ctx.TxBytes()`?
// TODO: could we use `tx.(*wrapper).getBodyBytes()` instead of `ctx.TxBytes()`?
txHash := sha256.Sum256(ctx.TxBytes())
stored := false
var stored bool

// TODO(duong2): Does this really improve performance?
// TODO: Does this really improve performance?
stored, err = svd.verifySignatureWithCache(ctx, pubKey, signerData, sig.Data, tx, sigKey, txHash[:])

if stored {
Expand Down
2 changes: 1 addition & 1 deletion x/auth/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ func (s *IntegrationTestSuite) TestQueryModuleAccountByNameCmd() {

func TestGetBroadcastCommandOfflineFlag(t *testing.T) {
clientCtx := client.Context{}.WithOffline(true)
clientCtx = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig) //nolint:staticcheck
_ = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig)

Check warning on line 1271 in x/auth/client/testutil/suite.go

View check run for this annotation

Codecov / codecov/patch

x/auth/client/testutil/suite.go#L1271

Added line #L1271 was not covered by tests

cmd := authcli.GetBroadcastCommand()
_ = testutil.ApplyMockIODiscardOutErr(cmd)
Expand Down
2 changes: 1 addition & 1 deletion x/auth/client/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestParseQueryResponse(t *testing.T) {
require.Equal(t, 10, int(res.GasInfo.GasUsed))
require.NotNil(t, res.Result)

res, err = authclient.ParseQueryResponse([]byte("fuzzy"))
_, err = authclient.ParseQueryResponse([]byte("fuzzy"))
require.Error(t, err)
}

Expand Down
2 changes: 1 addition & 1 deletion x/gov/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestImportExportQueues(t *testing.T) {
// Run the endblocker. Check to make sure that proposal1 is removed from state, and proposal2 is finished VotingPeriod.
gov.EndBlocker(ctx2, app2.GovKeeper)

proposal1, ok = app2.GovKeeper.GetProposal(ctx2, proposalID1)
_, ok = app2.GovKeeper.GetProposal(ctx2, proposalID1)
require.False(t, ok)

proposal2, ok = app2.GovKeeper.GetProposal(ctx2, proposalID2)
Expand Down
2 changes: 1 addition & 1 deletion x/gov/keeper/deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestDeposits(t *testing.T) {
require.True(t, found)
require.Equal(t, fourStake, deposit.Amount)
app.GovKeeper.RefundDeposits(ctx, proposalID)
deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1])
_, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1])
require.False(t, found)
require.Equal(t, addr0Initial, app.BankKeeper.GetAllBalances(ctx, TestAddrs[0]))
require.Equal(t, addr1Initial, app.BankKeeper.GetAllBalances(ctx, TestAddrs[1]))
Expand Down
8 changes: 4 additions & 4 deletions x/staking/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ func TestMultipleRedelegationAtSameTime(t *testing.T) {

// move forward in time, should complete both redelegations
ctx = tstaking.TurnBlockTimeDiff(1 * time.Second)
rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2)
_, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2)
require.False(t, found)
}

Expand Down Expand Up @@ -940,7 +940,7 @@ func TestMultipleRedelegationAtUniqueTimes(t *testing.T) {

// move forward in time, should complete the second redelegation
ctx = tstaking.TurnBlockTimeDiff(5 * time.Second)
rd, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2)
_, found = app.StakingKeeper.GetRedelegation(ctx, selfDelAddr, valAddr, valAddr2)
require.False(t, found)
}

Expand Down Expand Up @@ -980,7 +980,7 @@ func TestMultipleUnbondingDelegationAtSameTime(t *testing.T) {

// move forwaubd in time, should complete both ubds
ctx = tstaking.TurnBlockTimeDiff(1 * time.Second)
ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr)
_, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr)
require.False(t, found)
}

Expand Down Expand Up @@ -1028,7 +1028,7 @@ func TestMultipleUnbondingDelegationAtUniqueTimes(t *testing.T) {

// move forwaubd in time, should complete the second redelegation
ctx = tstaking.TurnBlockTimeDiff(5 * time.Second)
ubd, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr)
_, found = app.StakingKeeper.GetUnbondingDelegation(ctx, selfDelAddr, valAddr)
require.False(t, found)
}

Expand Down
2 changes: 1 addition & 1 deletion x/staking/keeper/delegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) {
require.NoError(t, simapp.FundModuleAccount(app, ctx, bondedPool.GetName(), delCoins))
app.AccountKeeper.SetModuleAccount(ctx, bondedPool)

validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true)
_ = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true)
delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares)
app.StakingKeeper.SetDelegation(ctx, delegation)

Expand Down

0 comments on commit de2efd7

Please sign in to comment.