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

Resolve CI and test errors #34

Merged
merged 32 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d4d7ccd
Remove depguard from golangci-lint
drklee3 Jan 31, 2024
1a6d9d0
Remove cachix/cachix-action step in integration_tests job
drklee3 Jan 31, 2024
fe97798
Remove cachix/cachix-action step from gomod2nix
drklee3 Jan 31, 2024
603f67c
Remove cachix/cachix-action step from python-lint
drklee3 Jan 31, 2024
afa610b
Remove cache upload job
drklee3 Jan 31, 2024
f8323d9
Trigger ci tests
drklee3 Jan 31, 2024
461ce01
Use go 1.20 for iavl v1
drklee3 Jan 31, 2024
ad77ef4
Use go 1.20 in ci
drklee3 Jan 31, 2024
340cfa7
Fix yaml parsing 1.20
drklee3 Jan 31, 2024
51061ce
Resolve lint issues
drklee3 Jan 31, 2024
2e95a62
Update ibc-go to v6.1.1, [email protected]
drklee3 Jan 31, 2024
72f3cb9
Exclude .pb.go from lll linter
drklee3 Jan 31, 2024
189dfa9
Resolve unused lint errors
drklee3 Jan 31, 2024
a8f1f6b
Add get-diff-action step to integration tests
drklee3 Jan 31, 2024
86e098f
Update integration_tests nix setup
drklee3 Feb 1, 2024
1fd7052
Add nix-community/cache-nix-action for integration tests
drklee3 Feb 1, 2024
793a176
test: Fix tracing tests mock error
drklee3 Feb 1, 2024
58fc906
ci: Remove codecov upload
drklee3 Feb 1, 2024
3c84f46
Add goleveldb replace directive to fix version not found errors in te…
drklee3 Feb 2, 2024
ccf630b
Use json string instead of byte array for tests data clarity
drklee3 Feb 2, 2024
66670f0
Ignore lint lll error on server.FlagAPISwagger
drklee3 Feb 2, 2024
bc969af
Resolve lint errors
drklee3 Feb 2, 2024
c52671d
fix: tx trace gasUsed camel case instead of snake
drklee3 Feb 2, 2024
a4f8db9
Prevent modifying trace response if missing fail or non gas error
drklee3 Feb 5, 2024
c5df89f
Add note for tracing test
drklee3 Feb 5, 2024
6874996
Revert tracing changes with minimum fix
drklee3 Feb 5, 2024
9c5e59b
gofumpt
drklee3 Feb 5, 2024
9564d88
test: Update test_pruned_node expected error integration test
drklee3 Feb 6, 2024
8e787bb
Handle connection refused error in integration test
drklee3 Feb 6, 2024
2730283
Restore jose2go version in gomod2nix.toml
drklee3 Feb 6, 2024
1494668
Resolve flake8 lint errors on integration tests
drklee3 Feb 6, 2024
5fe38f6
Add -I nixpkgs=./nix to integration Makefile
drklee3 Feb 6, 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
- uses: technote-space/[email protected]
id: git_diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
- name: "Checkout Repository"
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
- name: release dry run
run: make release-dry-run
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Required: setup-go, for all versions v3.0.0+ of golangci-lint
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
Expand Down Expand Up @@ -58,9 +58,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: ethermint
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand All @@ -74,9 +71,6 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: ethermint
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
54 changes: 21 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
Expand All @@ -34,20 +34,15 @@ jobs:
run: |
make test-unit-cover
if: env.GIT_DIFF
- uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: env.GIT_DIFF
# Coverage at ./coverage.txt is not used for now

