Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #1976

Closed
wants to merge 43 commits into from
Closed

WIP #1976

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
34fcd60
WIP
sesheffield Jul 25, 2024
32e6c42
temp
sesheffield Jul 25, 2024
6e0f3bc
change file
sesheffield Jul 25, 2024
e3ae9ef
try again
sesheffield Jul 25, 2024
a6eb47c
fix
sesheffield Jul 25, 2024
e5e444a
trying again
sesheffield Jul 25, 2024
a257433
trying again
sesheffield Jul 25, 2024
473bab3
try again?
sesheffield Jul 25, 2024
93c1ad9
try again?
sesheffield Jul 25, 2024
64206da
try again?
sesheffield Jul 25, 2024
e947133
..
sesheffield Jul 25, 2024
40d8dbb
fix
sesheffield Jul 25, 2024
0978b60
try try
sesheffield Jul 25, 2024
046a8be
fix
sesheffield Jul 25, 2024
b8ba99a
fix
sesheffield Jul 25, 2024
c9e334e
fix
sesheffield Jul 25, 2024
93dcbaa
try again
sesheffield Jul 25, 2024
f89b54d
what?
sesheffield Jul 25, 2024
7f4f9e7
what...?
sesheffield Jul 25, 2024
8b74477
hm?
sesheffield Jul 25, 2024
aacd007
hm?
sesheffield Jul 25, 2024
43507bb
hm?
sesheffield Jul 25, 2024
c9d1087
refactor
sesheffield Jul 25, 2024
157baba
werid
sesheffield Jul 25, 2024
632c7b5
ok
sesheffield Jul 25, 2024
6848324
go go go
sesheffield Jul 25, 2024
4822366
go
sesheffield Jul 25, 2024
1003a08
go
sesheffield Jul 25, 2024
3c92d96
hm
sesheffield Jul 25, 2024
d74e325
tests
sesheffield Jul 25, 2024
dd3e651
fix
sesheffield Jul 25, 2024
ca2764c
put back
sesheffield Jul 25, 2024
b19f97e
fix
sesheffield Jul 25, 2024
ffee5b0
hm
sesheffield Jul 25, 2024
5b0dfb7
what
sesheffield Jul 25, 2024
786202c
go sec
sesheffield Jul 25, 2024
f75baf1
tests
sesheffield Jul 25, 2024
20a2905
go
sesheffield Jul 25, 2024
a5849a5
here
sesheffield Jul 25, 2024
ad79dcd
fix
sesheffield Jul 25, 2024
9a2b98a
what
sesheffield Jul 25, 2024
27cbead
update
sesheffield Jul 25, 2024
dd71740
run always
sesheffield Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/cache_go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Cache Go
description: Cache Go imports and modules
runs:
using: composite
steps:
- name: Cache Go
uses: actions/cache@v4
with:
key: gomod-k-${{ hashFiles('**/go.mod', '**/go.sum') }}
path: |
/go/bin/goimports
/go/pkg/mod
11 changes: 11 additions & 0 deletions .github/actions/changed_files/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Changed Files
description: Get changed files
runs:
using: composite
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.go
32 changes: 32 additions & 0 deletions .github/actions/setup_go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Setup Go
description: Install Go
runs:
using: composite
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache-dependency-path: go.sum
cache: true
- name: Set Cache Path
id: paths
run: |
echo "GOBUILD_PATH=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "GOMOD_PATH=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
shell: bash
- name: Go Build Cache
uses: actions/cache@v4
with:
path: ${{ steps.paths.outputs.GOBUILD_PATH }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
uses: actions/cache@v4
with:
path: ${{ steps.paths.outputs.GOMOD_PATH }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.mod') }}
- name: Run go mod download
run: |
go mod download
shell: bash
37 changes: 32 additions & 5 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
name: Lint Checks
on:
workflow_call:

permissions:
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write

# run per commit ci checks against this commit
jobs:
proto-lint:
uses: ./.github/workflows/proto.yml
golangci-lint:
runs-on: ubuntu-latest
permissions:
contents: read # to download code coverage results from unit_tests job
pull-requests: write # write permission needed to comment on PR
checks: write
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load Version
id: load-version
run: |
echo "GOLANGCI_VERSION=v$(cat .golangci-version)"
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
uses: golangci/golangci-lint-action@v6
with:
version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }}
args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0
working-directory: ${{ github.workspace }}
golang-sec:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Run Gosec Security Scanner
uses: cosmos/gosec@master
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
golangci_lint_flags: --timeout 10m
args: ./...
88 changes: 88 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Golang CI
#
#on:
# merge_group:
# pull_request:
# branches:
# - '*'
#env:
# GO_VERSION: '1.21'
#
#jobs:
# changed_files:
# name: Changed Files
# runs-on: ubutnu-latest
# outputs:
# changed_files: ${{ steps.changed_files.outputs.all_changed_files }}
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Changed Files
# id: changed_files
# uses: ./.github/actions/changed_files
#
# golang-ci:
# needs:
# - changed_files
# if: |
# contains(needs.changed_files.outputs.changed_files, '.go')
# name: golangci-lint
# runs-on:
# labels: 16-cores
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup
# uses: ./.github/actions/setup_go
# with:
# cache: false
# - name: Load Version
# id: load-version
# run: |
# echo "GOLANGCI_VERSION=v$(cat .golangci-version)"
# - name: golangci-ling
# uses: golangci/golangci-lint-action@v6
# with:
# version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }}
# args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0
# working-directory: ${{ github.workspace }}
#
# golang-test:
# needs:
# - changed_files
# if: |
# contains(needs.changed_files.outputs.changed_files, '.go') ||
# contains(needs.changed_files.outputs.changed_files, 'go.sum') ||
# (
# contains(needs.changed_files.outputs.changed_files, '.yml') ||
# contains(needs.changed_files.outputs.changed_files, '.yaml')
# )
# &&
# (
# contains(needs.changed_files.outputs.changed_files, 'app') ||
# contains(needs.changed_files.outputs.changed_files, 'client') ||
# contains(needs.changed_files.outputs.changed_files, 'cmd') ||
# contains(needs.changed_files.outputs.changed_files, 'migrate') ||
# contains(needs.changed_files.outputs.changed_files, 'tests') ||
# contains(needs.changed_files.outputs.changed_files, 'x')
# )
# name: go test
# runs-on:
# labels: 16-cores
# env:
# COVERAGE_DIR: out/coverage/unit/go
# COVERAGE_PATH: out/coverage/unit/go/cover.out
# FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out
# HTML_REPORT: out/coverage/unit/go/go-unit-cover.html
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup
# uses: ./.github/actions/setup_go
# - name: Go Test
# run: |
# mkdir -p ${{ env.COVERAGE_DIR }}
# readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$')
# half_nproc=$(( $(nproc --all) / 2 ))
# printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race
#
3 changes: 3 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Protobuf Checks
on:
workflow_call:

