Skip to content

Commit

Permalink
dev: clean test-utils (#644)
Browse files Browse the repository at this point in the history
* clean deploy helpers

* add missing tx fields

* fix tests

* readd gitkeep

* fix comments

* fix CI

* load submodules

* fix CI

* set STARKNET_NETWORK if not set

* update default katana account

* clean makefile

* cache save submodules during dump

* fix dump ci

* rearrange jobs

* save dump as artifact

* update naming based on comments
  • Loading branch information
greged93 authored Nov 10, 2023
1 parent d640446 commit f3c8a4d
Show file tree
Hide file tree
Showing 47 changed files with 939 additions and 2,130 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
RUST_LOG=debug

# Starknet Environment
STARKNET_NETWORK=testnet
STARKNET_NETWORK=
## Katana specific configurations
KATANA_ACCOUNT_ADDRESS=0x03ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0
KATANA_PRIVATE_KEY=0x0300001800000000300000180000000000030000000000003006001800006600
KATANA_ACCOUNT_ADDRESS=0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973
KATANA_PRIVATE_KEY=0x1800000000300000180000000000030000000000003006001800006600
## Madara account address and private key
MADARA_ACCOUNT_ADDRESS=0x3
MADARA_PRIVATE_KEY=0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d
Expand Down
38 changes: 27 additions & 11 deletions .github/workflows/dump.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dump the Katana state into the .katana folder
name: Generate dumped state

on:
workflow_call:
Expand All @@ -9,21 +9,37 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Load cached submodules
id: cached-submodules
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ./lib/
key: ${{ runner.os }}-submodules
- name: Setup Rust Toolchain
uses: actions-rs/toolchain@v1
path: ~/.local
key: poetry-${{ runner.os }}
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
profile: minimal
override: true
- name: Retrieve cached dependencies
uses: Swatinem/rust-cache@v2
version: nightly
- name: Pull kakarot submodule and setup
run: make setup && make build-kakarot
- name: Generate the Katana dumped state
run: ./scripts/make_with_env.sh dump-katana
- name: Save submodules
id: cached-submodules
uses: actions/cache/save@v3
with:
path: ./lib/
key: ${{ runner.os }}-submodules
- name: Save dump as artifact
uses: actions/upload-artifact@v3
with:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ name: Workflow - Pull Request
on: [pull_request]

jobs:
submodules:
name: Set up submodules
uses: ./.github/workflows/submodules.yml

dump:
name: Dump katana state
uses: ./.github/workflows/dump.yml
needs: submodules

spell_check:
name: Spell check
Expand All @@ -24,4 +19,4 @@ jobs:
tests:
name: Rust tests
uses: ./.github/workflows/test.yml
needs: [dump, submodules]
needs: dump
5 changes: 0 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ on:
branches: [main]

jobs:
submodules:
name: Set up submodules
uses: ./.github/workflows/submodules.yml

dump:
name: Dump katana state
uses: ./.github/workflows/dump.yml
needs: submodules

spell_check:
name: Spell check
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/submodules.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.17.1
version: 1.17.2
plugins:
sources:
- id: trunk
ref: v1.2.5
ref: v1.2.6
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
Expand All @@ -16,22 +16,22 @@ runtimes:
lint:
enabled:
- [email protected]
- checkov@2.4.9
- checkov@3.0.32
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected].0
- oxipng@8.0.0
- [email protected].3
- oxipng@9.0.0
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- trivy@0.45.1
- trufflehog@3.57.0
- yamllint@1.32.0
- trivy@0.47.0
- trufflehog@3.62.1
- yamllint@1.33.0
actions:
disabled:
- trunk-announce
Expand Down
48 changes: 27 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,36 @@ starknet_api = { git = "https://github.com/starkware-libs/starknet-api", rev = "
# Ethereum dependencies
ethers = "2.0.9"
ethers-solc = "2.0.9"
jsonrpsee = { version = "0.18.2", features = ["full"] }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.7" }
reth-rpc-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.7" }
reth-rlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.7" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.7" }
jsonrpsee = { version = "0.18.2", features = ["full"] }

# Serde
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0"
serde_with = "2.3.1"

# Others
eyre = "0.6.8"
async-trait = "0.1.58"
pin-project = "1.1.2"
lazy_static = "1.4.0"
ctor = "0.2.4"
eyre = "0.6.8"
dotenv = "0.15.0"
git2 = "0.18.0"
lazy_static = "1.4.0"
pin-project = "1.1.2"
ruint = "1.9.0"
url = "2.3.1"
tokio = { version = "1.21.2", features = ["macros"] }
rstest = "0.18.1"
git2 = "0.18.0"
tokio = { version = "1.21.2", features = ["macros"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
ctor = "0.2.4"
url = "2.3.1"

# In order to use dojo-test-utils, we need to explicitly declare the same patches as them in our Cargo.toml
# Otherwise, underlying dependencies of dojo will not be patched and we will get a compilation error
# see https://github.com/dojoengine/dojo/issues/563
# When making changes to the rev, please also update to make file to the same rev in the `install-katana` rule.
katana-core = { git = 'https://github.com/dojoengine/dojo', rev = "b924dac" }
dojo-test-utils = { git = 'https://github.com/dojoengine/dojo', rev = "b924dac" }
cargo-husky = { version = "1.5.0", default-features = false, features = [
Expand Down
Loading

0 comments on commit f3c8a4d

Please sign in to comment.