forked from realiotech/multi-staking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'realiotech:main' into main
- Loading branch information
Showing
104 changed files
with
15,128 additions
and
8,859 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
queue_rules: | ||
- name: default | ||
conditions: | ||
- "#approved-reviews-by>=1" | ||
- base=main | ||
- label=automerge | ||
|
||
pull_request_rules: | ||
- name: automerge to main with label automerge and branch protection passing | ||
conditions: | ||
- "#approved-reviews-by>=1" | ||
- base=main | ||
- label=automerge | ||
actions: | ||
queue: | ||
name: default | ||
method: merge | ||
commit_message_template: | | ||
{{ title }} (#{{ number }}) | ||
{{ body }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.2' | ||
- uses: actions/checkout@v4 | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.54.2 | ||
args: --timeout 10m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Tests / Code Coverage | ||
# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report | ||
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
split-test-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create a file with all the pkgs | ||
run: go list ./... | grep -v e2e > pkgs.txt | ||
- name: Split pkgs into 2 files | ||
run: split -d -n l/2 pkgs.txt pkgs.txt.part. | ||
# cache multiple | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-00' | ||
path: ./pkgs.txt.part.00 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-01' | ||
path: ./pkgs.txt.part.01 | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
needs: split-test-files | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
part: ['00', '01'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.2' | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-${{ matrix.part }}' | ||
if: env.GIT_DIFF | ||
- name: test & coverage report creation | ||
run: | | ||
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' | ||
if: env.GIT_DIFF | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-${{ matrix.part }}-coverage' | ||
path: ./${{ matrix.part }}profile.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
run: | ||
tests: true | ||
timeout: 15m | ||
sort-results: true | ||
skip-files: | ||
- server/grpc/gogoreflection/fix_registration.go | ||
- "fix_registration.go" | ||
- ".*\\.pb\\.go$" | ||
- ".*\\.pb\\.gw\\.go$" | ||
- ".*\\.pulsar\\.go$" | ||
- crypto/keys/secp256k1/internal/* | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- dogsled | ||
- errcheck | ||
- exportloopref | ||
- gci | ||
- goconst | ||
- gocritic | ||
- gofumpt | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- thelper | ||
- typecheck | ||
- unconvert | ||
- unused | ||
|
||
issues: | ||
exclude-rules: | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
- 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 | ||
- text: "leading space" | ||
linters: | ||
- nolintlint | ||
max-issues-per-linter: 10000 | ||
max-same-issues: 10000 | ||
|
||
linters-settings: | ||
gci: | ||
sections: | ||
- standard # Standard section: captures all standard packages. | ||
- default # Default section: contains all imports that could not be matched to another section type. | ||
- blank # blank imports | ||
- dot # dot imports | ||
- prefix(cosmossdk.io) | ||
- prefix(github.com/cosmos/cosmos-sdk) | ||
- prefix(github.com/cometbft/cometbft) | ||
- prefix(github.com/cosmos/ibc-go) | ||
custom-order: true | ||
revive: | ||
rules: | ||
- name: use-any | ||
disabled: true | ||
- name: if-return | ||
disabled: true | ||
- name: max-public-structs | ||
disabled: true | ||
- name: cognitive-complexity | ||
disabled: true | ||
- name: argument-limit | ||
disabled: true | ||
- name: cyclomatic | ||
disabled: true | ||
- name: file-header | ||
disabled: true | ||
- name: function-length | ||
disabled: true | ||
- name: function-result-limit | ||
disabled: true | ||
- name: line-length-limit | ||
disabled: true | ||
- name: flag-parameter | ||
disabled: true | ||
- name: add-constant | ||
disabled: true | ||
- name: empty-lines | ||
disabled: true | ||
- name: banned-characters | ||
disabled: true | ||
- name: deep-exit | ||
disabled: true | ||
- name: confusing-results | ||
disabled: true | ||
- name: unused-parameter | ||
disabled: true | ||
- name: modifies-value-receiver | ||
disabled: true | ||
- name: early-return | ||
disabled: true | ||
- name: confusing-naming | ||
disabled: true | ||
- name: defer | ||
disabled: true | ||
# Disabled in favour of unparam. | ||
- name: unused-parameter | ||
disabled: true | ||
- name: unhandled-error | ||
disabled: false | ||
arguments: | ||
- 'fmt.Printf' | ||
- 'fmt.Print' | ||
- 'fmt.Println' | ||
- 'myFunction' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "Cosmos SDK - gRPC Gateway docs", | ||
"description": "A REST interface for state queries", | ||
"version": "1.0.0" | ||
}, | ||
"apis": [ | ||
{ | ||
"url": "./tmp-swagger-gen/multistaking/v1/query.swagger.json", | ||
"operationIds": { | ||
"rename": { | ||
"Params": "MultiStakingParams" | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.