Skip to content

Commit

Permalink
lint / codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Sep 20, 2022
1 parent d6fbf28 commit 0691dfc
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/secretd/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ blockchain. Writes the certificate in DER format to ~/attestation_cert
userHome, _ := os.UserHomeDir()

// Load consensus_seed_exchange_pubkey
cert := []byte(nil)
var cert []byte
if len(args) >= 1 {
cert, err = os.ReadFile(args[0])
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions cmd/secretd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"path/filepath"
"strings"

"github.com/cosmos/cosmos-sdk/codec"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
"github.com/cosmos/cosmos-sdk/types/module"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
Expand Down Expand Up @@ -315,8 +314,8 @@ func exportAppStateAndTMValidators(
) (servertypes.ExportedApp, error) {
bootstrap := viper.GetBool("bootstrap")

encCfg := app.MakeEncodingConfig()
encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry)
// encCfg := app.MakeEncodingConfig()
// encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry)
var wasmApp *app.SecretNetworkApp
if height != -1 {
wasmApp = app.NewSecretNetworkApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), bootstrap, appOpts, compute.DefaultWasmConfig())
Expand Down
3 changes: 3 additions & 0 deletions x/compute/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ func CmdDecryptText() *cobra.Command {
}

nonce, originalTxSenderPubkey, ciphertextInput, err := parseEncryptedBlob(dataCipherBz)
if err != nil {
return fmt.Errorf("error while trying to parse encrypted blob: %w", err)
}

wasmCtx := wasmUtils.WASMContext{CLIContext: clientCtx}
_, myPubkey, err := wasmCtx.GetTxSenderKeyPair()
Expand Down
2 changes: 1 addition & 1 deletion x/compute/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewHandler(k Keeper) sdk.Handler {
ctx = ctx.WithEventManager(sdk.NewEventManager())

switch msg := msg.(type) {
case *MsgStoreCode: //nolint
case *MsgStoreCode:
return handleStoreCode(ctx, k, msg)
case *MsgInstantiateContract:
return handleInstantiate(ctx, k, msg)
Expand Down
2 changes: 1 addition & 1 deletion x/compute/internal/keeper/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func TestHandler(k Keeper) sdk.Handler {
ctx = ctx.WithEventManager(sdk.NewEventManager())

switch msg := msg.(type) {
case *wasmtypes.MsgInstantiateContract: //nolint
case *wasmtypes.MsgInstantiateContract:
return handleInstantiate(ctx, k, msg)
case *wasmtypes.MsgExecuteContract:
return handleExecute(ctx, k, msg)
Expand Down
2 changes: 1 addition & 1 deletion x/registration/alias.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// nolint

// autogenerated code using github.com/rigelrozanski/multitool
// aliases generated for the following subdirectories:
// ALIASGEN: github.com/scrtlabs/SecretNetwork/x/compute/internal/types
Expand Down
7 changes: 3 additions & 4 deletions x/registration/internal/keeper/legacy_querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ func NewLegacyQuerier(keeper Keeper) sdk.Querier {
}
return bz, nil
case QueryMasterCertificate:
rsp, err = queryMasterKey(ctx, keeper) //nolint:staticcheck

rsp, err = queryMasterKey(ctx, keeper)
if err != nil {
return nil, err
}

if rsp == nil || reflect.ValueOf(rsp).IsNil() { //nolint:staticcheck
if reflect.ValueOf(rsp).IsNil() {
return nil, nil
}
// why indent?

bz, err = json.Marshal(rsp)
if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion x/registration/remote_attestation/remote_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func verifyAttReport(attnReportRaw []byte, pubK []byte) ([]byte, error) {
if err != nil && len(platInfo) != 105 {
return nil, errors.New("illegal PlatformInfoBlob")
}
platInfo = platInfo[4:] //nolint:staticcheck
// platInfo = platInfo[4:]

// piBlob := parsePlatform(platInfo)
// piBlobJson, err := json.Marshal(piBlob)
Expand Down

0 comments on commit 0691dfc

Please sign in to comment.