test-importer:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
Expand All @@ -68,7 +63,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
Expand All @@ -87,23 +82,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: ethermint
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.sol
**/**.go
go.mod
go.sum
tests/integration_tests/**
- uses: actions/setup-go@v3
with:
go-version: "1.20"
check-latest: true

- uses: nixbuild/nix-quick-install-action@v26
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
# restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-
# collect garbage until Nix store size (in bytes) is at most this number
# before trying to save a new cache
gc-max-store-size-linux: 1073741824

- name: Run integration tests
run: make run-integration-tests
if: env.GIT_DIFF
- name: 'Tar debug files'
- name: "Tar debug files"
if: failure()
run: tar cfz debug_files.tar.gz -C /tmp/pytest-of-runner .
- uses: actions/upload-artifact@v3
Expand All @@ -112,20 +117,3 @@ jobs:
name: debug-files
path: debug_files.tar.gz
if-no-files-found: ignore

upload-cache:
if: github.event_name == 'push'
needs: ["integration_tests"]
strategy:
matrix:
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v18
- uses: cachix/cachix-action@v12
with:
name: ethermint
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: 'instantiate integration test env'
run: nix-store -r "$(nix-instantiate tests/integration_tests/shell.nix)"
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
Expand Down Expand Up @@ -44,6 +43,9 @@ issues:
- linters:
- lll
source: "https://"
- path: \.pb.go
linters:
- lll
max-same-issues: 50

linters-settings:
Expand Down
4 changes: 0 additions & 4 deletions app/ante/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"

errorsmod "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -40,12 +39,9 @@ import (
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

var ethermintCodec codec.ProtoCodecMarshaler

func init() {
registry := codectypes.NewInterfaceRegistry()
ethermint.RegisterInterfaces(registry)
ethermintCodec = codec.NewProtoCodec(registry)
}

// Deprecated: NewLegacyCosmosAnteHandlerEip712 creates an AnteHandler to process legacy EIP-712
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
// ethermint subspaces
paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(legacyevmtypes.ParamKeyTable()) //nolint: staticcheck
paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(legacyevmtypes.ParamKeyTable())
paramsKeeper.Subspace(feemarkettypes.ModuleName).WithKeyTable(feemarkettypes.ParamKeyTable())
return paramsKeeper
}
6 changes: 2 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@
// Get bip39 mnemonic
var mnemonic, bip39Passphrase string

recover, _ := cmd.Flags().GetBool(flagRecover)
if recover {
shouldRecover, _ := cmd.Flags().GetBool(flagRecover)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack. Warning

Returned error is not propagated up the stack.
if shouldRecover {
mnemonic, err = input.GetString("Enter your bip39 mnemonic", inBuf)
if err != nil {
return err
Expand Down Expand Up @@ -258,7 +258,7 @@
}

// Recover key from seed passphrase
if recover {
if shouldRecover {
// Hide mnemonic from output
showMnemonic = false
mnemonic = ""
Expand Down
13 changes: 7 additions & 6 deletions ethereum/eip712/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"encoding/json"
"fmt"

errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx"
Expand Down Expand Up @@ -71,13 +72,13 @@ func ConstructUntypedEIP712Data(
func ComputeTypedDataHash(typedData apitypes.TypedData) ([]byte, error) {
domainSeparator, err := typedData.HashStruct("EIP712Domain", typedData.Domain.Map())
if err != nil {
err = sdkerrors.Wrap(err, "failed to pack and hash typedData EIP712Domain")
err = errorsmod.Wrap(err, "failed to pack and hash typedData EIP712Domain")
return nil, err
}

typedDataHash, err := typedData.HashStruct(typedData.PrimaryType, typedData.Message)
if err != nil {
err = sdkerrors.Wrap(err, "failed to pack and hash typedData primary type")
err = errorsmod.Wrap(err, "failed to pack and hash typedData primary type")
return nil, err
}

Expand All @@ -97,7 +98,7 @@ func WrapTxToTypedData(
txData := make(map[string]interface{})

if err := json.Unmarshal(data, &txData); err != nil {
return apitypes.TypedData{}, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, "failed to JSON unmarshal data")
return apitypes.TypedData{}, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, "failed to JSON unmarshal data")
}

domain := getTypedDataDomain(chainID)
Expand All @@ -110,7 +111,7 @@ func WrapTxToTypedData(
if feeDelegation != nil {
feeInfo, ok := txData["fee"].(map[string]interface{})
if !ok {
return apitypes.TypedData{}, sdkerrors.Wrap(sdkerrors.ErrInvalidType, "cannot parse fee from tx data")
return apitypes.TypedData{}, errorsmod.Wrap(sdkerrors.ErrInvalidType, "cannot parse fee from tx data")
}

feeInfo["feePayer"] = feeDelegation.FeePayer.String()
Expand Down Expand Up @@ -149,15 +150,15 @@ func extractMsgTypes(msgs []sdk.Msg, params evmtypes.Params) (apitypes.Types, er
// ensure eip712 messages implement legacytx.LegacyMsg
_, ok := msg.(legacytx.LegacyMsg)
if !ok {
err := sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "msg %T must implement legacytx.LegacyMsg", (*legacytx.LegacyMsg)(nil))
err := errorsmod.Wrapf(sdkerrors.ErrInvalidType, "msg %T must implement legacytx.LegacyMsg", (*legacytx.LegacyMsg)(nil))
return apitypes.Types{}, err
}

// get corresponding allowed msg from params
msgType := sdk.MsgTypeURL(msg)
allowedMsg := params.EIP712AllowedMsgFromMsgType(msgType)
if allowedMsg == nil {
err := sdkerrors.Wrapf(
err := errorsmod.Wrapf(
sdkerrors.ErrInvalidType,
"eip712 message type \"%s\" is not permitted",
msgType,
Expand Down
15 changes: 9 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/evmos/ethermint

go 1.19
go 1.20

require (
cosmossdk.io/errors v1.0.0-beta.7
Expand All @@ -12,7 +12,7 @@ require (
github.com/cosmos/cosmos-sdk v0.46.16
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.3
github.com/cosmos/ibc-go/v6 v6.1.0
github.com/cosmos/ibc-go/v6 v6.1.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.26
github.com/gogo/protobuf v1.3.3
Expand Down Expand Up @@ -56,7 +56,7 @@ require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/aws/aws-sdk-go v1.44.122 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
Expand Down Expand Up @@ -114,7 +114,7 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
Expand All @@ -125,7 +125,7 @@ require (
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.6.1 // indirect
github.com/hashicorp/go-getter v1.7.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
Expand Down Expand Up @@ -183,7 +183,7 @@ require (
github.com/tidwall/btree v1.5.0 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.2 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
Expand Down Expand Up @@ -219,5 +219,8 @@ replace (
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0
// use cosmos flavored protobufs
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// Downgraded to avoid bugs in following commits which causes "version does not exist" errors
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/tendermint => github.com/kava-labs/cometbft v0.34.31-kava.2
)
Loading
Loading