Skip to content

Commit

Permalink
Add web3.py tests (#609)
Browse files Browse the repository at this point in the history
* web3.py test partial

* Test the new rpc

* Add test.py

* Fix requirements.txt

* Add hexbytes to requirements

* Fix folder names

* Fix CI
  • Loading branch information
okkothejawa authored May 28, 2024
1 parent 4ee257e commit 5383987
Show file tree
Hide file tree
Showing 7 changed files with 281 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,41 @@ jobs:
exit 1
fi
web3_py:
runs-on: ubicloud-standard-16
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dcarbone/install-jq-action@v2
- name: Install cargo-risczero
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Install risc0-zkvm toolchain # Use the risc0 cargo extension to install the risc0 std library for the current toolchain
run: cargo risczero install --version v2024-04-22.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ github.job }}-${{ github.head_ref }}
path: ./target
- name: Build citrea
run: make build
- name: Install dependencies
working-directory: ./bin/citrea/tests/evm/web3_py
run: pip install -r requirements.txt
- name: Run web3.py tests
run: |
RUST_LOG=off ./target/debug/citrea --da-layer mock --rollup-config-path bin/citrea/configs/mock/sequencer_rollup_config.toml --sequencer-config-path bin/citrea/configs/mock/sequencer_config.toml --genesis-paths bin/test-data/genesis/demo-tests/mock &
sleep 2
RUST_LOG=off ./target/debug/citrea --rollup-config-path bin/citrea/configs/mock/rollup_config.toml --genesis-paths bin/test-data/genesis/demo-tests/mock &
sleep 2
./bin/citrea/publish_da_block.sh &
cd ./bin/citrea/tests/evm/web3_py
python test.py
ethers_js:
runs-on: ubicloud-standard-16
if: github.event.pull_request.draft == false
Expand All @@ -264,7 +299,7 @@ jobs:
- name: Build citrea
run: make build
- name: Install node dependencies
working-directory: ./bin/citrea/tests/evm/ethers.js_tests
working-directory: ./bin/citrea/tests/evm/ethers_js
run: npm install
- name: Run ethers_js tests
run: |
Expand All @@ -273,7 +308,7 @@ jobs:
RUST_LOG=off ./target/debug/citrea --rollup-config-path bin/citrea/configs/mock/rollup_config.toml --genesis-paths bin/test-data/genesis/demo-tests/mock &
sleep 2
./bin/citrea/publish_da_block.sh &
cd ./bin/citrea/tests/evm/ethers.js_tests
cd ./bin/citrea/tests/evm/ethers_js
npx mocha test.js
sys_tx_keccak:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions bin/citrea/tests/evm/web3_py/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web3==6.18.0
hexbytes==0.3.1
242 changes: 242 additions & 0 deletions bin/citrea/tests/evm/web3_py/test.py

Large diffs are not rendered by default.

0 comments on commit 5383987

Please sign in to comment.