Skip to content

Commit

Permalink
feat: epic(evm): End-to-end EVM contract tests, keeper logic, contrac…
Browse files Browse the repository at this point in the history
…t bytecode, EthCall, and Ethereum JSON-RPC coverage (#1883)

* Squashed commit of the following:

commit 1fe82fe
Merge: 4e323da fac6492
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 23:48:32 2024 -0500

    Merge branch 'main' into on/evm-json-rpc

commit 4e323da
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 22:34:36 2024 +0400

    feat: implemented evm grpc_query params

commit ec64f33
Merge: eed9f8c 6e38c19
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 21:12:33 2024 +0400

    chore: resolve conflicts

commit eed9f8c
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 21:09:44 2024 +0400

    chore: changelog

commit e0ec526
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 21:08:07 2024 +0400

    chore: changelog

commit 6b5191b
Merge: 518e89f 69865ec
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 21:04:30 2024 +0400

    Merge branch 'ud/eth-2' into on/evm-json-rpc

commit 69865ec
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 12:01:32 2024 -0500

    linter + changelog

commit 518e89f
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 21:00:30 2024 +0400

    fix: hacked eth chain id

commit f874b87
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 11:54:19 2024 -0500

    query Balance

commit 289b1d7
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 11:30:15 2024 -0500

    fix(deps): remove local collections replace statement

commit 2215a9a
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 20:16:58 2024 +0400

    chore: cleanup

commit 71d5179
Author: Oleg Nikonychev <[email protected]>
Date:   Tue May 14 20:15:12 2024 +0400

    feat: evm app config and json-rpc

commit fc5f463
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 10:55:30 2024 -0500

    eth: query type validation

commit a6437fd
Merge: 0c5cffb 40a0a9a
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 10:53:50 2024 -0500

    Merge branch 'ud/eth' into ud/eth-2

commit 0c5cffb
Author: Unique-Divine <[email protected]>
Date:   Tue May 14 10:53:46 2024 -0500

    chore(deps): use collections v0.5

commit 40a0a9a
Merge: 0dbba9e 2342254
Author: Unique-Divine <[email protected]>
Date:   Mon May 13 11:12:53 2024 -0500

    Merge branch 'main' into ud/eth

commit 0dbba9e
Author: Unique-Divine <[email protected]>
Date:   Mon May 13 11:12:42 2024 -0500

    quicksave wip!

commit 820f50e
Merge: 3159973 e7ed442
Author: Unique-Divine <[email protected]>
Date:   Fri May 10 02:42:51 2024 -0500

    Merge branch 'main' into ud/eth

commit 3159973
Author: Unique-Divine <[email protected]>
Date:   Fri May 10 02:41:42 2024 -0500

    feat(evm): module wiring

* feat(evm): grpc query ValidatorAccount

* test: QueryStorage

* wip! upstream tests

* evm: wip! checkpoint

* test(evm): TestQueryParams

* feat(evm): MsgServer fns for MsgEthereumTx

* feat(evm): ante handlers

* fix,test(evmtest): deploy contract + fix ante handler

* fix,test(evm): EthereumTx happy paths

* fix(evm): Chain info fix and gRPC queries

* feat(evm-query): impl EthCAll

* fix(eip712): test case changed and const usage

* test(evm): ante handler test

* refactor(evm-ante)

* feat: implemented basic evm tx methods (#1889)

* feat: implemented basic evm tx methods

* chore: lint

* chore: extracted evm chain_id to appconst

* fix: tests

* fix: tests

* fix: lint

* chore: cleanup

* refactor: merge upstream

* chore(evm-keeper): remove unused code

---------

Co-authored-by: Unique-Divine <[email protected]>

* test(eth): gas limit tests

* test(evm): utils for loading Eth contracts + test EthCall

* docs(evm): eth call comment

* test(evm): eth api integration test suite (#1887)

* test(evm): eth api integration test suite

* test(evm): more integration tests for eth api

* feat: implemented basic evm tx methods

* chore: lint

* chore: lint

* chore: lint

* chore: extracted evm chain_id to appconst

* fix: tests

* fix: tests

* fix: lint

* chore: cleanup

* refactor: merge

* fix: eth chain ID test

* fix(eth): chain ID

* linter fix

* test(evm): integration tests for tx and smart contract

* chore(evm): disabled json rpc by default

* refactor: merge conflicts

* test(rpcapi): make fixtures consistent

* fix(evm): integration test fixture setup

* chore: linter

---------

Co-authored-by: Unique-Divine <[email protected]>

* test(evm): ethers.js tests for evm (#1896)

* test(evm): eth api integration test suite

* test(evm): more integration tests for eth api

* feat: implemented basic evm tx methods

* chore: lint

* chore: lint

* chore: lint

* chore: extracted evm chain_id to appconst

* fix: tests

* fix: tests

* fix: lint

* chore: cleanup

* refactor: merge

* fix: eth chain ID test

* fix(eth): chain ID

* linter fix

* test(evm): integration tests for tx and smart contract

* chore(evm): disabled json rpc by default

* test(evm): ethers.js tests for evm

* test(evm): github workflow

* fix: gh actions evm tests npm instead of yarn

* fix: evm gh tests

* fix: evm gh tests

* fix: evm gh tests

* chore: cleanup

* chore: renamed evm job

* refactor: merge conflict rever

* refactor(e2e): consistent path

* chore: cleanup unused

* wip!: try removing chain ID hacks

* wip!: try removing chain ID hacks

* chore: linter

---------

Co-authored-by: Unique-Divine <[email protected]>

* ci: rename e2e-evm suite

---------

Co-authored-by: Oleg Nikonychev <[email protected]>
  • Loading branch information
Unique-Divine and onikonychev authored May 28, 2024
1 parent 9c7d8ce commit 4d4205a
Show file tree
Hide file tree
Showing 100 changed files with 10,271 additions and 572 deletions.
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ coverage:
status:
project:
default:
target: 66%
target: 60%
if_not_found: success
threshold: 1% # Allow coverage to drop by X%, posting a success status.
# removed_code_behavior: Takes values [off, removals_only, adjust_base]
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/e2e-evm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: EVM e2e tests

on:
pull_request:
paths:
[
"**.go",
"**.proto",
"go.mod",
"go.sum",
"**go.mod",
"**go.sum",
"contrib/docker/*",
"**.js",
"**.json",
]

# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}

jobs:
e2e-evm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache: true

# Use GitHub actions output paramters to get go paths. For more info, see
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
- name: "Set output variables for go cache"
id: go-cache-paths
run: |
echo "go-build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: "Go build cache"
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build-cache }}
key: go-build-cache-${{ hashFiles('**/go.sum') }}

- name: "Go mod cache"
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: "Install just"
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just

- name: "Build the nibid binary"
run: |
just install
- name: Setup NodeJS with npm caching
uses: actions/setup-node@v4
with:
node-version: 18

- name: NPM Install
run: npm install
working-directory: "e2e/evm"

- name: "Launch localnet"
run: |
just localnet --no-build &
sleep 6
- name: Run tests
run: npm test
working-directory: "e2e/evm"
env:
JSON_RPC_ENDPOINT: http://127.0.0.1:8545
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
Loading

0 comments on commit 4d4205a

Please sign in to comment.