ci: remove duplicate gosec & lint fixes (#21685)

This commit is contained in:
Julien Robert
2024-09-12 12:30:50 +00:00
committed by GitHub
parent a77a92adf1
commit bd52dcf096
12 changed files with 44 additions and 120 deletions
+5 -2
View File
@@ -575,7 +575,7 @@ func TestConsensus_Query(t *testing.T) {
c := setUpConsensus(t, 100_000, cometmock.MockMempool[mock.Tx]{})
// Write data to state storage
c.store.GetStateStorage().ApplyChangeset(1, &store.Changeset{
err := c.store.GetStateStorage().ApplyChangeset(1, &store.Changeset{
Changes: []store.StateChanges{
{
Actor: actorName,
@@ -589,8 +589,9 @@ func TestConsensus_Query(t *testing.T) {
},
},
})
require.NoError(t, err)
_, err := c.InitChain(context.Background(), &abciproto.InitChainRequest{
_, err = c.InitChain(context.Background(), &abciproto.InitChainRequest{
Time: time.Now(),
ChainId: "test",
InitialHeight: 1,
@@ -630,6 +631,8 @@ func TestConsensus_Query(t *testing.T) {
}
func setUpConsensus(t *testing.T, gasLimit uint64, mempool mempool.Mempool[mock.Tx]) *Consensus[mock.Tx] {
t.Helper()
msgRouterBuilder := getMsgRouterBuilder(t, func(ctx context.Context, msg *gogotypes.BoolValue) (*gogotypes.BoolValue, error) {
return nil, nil
})
+2 -3
View File
@@ -7,9 +7,6 @@ import (
"strconv"
"strings"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"
cmtcfg "github.com/cometbft/cometbft/config"
cmtjson "github.com/cometbft/cometbft/libs/json"
"github.com/cometbft/cometbft/node"
@@ -18,6 +15,8 @@ import (
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
cmtversion "github.com/cometbft/cometbft/version"
gogoproto "github.com/cosmos/gogoproto/proto"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"
"cosmossdk.io/server/v2/cometbft/client/rpc"
+12 -7
View File
@@ -91,17 +91,22 @@ func (s *MockStore) GetStateCommitment() storev2.Committer {
return s.Committer
}
type Result struct {
key []byte
value []byte
version uint64
proofOps []proof.CommitmentOp
}
func (s *MockStore) Query(storeKey []byte, version uint64, key []byte, prove bool) (storev2.QueryResult, error) {
state, err := s.StateAt(version)
if err != nil {
return storev2.QueryResult{}, err
}
reader, err := state.GetReader(storeKey)
if err != nil {
return storev2.QueryResult{}, err
}
value, err := reader.Get(key)
if err != nil {
return storev2.QueryResult{}, err
}
res := storev2.QueryResult{
Key: key,
Value: value,