Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Mar 26, 2024
1 parent c016ba3 commit afe93f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions server/v2/appmanager/appmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"testing"

appmodulev2 "cosmossdk.io/core/appmodule/v2"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/core/transaction"
ammstore "cosmossdk.io/server/v2/appmanager/store"
"cosmossdk.io/server/v2/core/appmanager"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/server/v2/stf"
"cosmossdk.io/server/v2/stf/branch"
"cosmossdk.io/server/v2/stf/mock"
Expand Down Expand Up @@ -82,7 +82,7 @@ func TestAppManager(t *testing.T) {
t.Run("basic tx", func(t *testing.T) {
result, newState, err := am.DeliverBlock(context.Background(), &appmanager.BlockRequest[mock.Tx]{
Height: 1,
Txs: []mock.Tx{mockTx},
Txs: []mock.Tx{mockTx},
})
require.NoError(t, err)
stateHas(t, newState, "validate")
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestAppManager(t *testing.T) {
_, newState, err := am.Simulate(context.Background(), mockTx)
require.NoError(t, err)
stateHas(t, newState, "validate") // should not has
stateHas(t, newState, "exec") // should not has
stateHas(t, newState, "exec") // should not has
})

t.Run("query basic", func(t *testing.T) {
Expand All @@ -139,8 +139,8 @@ var actorName = []byte("cookies")

func kvSet(t *testing.T, ctx context.Context, v string) error {
t.Helper()
executionCtx, ok := ctx.(*stf.ExecutionContext)
require.True(t, ok)
executionCtx := stf.GetExecutionContext(ctx)
require.NotNil(t, executionCtx)
state, err := executionCtx.State.GetWriter(actorName)
require.NoError(t, err)
return state.Set([]byte(v), []byte(v))
Expand Down
10 changes: 5 additions & 5 deletions server/v2/cometbft/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"testing"

appmodulev2 "cosmossdk.io/core/appmodule/v2"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/core/transaction"
am "cosmossdk.io/server/v2/appmanager"
ammstore "cosmossdk.io/server/v2/appmanager/store"
"cosmossdk.io/server/v2/cometbft/mempool"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/server/v2/stf"
"cosmossdk.io/server/v2/stf/branch"
"cosmossdk.io/server/v2/stf/mock"
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestConsensus(t *testing.T) {

t.Run("Check tx basic", func(t *testing.T) {
res, err := c.CheckTx(context.Background(), &abci.RequestCheckTx{
Tx: mockTx.Bytes(),
Tx: mockTx.Bytes(),
Type: 0,
})
require.NotNil(t, res.GasUsed)
Expand All @@ -85,8 +85,8 @@ var actorName = []byte("cookies")

func kvSet(t *testing.T, ctx context.Context, v string) error {
t.Helper()
executionCtx, ok := ctx.(*stf.ExecutionContext)
require.True(t, ok)
executionCtx := stf.GetExecutionContext(ctx)
require.NotNil(t, executionCtx)
state, err := executionCtx.State.GetWriter(actorName)
require.NoError(t, err)
return state.Set([]byte(v), []byte(v))
Expand All @@ -108,4 +108,4 @@ func stateNotHas(t *testing.T, accountState corestore.ReaderMap, key string) {
has, err := state.Has([]byte(key))
require.NoError(t, err)
require.Falsef(t, has, "state was not supposed to have key: %s", key)
}
}

0 comments on commit afe93f0

Please sign in to comment.