# fix this too


jobs:
check-proto:
name: "Check Proto"
Expand Down
1 change: 1 addition & 0 deletions .golangci-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.59
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ test-ibc: docker-build
test:
@$(GO_BIN) test $$($(GO_BIN) list ./... | grep -v 'contrib' | grep -v 'tests/e2e')

coverage:
@mkdir -p out
@$(GO_BIN) test -v -coverprofile=out/coverage.out $$($(GO_BIN) list ./... | grep -v 'contrib' | grep -v 'tests/e2e')
@$(GO_BIN) tool cover -html="out/coverage.out"

# Run cli integration tests
# `-p 4` to use 4 cores, `-tags cli_test` to tell $(GO_BIN) not to ignore the cli package
# These tests use the `kvd` or `kvcli` binaries in the build dir, or in `$BUILDDIR` if that env var is set.
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ func NewApp(
app.mm.RegisterInvariants(&app.crisisKeeper)

app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())

app.RegisterServices(app.configurator)

// RegisterUpgradeHandlers is used for registering any on-chain upgrades.
Expand Down
1 change: 1 addition & 0 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ type GenesisState map[string]json.RawMessage
// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState() GenesisState {
encCfg := MakeEncodingConfig()

return ModuleBasics.DefaultGenesis(encCfg.Marshaler)
}
1 change: 1 addition & 0 deletions cmd/kava/cmd/rocksdb/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var allowedDBs = []string{"application", "blockstore", "state"}

func CompactRocksDBCmd() *cobra.Command {
cmd := &cobra.Command{

Use: fmt.Sprintf(
"compact <%s>",
strings.Join(allowedDBs, "|"),
Expand Down
2 changes: 0 additions & 2 deletions x/bep3/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
QueryGetAtomicSwapsCmd(queryRoute),
QueryParamsCmd(queryRoute),
}

for _, cmd := range cmds {
flags.AddQueryFlagsToCmd(cmd)
}

bep3QueryCmd.AddCommand(cmds...)

return bep3QueryCmd
}

Expand Down
1 change: 1 addition & 0 deletions x/bep3/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, accountKeeper types.Acco
if perm == authtypes.Burner {
hasBurnPermissions = true
}

if perm == authtypes.Minter {
hasMintPermissions = true
}
Expand Down
Loading