Skip to content

Commit

Permalink
Merge branch 'cosmos/v0.47.x' of https://github.com/forbole/bdjuno in…
Browse files Browse the repository at this point in the history
…to chains/coreum/mainnet
  • Loading branch information
MonikaCat committed Jan 2, 2024
2 parents 53adf16 + 340f59b commit 62fb569
Show file tree
Hide file tree
Showing 123 changed files with 3,107 additions and 1,888 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: 'kind/bug'
assignees: 'RiccardoM'
assignees: 'MonikaCat'

---
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ updates:
interval: daily
open-pull-requests-limit: 10
reviewers:
- riccardom
- MonikaCat
labels:
- automerge
- dependencies
41 changes: 20 additions & 21 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@ name: docker-build
on:
push:
branches:
- cosmos/*/*
- chains/*/*

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set bdjuno chain_name
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Set BDJuno chain name 🔧
shell: bash
run: echo "CHAIN_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_ENV
-
name: Set bdjuno version

- name: Set BDJuno version 🔧
shell: bash
run: echo "GITHUB_VERSION=$(git describe --tags)" >> $GITHUB_ENV
-
name: Prepare tags

- name: Prepare tags 🏷️
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKERHUB_BDJUNO_REPO }}
Expand All @@ -33,26 +31,27 @@ jobs:
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Determine Dockerfile to use
- name: Determine Dockerfile to use 🔍
run: |
if [[ -f Dockerfile.cosmwasm ]]; then
export DOCKERFILE=Dockerfile.cosmwasm
else
export DOCKERFILE=Dockerfile.default
fi
echo "DOCKERFILE=${DOCKERFILE}" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
- name: Set up Docker Buildx 🧰
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub 👤
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v4

