Skip to content

Commit

Permalink
imp(all): Move latest changes from Evmos main (incl. SDK v50) (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann authored Sep 26, 2024
1 parent d22f510 commit bb4b78d
Show file tree
Hide file tree
Showing 486 changed files with 83,667 additions and 18,044 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,42 @@ on:
permissions: read-all

jobs:
format-go-code:
format-code:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
# Checkout repository
- uses: actions/checkout@v4
with:
token: ${{ secrets.E2E_PAT }}
- run: go install mvdan.cc/gofumpt@latest
- run: make format
# Commit formatted files if necessary
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: run make format

format-python-code:
runs-on: ubuntu-latest

permissions:
contents: write
# Install shell formatter
- run: sudo apt-get install -y shfmt

steps:
- uses: actions/checkout@v4
# Set up Go
- uses: actions/setup-go@v5
with:
token: ${{ secrets.E2E_PAT }}
go-version: "1.22"
check-latest: true

# Install Go formatter
- run: go install mvdan.cc/gofumpt@latest

# Set up Python
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.10"

# Install Python formatters
- run: pip install black isort
- run: make format-python

# Run the combined format command
- run: make format

# Commit formatted files if necessary
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: run make format-python
commit_message: run make format
2 changes: 1 addition & 1 deletion .github/workflows/bsr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.39.0
- uses: bufbuild/buf-setup-action@v1.41.0
# Push evmOS protos to the Buf Schema Registry
- uses: bufbuild/[email protected]
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.39.0
- uses: bufbuild/buf-setup-action@v1.41.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.39.0
- uses: bufbuild/buf-setup-action@v1.41.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
VALIDATE_OPENAPI: false
VALIDATE_JSCPD: false
VALIDATE_GO: false
VALIDATE_GO_MODULES: false
PYTHON_PYLINT_CONFIG_FILE: .pylintrc
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ yarn.lock

# OpenZeppelin contracts
contracts/@openzeppelin/*

# Build files
example_chain/build/
5 changes: 4 additions & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ description = "global allow lists"
paths = [
'''gitleaks.toml''',
'''(.*?)(jpg|gif|pdf|png|svg)$''',
'''(go.mod|go.sum)$''',
'''(go.mod|go.sum|go.work|go.work.sum)$''',
]
stopwords = [
'''secp256k1''',
'''evmospub1addwnpepqgcxazmq6wgt2j4rdfumsfwla0zfk8e5sws3p3zg5dkm9007hmfysxas0u2''',
'''0x8FA78CEB7F04118Ec6d06AaC37Ca854691d8e963''',
'''0x205CF44075E77A3543abC690437F3b2819bc450a''',
'''evmos10d07y265gmmuvt4z0w9aw880jnsr700jcrztvm''',
]

[[rules]]
Expand Down
5 changes: 5 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# --disable=W".
disable=raw-checker-failed,
bad-inline-option,
broad-exception-caught,
consider-using-f-string,
locally-disabled,
file-ignored,
suppressed-message,
Expand All @@ -25,6 +27,7 @@ disable=raw-checker-failed,
too-few-public-methods,
too-many-public-methods,
too-many-arguments,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-branches,
Expand All @@ -36,3 +39,5 @@ disable=raw-checker-failed,
import-error,
use-dict-literal,
fixme

max-line-length=120
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This changelog was created using the `clu` binary

### Improvements

- (all) [#48](https://github.com/evmos/os/pull/48) Move latest changes from evmOS main (f943af3b incl. SDK v50).
- (all) [#43](https://github.com/evmos/os/pull/43) Update with latest evmOS main changes (2b7a8e2).
- (tests) [#41](https://github.com/evmos/os/pull/41) Add Solidity and Ledger tests.
- (all) [#37](https://github.com/evmos/os/pull/37) Add EVM, feemarket and precompiles from evmOS.
Expand Down
33 changes: 22 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export GO111MODULE = on
# Default target executed when no arguments are given to make.
default_target: all

.PHONY: default_target
.PHONY: build, default_target

###############################################################################
### Tools & Dependencies ###
Expand Down Expand Up @@ -78,26 +78,31 @@ benchmark:
### Linting ###
###############################################################################

lint:
lint: lint-go lint-python lint-contracts

lint-go:
gofumpt -l .
golangci-lint run --out-format=tab

lint-python:
find . -name "*.py" -type f -not -path "*/node_modules/*" | xargs pylint
flake8

lint-contracts:
solhint contracts/**/*.sol

lint-fix:
golangci-lint run --fix --out-format=tab --issues-exit-code=0

lint-fix-contracts:
@cd contracts && \
npm i && \
npm run lint-fix
solhint --fix contracts/**/*.sol

.PHONY: lint lint-fix
.PHONY: lint lint-fix lint-contracts lint-go lint-python

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.pb.gw.go' | xargs gofumpt -w -l

.PHONY: format
format: format-go format-python format-shell

format-go:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' -not -name '*.pb.gw.go' -not -name '*.pulsar.go' | xargs gofumpt -w -l

format-python: format-isort format-black

Expand All @@ -107,11 +112,16 @@ format-black:
format-isort:
find . -name '*.py' -type f -not -path "*/node_modules/*" | xargs isort

format-shell:
shfmt -l -w .

.PHONY: format format-go format-python format-black format-isort format-go

###############################################################################
### Protobuf ###
###############################################################################

protoVer=0.11.6
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace --user 0 $(protoImageName)

Expand All @@ -128,6 +138,7 @@ proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "generating implementations from Protobuf files"
@$(protoImage) sh ./scripts/generate_protos.sh
@$(protoImage) sh ./scripts/generate_protos_pulsar.sh

proto-format:
@echo "formatting Protobuf files"
Expand Down
2 changes: 1 addition & 1 deletion ante/cosmos/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewAuthzLimiterDecorator(disabledMsgTypes ...string) AuthzLimiterDecorator

func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
if err := ald.checkDisabledMsgs(tx.GetMsgs(), false, 1); err != nil {
return ctx, errorsmod.Wrap(errortypes.ErrUnauthorized, err.Error())
return ctx, errorsmod.Wrapf(errortypes.ErrUnauthorized, "%s", err.Error())
}
return next(ctx, tx, simulate)
}
Expand Down
Loading

0 comments on commit bb4b78d

Please sign in to comment.