Skip to content

Commit

Permalink
Merge pull request #113 from White-Whale-Defi-Platform/faddat/alliancev2
Browse files Browse the repository at this point in the history
alliance
  • Loading branch information
faddat authored Mar 18, 2023
2 parents 7bcdedf + 6121b71 commit aa86c1a
Show file tree
Hide file tree
Showing 14 changed files with 357 additions and 122 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/verify_state.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Verify Statesync

on: [push, pull_request]

jobs:
verify_statesync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up shell
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run verify.sh script
run: |
chmod +x scripts/statesync.bash
timeout 5m bash scripts/statesync.bash || true
- name: Check script with ShellCheck
run: |
shellcheck scripts/statesync.bash
82 changes: 82 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
run:
tests: true
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m

linters:
disable-all: true
enable:
- depguard
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused

# TODO: fix the sdkerrors.Wrap deprecation warning and re-enable staticcheck

issues:
exclude-rules:
- text: "Error return value of `flagSet.Set` is not checked"
linters:
- errcheck
- text: "SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module"
linters:
- staticcheck
- text: "sdkerrors.Error is deprecated: the type has been moved to cosmossdk.io/errors module"
linters:
- staticcheck
- text: "sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module"
linters:
- staticcheck
- text: "Use of weak random number generator"
linters:
- gosec
- text: "comment on exported var"
linters:
- golint
- text: "don't use an underscore in package name"
linters:
- golint
- text: "ST1003:"
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
linters:
- staticcheck

max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
dogsled:
max-blank-identifiers: 3
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
10 changes: 5 additions & 5 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ type HandlerOptions struct {

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") //nolint:staticcheck // ignore SA1019 // TODO: migrate to cosmossdk.io/errors
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") //nolint:staticcheck // ignore SA1019 // TODO: migrate to cosmossdk.io/errors
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") //nolint:staticcheck // ignore SA1019 // TODO: migrate to cosmossdk.io/errors
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}
if options.WasmConfig == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") //nolint:staticcheck // ignore SA1019 // TODO: migrate to cosmossdk.io/errors
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder")
}
if options.TXCounterStoreKey == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder") //nolint:staticcheck // ignore SA1019 // TODO: migrate to cosmossdk.io/errors
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand Down
Loading

0 comments on commit aa86c1a

Please sign in to comment.