diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml new file mode 100644 index 000000000..7be28d376 --- /dev/null +++ b/.github/workflows/gosec.yml @@ -0,0 +1,27 @@ +name: Run Gosec +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + tests: + runs-on: ubuntu-latest + env: + GO111MODULE: on + steps: + - name: Checkout Source + uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v3 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + - name: Run Gosec Security Scanner + uses: informalsystems/gosec@master + with: + args: ./... + if: "env.GIT_DIFF != ''" diff --git a/app/export.go b/app/export.go index a744e5496..88aadb348 100644 --- a/app/export.go +++ b/app/export.go @@ -165,7 +165,10 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str counter++ } - iter.Close() + err := iter.Close() + if err != nil { + panic(err) + } if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { panic(err) diff --git a/x/mint/module.go b/x/mint/module.go index 542b2b007..f9f26055e 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -71,8 +71,9 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the mint module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } } // GetTxCmd returns no root tx command for the mint module.