- name: Build and push 📤
uses: docker/build-push-action@v5
with:
context: .
file: "./${{ env.DOCKERFILE }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.2.0
- uses: amannn/action-semantic-pull-request@v5.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 16 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,31 @@ on:
pull_request:
push:
branches:
- master
- chains/*
- cosmos/*

jobs:
GolangCI:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Go 🧰
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Compute diff 📜
uses: technote-space/[email protected]
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- uses: golangci/[email protected]
with:
version: v1.51.1
args: --timeout 10m
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run lint ✅
if: "env.GIT_DIFF != ''"
run: make lint
38 changes: 28 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
pull_request:
push:
branches:
- master
- chains/*
- cosmos/*

jobs:
Cleanup-runs:
Expand All @@ -14,21 +15,38 @@ jobs:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
if: "!startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/cosmos')"

Unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Go 🧰
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Test & Create coverage report
run: make install test-unit stop-docker-test
- name: Upload cove coverage
uses: codecov/codecov-action@v3
go-version: "1.20"

- name: Compute diff 📜
uses: technote-space/[email protected]
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: Build 🔨
if: "env.GIT_DIFF != ''"
run: make build

- name: Test & Coverage report creation 🧪
run: make test-unit stop-docker-test

- name: Upload coverage 📤
if: "env.GIT_DIFF != ''"
uses: codecov/codecov-action@v4-beta
with:
file: ./coverage.txt
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- gocritic
- gofmt
Expand Down Expand Up @@ -51,6 +50,10 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
# Disable until Msg-based gov proposals are fully implemented
- text: "SA1019:"
linters:
- staticcheck
max-issues-per-linter: 10000
max-same-issues: 10000

Expand Down
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## Unreleased
### Changes
- ([\#610](https://github.com/forbole/bdjuno/pull/610)) Add support for gov `v1` proposals
- ([\#652](https://github.com/forbole/bdjuno/pull/652)) Update gov module parsing

## Version v4.0.0
## Notes
This version is thought to be used with Cosmos SDK `v0.47.x`.

#### CI
- ([\#508](https://github.com/forbole/bdjuno/pull/508)) Upgrade workflow golangci version to v1.50.1
### Changes

#### Parse Command
- ([\#492](https://github.com/forbole/bdjuno/pull/492)) Add parse command for periodic tasks: `x/bank` total supply, `x/distribution` community pool, `x/mint` inflation, `pricefeed` token price and price history, `x/staking` staking pool
Expand All @@ -13,6 +17,7 @@
#### Staking Module
- ([\#443](https://github.com/forbole/bdjuno/pull/443)) Remove tombstone status from staking module(already stored in slashing module)
- ([\#455](https://github.com/forbole/bdjuno/pull/455)) Added `unbonding_tokens` and `staked_not_bonded_tokens` values to staking pool table
- ([\#536](https://github.com/forbole/bdjuno/pull/536)) Fix `PoolSnapshot` tokens type from `sdk.Int` to `sdkmath.Int`

#### Gov Module
- ([\#461](https://github.com/forbole/bdjuno/pull/461)) Parse `x/gov` genesis with `genesisDoc.InitialHeight` instead of the hard-coded height 1
Expand All @@ -29,8 +34,7 @@
- ([\#491](https://github.com/forbole/bdjuno/pull/491)) Add host address to Hasura actions

### Dependencies
- ([\#462](https://github.com/forbole/bdjuno/pull/462)) Updated Juno to `v3.4.0`
- ([\#542](https://github.com/forbole/bdjuno/pull/542)) Updated Juno to `v4.1.0`, BDJuno to `v4` and Golang version to `1.19`
- ([\#542](https://github.com/forbole/bdjuno/pull/542)) Updated Juno to `v5.1.0`

#### Mint module
- ([\#589](https://github.com/forbole/bdjuno/pull/589)) Update inflation query to call API endpoint
Expand Down Expand Up @@ -134,4 +138,4 @@ This version introduces breaking changes to certain address-specific data that i
- ([\#276](https://github.com/forbole/bdjuno/pull/276)) Added `fee_grant_allowance` table (v0.44.x)

#### Modules
- ([\#353](https://github.com/forbole/bdjuno/pull/353)) Removed the support for the `history` module
- ([\#353](https://github.com/forbole/bdjuno/pull/353)) Removed the support for the `history` module
2 changes: 1 addition & 1 deletion Dockerfile.cosmwasm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


FROM golang:1.18-alpine AS builder
FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine AS builder
FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
COPY . ./
Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ all: lint build test-unit
### Build flags ###
###############################################################################

LD_FLAGS = -X github.com/forbole/juno/v4/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v4/cmd.Commit=$(COMMIT)
LD_FLAGS = -X github.com/forbole/juno/v5/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v5/cmd.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'

ifeq ($(LINK_STATICALLY),true)
Expand Down Expand Up @@ -68,17 +68,25 @@ test-unit: start-docker-test
@go test -mod=readonly -v -coverprofile coverage.txt ./...
.PHONY: test-unit

###############################################################################
### Linting ###
###############################################################################
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint

lint:
golangci-lint run --out-format=tab
@echo "--> Running linter"
@go run $(golangci_lint_cmd) run --timeout=10m

lint-fix:
golangci-lint run --fix --out-format=tab --issues-exit-code=0
@echo "--> Running linter"
@go run $(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0

.PHONY: lint lint-fix

format:
find . -name '*.go' -type f -not -path "*.git*" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" | xargs misspell -w
find . -name '*.go' -type f -not -path "*.git*" | xargs goimports -w -local github.com/forbole/bdjuno
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs goimports -w -local github.com/forbole/bdjuno
.PHONY: format

clean:
Expand Down
15 changes: 7 additions & 8 deletions cmd/bdjuno/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package main

import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/forbole/juno/v4/cmd"
initcmd "github.com/forbole/juno/v4/cmd/init"
parsetypes "github.com/forbole/juno/v4/cmd/parse/types"
startcmd "github.com/forbole/juno/v4/cmd/start"
"github.com/forbole/juno/v4/modules/messages"
"github.com/forbole/juno/v5/cmd"
initcmd "github.com/forbole/juno/v5/cmd/init"
parsetypes "github.com/forbole/juno/v5/cmd/parse/types"
startcmd "github.com/forbole/juno/v5/cmd/start"
"github.com/forbole/juno/v5/modules/messages"

migratecmd "github.com/forbole/bdjuno/v4/cmd/migrate"
parsecmd "github.com/forbole/bdjuno/v4/cmd/parse"

"github.com/forbole/bdjuno/v4/types/config"

coreumapp "github.com/CoreumFoundation/coreum/v2/app"
"github.com/cosmos/cosmos-sdk/simapp"
coreumapp "github.com/CoreumFoundation/coreum/v3/app"

"github.com/forbole/bdjuno/v4/database"
"github.com/forbole/bdjuno/v4/modules"
)
Expand Down Expand Up @@ -55,7 +55,6 @@ func main() {
// This should be edited by custom implementations if needed.
func getBasicManagers() []module.BasicManager {
return []module.BasicManager{
simapp.ModuleBasics,
coreumapp.ModuleBasics,
}
}
Expand Down
5 changes: 2 additions & 3 deletions cmd/migrate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/spf13/cobra"

v3 "github.com/forbole/bdjuno/v4/cmd/migrate/v3"
Expand Down Expand Up @@ -32,8 +32,7 @@ func NewMigrateCmd(appName string, parseConfig *parsecmdtypes.Config) *cobra.Com
Use: "migrate [to-version]",
Short: "Perform the migrations from the current version to the specified one",
Long: `Migrates all the necessary things (config file, database, etc) from the current version to the new one.
If you are upgrading from a very old version to the latest one, migrations must be performed in order
(eg. to migrate from v1 to v3 you need to do v1 -> v2 and then v2 -> v3).
Note that migrations must be performed in order: to migrate from vX to vX+2 you need to do vX -> vX+1 and then vX+1 -> vX+2.
`,
Example: fmt.Sprintf("%s migrate v3", appName),
Args: cobra.RangeArgs(0, 1),
Expand Down
6 changes: 3 additions & 3 deletions cmd/migrate/v3/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (

"github.com/forbole/bdjuno/v4/modules/actions"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"

"gopkg.in/yaml.v3"

junov4 "github.com/forbole/juno/v4/cmd/migrate/v4"
"github.com/forbole/juno/v4/types/config"
junov4 "github.com/forbole/juno/v5/cmd/migrate/v4"
"github.com/forbole/juno/v5/types/config"
)

// RunMigration runs the migrations from v2 to v3
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v3/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v3

import (
v3 "github.com/forbole/juno/v4/cmd/migrate/v3"
v3 "github.com/forbole/juno/v5/cmd/migrate/v3"

"github.com/forbole/bdjuno/v4/modules/actions"
)
Expand Down
Loading

0 comments on commit 62fb569

Please sign in to comment.