diff --git a/.github/workflows/cargo-linters.yml b/.github/workflows/cargo-linters.yml new file mode 100644 index 0000000..9617223 --- /dev/null +++ b/.github/workflows/cargo-linters.yml @@ -0,0 +1,23 @@ +--- +name: Task - Linters Cargo + +on: + workflow_dispatch: + workflow_call: + +jobs: + cargo-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + # selecting a toolchain either by action or manual `rustup` calls should happen + # before the plugin, as the cache uses the current rustc version as its cache key + - run: rustup show + + - uses: Swatinem/rust-cache@v2 + - name: Format and clippy + run: | + cargo fmt -- --check + cargo clippy --no-deps -- -D warnings + cargo clippy --tests --no-deps -- -D warnings diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..42f8c8d --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,33 @@ +--- +name: Task - Linters + +on: + workflow_dispatch: + workflow_call: + +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run prettier + run: |- + npx prettier --check . + + markdown-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: avto-dev/markdown-lint@v1 + with: + config: "./.markdownlint.json" + args: "." + ignore: "./target" + + toml-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout toml files + uses: actions/checkout@v3 + - name: Run toml check + run: npx @taplo/cli fmt --config ./taplo/taplo.toml --check diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..93081bc --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,23 @@ +--- +name: Workflow - Pull Request + +on: + workflow_dispatch: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + linters: + name: Run linters + uses: ./.github/workflows/linters.yml + + rust_build: + name: Build Rust project + uses: ./.github/workflows/rust-build.yml + + linters_cargo: + name: Run Cargo linters + uses: ./.github/workflows/linters-cargo.yml + needs: rust_build diff --git a/.github/workflows/rust-build.yml b/.github/workflows/rust-build.yml new file mode 100644 index 0000000..f7cb3e0 --- /dev/null +++ b/.github/workflows/rust-build.yml @@ -0,0 +1,22 @@ +--- +name: Task - Build Rust + +on: + workflow_dispatch: + workflow_call: + +jobs: + rust_build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + # selecting a toolchain either by action or manual `rustup` calls should happen + # before the plugin, as the cache uses the current rustc version as its cache key + - run: rustup show + + - uses: Swatinem/rust-cache@v2 + + - name: Build the project + run: | + cargo build --release --workspace diff --git a/Cargo.lock b/Cargo.lock index 6f139f4..02c6d4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,132 +47,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "appchain-core-contract-client" -version = "0.1.0" -dependencies = [ - "appchain-utils", - "async-trait", - "color-eyre", - "dirs", - "hex", - "log", - "num-traits", - "serde_json", - "starknet", - "starknet-accounts 0.6.1", - "starknet-contract 0.6.0", - "starknet-core 0.7.2", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5", - "starknet-instance", - "starknet-providers 0.7.0", - "starknet-signers 0.5.0", - "thiserror", - "tokio", - "url", -] - -[[package]] -name = "appchain-utils" -version = "0.1.0" -dependencies = [ - "async-trait", - "color-eyre", - "hex", - "log", - "num-traits", - "serde_json", - "starknet", - "starknet-accounts 0.6.1", - "starknet-contract 0.6.0", - "starknet-core 0.7.2", - "starknet-ff 0.3.5", - "starknet-providers 0.7.0", - "starknet-signers 0.5.0", - "thiserror", - "url", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "digest", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-std", - "digest", - "num-bigint", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -273,18 +147,6 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" -[[package]] -name = "bigdecimal" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", - "serde", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -445,11 +307,7 @@ version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ - "android-tzdata", - "iana-time-zone", "num-traits", - "serde", - "windows-targets 0.48.5", ] [[package]] @@ -514,33 +372,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "color-eyre" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - [[package]] name = "const-hex" version = "1.10.0" @@ -669,41 +500,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "darling" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.41", -] - -[[package]] -name = "darling_macro" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.41", -] - [[package]] name = "data-encoding" version = "2.5.0" @@ -727,18 +523,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", - "serde", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", ] [[package]] @@ -1451,10 +1235,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1504,19 +1286,13 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" @@ -1640,35 +1416,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.5.0" @@ -1723,17 +1470,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.1.0" @@ -1741,7 +1477,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -2102,12 +1838,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -2168,12 +1898,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "path-slash" version = "0.2.1" @@ -2224,7 +1948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap", ] [[package]] @@ -2899,17 +2623,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_json_pythonic" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62212da9872ca2a0cad0093191ee33753eddff9266cbbc1b4a602d13a3a768db" -dependencies = [ - "itoa", - "ryu", - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.5" @@ -2931,34 +2644,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" -dependencies = [ - "base64 0.13.1", - "chrono", - "hex", - "indexmap 1.9.3", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.41", -] - [[package]] name = "sha1" version = "0.10.6" @@ -2991,24 +2676,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - [[package]] name = "signature" version = "2.2.0" @@ -3124,113 +2791,6 @@ dependencies = [ "utils", ] -[[package]] -name = "starknet" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b9a7b7bfd87287af85854f7458b8170ba6aa59c39113436532b7ff3d2fcbd8" -dependencies = [ - "starknet-accounts 0.9.0", - "starknet-contract 0.9.0", - "starknet-core 0.10.0", - "starknet-crypto 0.6.2", - "starknet-ff 0.3.7", - "starknet-macros", - "starknet-providers 0.10.0", - "starknet-signers 0.8.0", -] - -[[package]] -name = "starknet-accounts" -version = "0.6.1" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "async-trait", - "auto_impl", - "starknet-core 0.7.2", - "starknet-providers 0.7.0", - "starknet-signers 0.5.0", - "thiserror", -] - -[[package]] -name = "starknet-accounts" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2095d7584608ae1707bd1cf2889368ab3734d9f54e4fcef4765cba1f3b3f7618" -dependencies = [ - "async-trait", - "auto_impl", - "starknet-core 0.10.0", - "starknet-providers 0.10.0", - "starknet-signers 0.8.0", - "thiserror", -] - -[[package]] -name = "starknet-contract" -version = "0.6.0" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "serde", - "serde_json", - "serde_with", - "starknet-accounts 0.6.1", - "starknet-core 0.7.2", - "starknet-providers 0.7.0", - "thiserror", -] - -[[package]] -name = "starknet-contract" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3b73d437b4d62241612d13fce612602de6684c149cccf696e76a20757e2156" -dependencies = [ - "serde", - "serde_json", - "serde_with", - "starknet-accounts 0.9.0", - "starknet-core 0.10.0", - "starknet-providers 0.10.0", - "thiserror", -] - -[[package]] -name = "starknet-core" -version = "0.7.2" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "base64 0.21.5", - "flate2", - "hex", - "serde", - "serde_json", - "serde_json_pythonic", - "serde_with", - "sha3", - "starknet-crypto 0.6.1", - "starknet-ff 0.3.5", -] - -[[package]] -name = "starknet-core" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed286d637e34fb8ae1cd2f9615120ec8ff38d1cffd311ed7fdd497cdd2bd01f" -dependencies = [ - "base64 0.21.5", - "flate2", - "hex", - "serde", - "serde_json", - "serde_json_pythonic", - "serde_with", - "sha3", - "starknet-crypto 0.6.2", - "starknet-ff 0.3.7", -] - [[package]] name = "starknet-core-contract-client" version = "0.1.0" @@ -3244,83 +2804,6 @@ dependencies = [ "utils", ] -[[package]] -name = "starknet-crypto" -version = "0.6.1" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "crypto-bigint", - "hex", - "hmac", - "num-bigint", - "num-integer", - "num-traits", - "rfc6979", - "sha2", - "starknet-crypto-codegen 0.3.2", - "starknet-curve 0.4.0", - "starknet-ff 0.3.5", - "zeroize", -] - -[[package]] -name = "starknet-crypto" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2c30c01e8eb0fc913c4ee3cf676389fffc1d1182bfe5bb9670e4e72e968064" -dependencies = [ - "crypto-bigint", - "hex", - "hmac", - "num-bigint", - "num-integer", - "num-traits", - "rfc6979", - "sha2", - "starknet-crypto-codegen 0.3.3", - "starknet-curve 0.4.2", - "starknet-ff 0.3.7", - "zeroize", -] - -[[package]] -name = "starknet-crypto-codegen" -version = "0.3.2" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "starknet-curve 0.4.0", - "starknet-ff 0.3.5", - "syn 2.0.41", -] - -[[package]] -name = "starknet-crypto-codegen" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" -dependencies = [ - "starknet-curve 0.4.2", - "starknet-ff 0.3.7", - "syn 2.0.41", -] - -[[package]] -name = "starknet-curve" -version = "0.4.0" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "starknet-ff 0.3.5", -] - -[[package]] -name = "starknet-curve" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c383518bb312751e4be80f53e8644034aa99a0afb29d7ac41b89a997db875b" -dependencies = [ - "starknet-ff 0.3.7", -] - [[package]] name = "starknet-erc20-client" version = "0.1.0" @@ -3348,105 +2831,6 @@ dependencies = [ "utils", ] -[[package]] -name = "starknet-ff" -version = "0.3.5" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "ark-ff", - "bigdecimal", - "crypto-bigint", - "getrandom", - "hex", - "serde", -] - -[[package]] -name = "starknet-ff" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abf1b44ec5b18d87c1ae5f54590ca9d0699ef4dd5b2ffa66fc97f24613ec585" -dependencies = [ - "ark-ff", - "bigdecimal", - "crypto-bigint", - "getrandom", - "hex", - "num-bigint", - "serde", -] - -[[package]] -name = "starknet-instance" -version = "0.1.0" -dependencies = [ - "appchain-utils", - "async-trait", - "hex", - "log", - "num-traits", - "serde_json", - "starknet", - "starknet-accounts 0.6.1", - "starknet-contract 0.6.0", - "starknet-core 0.7.2", - "starknet-ff 0.3.5", - "starknet-providers 0.7.0", - "starknet-signers 0.5.0", - "thiserror", - "tokio", - "url", -] - -[[package]] -name = "starknet-macros" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" -dependencies = [ - "starknet-core 0.10.0", - "syn 2.0.41", -] - -[[package]] -name = "starknet-providers" -version = "0.7.0" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "async-trait", - "auto_impl", - "ethereum-types", - "flate2", - "log", - "reqwest", - "serde", - "serde_json", - "serde_with", - "starknet-core 0.7.2", - "thiserror", - "url", -] - -[[package]] -name = "starknet-providers" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6abf40ffcbe3b887b4d5cfc8ab73170c816b4aa78d1d4ad59abd3fb3b0f53cd" -dependencies = [ - "async-trait", - "auto_impl", - "ethereum-types", - "flate2", - "log", - "reqwest", - "serde", - "serde_json", - "serde_with", - "starknet-core 0.10.0", - "thiserror", - "url", -] - [[package]] name = "starknet-proxy-client" version = "0.1.0" @@ -3461,37 +2845,6 @@ dependencies = [ "utils", ] -[[package]] -name = "starknet-signers" -version = "0.5.0" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "async-trait", - "auto_impl", - "crypto-bigint", - "eth-keystore", - "rand", - "starknet-core 0.7.2", - "starknet-crypto 0.6.1", - "thiserror", -] - -[[package]] -name = "starknet-signers" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a2bd4fd66090003c3b7f0d76476e5b63cd44f6a49ede2442673f4427d5a40" -dependencies = [ - "async-trait", - "auto_impl", - "crypto-bigint", - "eth-keystore", - "rand", - "starknet-core 0.10.0", - "starknet-crypto 0.6.2", - "thiserror", -] - [[package]] name = "starknet-token-bridge-client" version = "0.1.0" @@ -3524,12 +2877,6 @@ dependencies = [ "precomputed-hash", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strum" version = "0.25.0" @@ -3671,16 +3018,6 @@ dependencies = [ "syn 2.0.41", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.31" @@ -3747,7 +3084,6 @@ dependencies = [ "num_cpus", "parking_lot", "pin-project-lite", - "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.48.0", @@ -3830,7 +3166,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap", "toml_datetime", "winnow", ] @@ -3841,7 +3177,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -3883,17 +3219,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", ] [[package]] @@ -3906,17 +3231,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -4045,12 +3359,6 @@ dependencies = [ "serde", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "version_check" version = "0.9.4" @@ -4195,15 +3503,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.0", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4394,20 +3693,6 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", -] [[package]] name = "zip" diff --git a/Cargo.toml b/Cargo.toml index 6ca723a..3404597 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,14 @@ resolver = "2" members = [ "crates/l2/starknet-core-contract-client", - "crates/l2/ethereum-instance", "crates/l2/starknet-eth-bridge-client", "crates/l2/starknet-token-bridge-client", "crates/l2/starkgate-manager-client", "crates/l2/utils", "crates/l2/starknet-erc20-client", "crates/l2/starkgate-registry-client", "crates/l2/starknet-proxy-client", + "crates/l2/ethereum-instance", + "crates/l2/starknet-eth-bridge-client", + "crates/l2/starknet-token-bridge-client", + "crates/l2/starkgate-manager-client", + "crates/l2/utils", + "crates/l2/starknet-erc20-client", + "crates/l2/starkgate-registry-client", + "crates/l2/starknet-proxy-client", ] [workspace.package] @@ -20,6 +27,3 @@ async-trait = "0.1.74" dirs = "5.0.1" serde_json = "1.0.108" hex = "0.4.3" - - - diff --git a/crates/l2/ethereum-instance/Cargo.toml b/crates/l2/ethereum-instance/Cargo.toml index c175e17..77df0c4 100644 --- a/crates/l2/ethereum-instance/Cargo.toml +++ b/crates/l2/ethereum-instance/Cargo.toml @@ -5,13 +5,13 @@ version.workspace = true authors.workspace = true [dependencies] -ethers = { workspace = true } dirs = { workspace = true } +ethers = { workspace = true } +hex = { workspace = true } +log = "0.4.20" serde_json = { workspace = true } thiserror = { workspace = true } -hex = { workspace = true } utils = { path = "../utils" } -log = "0.4.20" [dev-dependencies] tokio = { version = "1.29.1", features = ["rt", "macros", "parking_lot"] } diff --git a/crates/l2/ethereum-instance/src/lib.rs b/crates/l2/ethereum-instance/src/lib.rs index 51727bd..6ab892f 100644 --- a/crates/l2/ethereum-instance/src/lib.rs +++ b/crates/l2/ethereum-instance/src/lib.rs @@ -73,7 +73,7 @@ impl EthereumClient { let wallet: LocalWallet = priv_key.parse().expect("Failed to parse private key"); - let chain_id = chain_id.unwrap_or_else(|| ANVIL_DEFAULT_CHAIN_ID); + let chain_id = chain_id.unwrap_or(ANVIL_DEFAULT_CHAIN_ID); let client = SignerMiddleware::new(provider.clone(), wallet.with_chain_id(chain_id)); diff --git a/crates/l2/starkgate-manager-client/Cargo.toml b/crates/l2/starkgate-manager-client/Cargo.toml index aeaba4c..bea9f39 100644 --- a/crates/l2/starkgate-manager-client/Cargo.toml +++ b/crates/l2/starkgate-manager-client/Cargo.toml @@ -8,10 +8,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } -utils = { path = "../utils" } starknet-proxy-client = { path = "../starknet-proxy-client" } +thiserror = { workspace = true } +utils = { path = "../utils" } diff --git a/crates/l2/starkgate-registry-client/Cargo.toml b/crates/l2/starkgate-registry-client/Cargo.toml index 8c95813..c5c3d67 100644 --- a/crates/l2/starkgate-registry-client/Cargo.toml +++ b/crates/l2/starkgate-registry-client/Cargo.toml @@ -8,10 +8,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } -utils = { path = "../utils" } starknet-proxy-client = { path = "../starknet-proxy-client" } +thiserror = { workspace = true } +utils = { path = "../utils" } diff --git a/crates/l2/starknet-core-contract-client/Cargo.toml b/crates/l2/starknet-core-contract-client/Cargo.toml index 990292d..aa35e99 100644 --- a/crates/l2/starknet-core-contract-client/Cargo.toml +++ b/crates/l2/starknet-core-contract-client/Cargo.toml @@ -5,10 +5,10 @@ version.workspace = true authors.workspace = true [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } -utils = { path = "../utils" } starknet-proxy-client = { path = "../starknet-proxy-client" } +thiserror = { workspace = true } +utils = { path = "../utils" } diff --git a/crates/l2/starknet-erc20-client/Cargo.toml b/crates/l2/starknet-erc20-client/Cargo.toml index 332ad73..ffd8c2f 100644 --- a/crates/l2/starknet-erc20-client/Cargo.toml +++ b/crates/l2/starknet-erc20-client/Cargo.toml @@ -8,11 +8,11 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } +ethereum-instance = { path = "../ethereum-instance" } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } -utils = { path = "../utils" } starknet-proxy-client = { path = "../starknet-proxy-client" } -ethereum-instance = { path = "../ethereum-instance" } +thiserror = { workspace = true } +utils = { path = "../utils" } diff --git a/crates/l2/starknet-erc20-client/src/interfaces/erc20.rs b/crates/l2/starknet-erc20-client/src/interfaces/erc20.rs index 865ff64..e6e99ef 100644 --- a/crates/l2/starknet-erc20-client/src/interfaces/erc20.rs +++ b/crates/l2/starknet-erc20-client/src/interfaces/erc20.rs @@ -80,7 +80,7 @@ where match txn { Ok(receipt) => { - if let Some(_) = receipt { + if receipt.is_some() { return Ok(true); } Ok(false) diff --git a/crates/l2/starknet-eth-bridge-client/Cargo.toml b/crates/l2/starknet-eth-bridge-client/Cargo.toml index 5804a97..00d3820 100644 --- a/crates/l2/starknet-eth-bridge-client/Cargo.toml +++ b/crates/l2/starknet-eth-bridge-client/Cargo.toml @@ -8,10 +8,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } -utils = { path = "../utils" } starknet-proxy-client = { path = "../starknet-proxy-client" } +thiserror = { workspace = true } +utils = { path = "../utils" } diff --git a/crates/l2/starknet-proxy-client/Cargo.toml b/crates/l2/starknet-proxy-client/Cargo.toml index b89e7c7..d1f363b 100644 --- a/crates/l2/starknet-proxy-client/Cargo.toml +++ b/crates/l2/starknet-proxy-client/Cargo.toml @@ -8,11 +8,11 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } +ethereum-instance = { path = "../ethereum-instance" } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } serde_json = { workspace = true } +thiserror = { workspace = true } utils = { path = "../utils" } -ethereum-instance = { path = "../ethereum-instance" } \ No newline at end of file diff --git a/crates/l2/starknet-proxy-client/src/deploy.rs b/crates/l2/starknet-proxy-client/src/deploy.rs index b24f5d3..235fe9a 100644 --- a/crates/l2/starknet-proxy-client/src/deploy.rs +++ b/crates/l2/starknet-proxy-client/src/deploy.rs @@ -44,7 +44,7 @@ pub async fn deploy_contract_behind_unsafe_proxy( let proxy_contract = deploy_contract(client.clone(), UNSAFE_PROXY, contract.address()).await?; - return Ok(proxy_contract); + Ok(proxy_contract) } pub async fn deploy_contract_behind_safe_proxy( @@ -71,5 +71,5 @@ pub async fn deploy_contract_behind_safe_proxy( proxy_contract.address() ); - return Ok((proxy_contract, contract)); + Ok((proxy_contract, contract)) } diff --git a/crates/l2/starknet-proxy-client/src/proxy_support.rs b/crates/l2/starknet-proxy-client/src/proxy_support.rs index f8d891c..479cd2a 100644 --- a/crates/l2/starknet-proxy-client/src/proxy_support.rs +++ b/crates/l2/starknet-proxy-client/src/proxy_support.rs @@ -120,6 +120,7 @@ pub struct ProxyInitializeData { pub init_data: CoreContractInitData, } +#[allow(clippy::from_over_into)] impl Into> for ProxyInitializeData { fn into(self) -> Vec { [ @@ -131,6 +132,7 @@ impl Into> for ProxyInitializeData { } } +#[allow(clippy::from_over_into)] impl Into> for CoreContractInitData { fn into(self) -> Vec { [ @@ -143,6 +145,7 @@ impl Into> for CoreContractInitData { } } +#[allow(clippy::from_over_into)] impl Into> for CoreContractState { fn into(self) -> Vec { [ @@ -154,6 +157,7 @@ impl Into> for CoreContractState { } } +#[allow(clippy::from_over_into)] impl Into for ProxyInitializeData { fn into(self) -> Bytes { Into::>::into(self).into() diff --git a/crates/l2/starknet-token-bridge-client/Cargo.toml b/crates/l2/starknet-token-bridge-client/Cargo.toml index 55d508d..c00f60f 100644 --- a/crates/l2/starknet-token-bridge-client/Cargo.toml +++ b/crates/l2/starknet-token-bridge-client/Cargo.toml @@ -8,10 +8,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } +starknet-proxy-client = { path = "../starknet-proxy-client" } +thiserror = { workspace = true } utils = { path = "../utils" } -starknet-proxy-client = { path = "../starknet-proxy-client" } \ No newline at end of file diff --git a/crates/l2/utils/Cargo.toml b/crates/l2/utils/Cargo.toml index a2b3edb..355ff7d 100644 --- a/crates/l2/utils/Cargo.toml +++ b/crates/l2/utils/Cargo.toml @@ -8,9 +8,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +async-trait = { workspace = true } ethers = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } serde_json = { workspace = true } +thiserror = { workspace = true } diff --git a/crates/l3/appchain-core-contract-client/Cargo.toml b/crates/l3/appchain-core-contract-client/Cargo.toml index c5cade9..2104db8 100644 --- a/crates/l3/appchain-core-contract-client/Cargo.toml +++ b/crates/l3/appchain-core-contract-client/Cargo.toml @@ -5,23 +5,23 @@ version.workspace = true authors.workspace = true [dependencies] -starknet = { workspace = true } +appchain-utils = { path = "../appchain-utils" } +async-trait = { workspace = true } +color-eyre = { workspace = true } dirs = { workspace = true } -serde_json = { workspace = true } -thiserror = { workspace = true } hex = { workspace = true } -appchain-utils = { path = "../appchain-utils" } -tokio = { workspace = true } log = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } +serde_json = { workspace = true } +starknet = { workspace = true } starknet-accounts = { workspace = true } starknet-contract = { workspace = true } starknet-core = { workspace = true } starknet-crypto = { workspace = true } starknet-ff = { workspace = true } +starknet-instance = { path = "../starknet-instance" } starknet-providers = { workspace = true } starknet-signers = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true } url = { workspace = true } -starknet-instance = { path = "../starknet-instance" } -color-eyre = { workspace = true } \ No newline at end of file diff --git a/crates/l3/appchain-utils/Cargo.toml b/crates/l3/appchain-utils/Cargo.toml index 6e194f6..fb25861 100644 --- a/crates/l3/appchain-utils/Cargo.toml +++ b/crates/l3/appchain-utils/Cargo.toml @@ -8,18 +8,18 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -starknet = { workspace = true } +async-trait = { workspace = true } +color-eyre = { workspace = true } +hex = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } -starknet-providers = { workspace = true } -starknet-core = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } serde_json = { workspace = true } +starknet = { workspace = true } starknet-accounts = { workspace = true } -starknet-signers = { workspace = true } starknet-contract = { workspace = true } +starknet-core = { workspace = true } starknet-ff = { workspace = true } -hex = { workspace = true } -color-eyre = { workspace = true } +starknet-providers = { workspace = true } +starknet-signers = { workspace = true } +thiserror = { workspace = true } url = { workspace = true } diff --git a/crates/l3/starknet-instance/Cargo.toml b/crates/l3/starknet-instance/Cargo.toml index 4437076..95af6d9 100644 --- a/crates/l3/starknet-instance/Cargo.toml +++ b/crates/l3/starknet-instance/Cargo.toml @@ -5,19 +5,19 @@ version.workspace = true authors.workspace = true [dependencies] -starknet = { workspace = true } -serde_json = { workspace = true } -thiserror = { workspace = true } -hex = { workspace = true } appchain-utils = { path = "../appchain-utils" } -tokio = { workspace = true } +async-trait = { workspace = true } +hex = { workspace = true } log = { workspace = true } num-traits = { workspace = true } -async-trait = { workspace = true } +serde_json = { workspace = true } +starknet = { workspace = true } starknet-accounts = { workspace = true } starknet-contract = { workspace = true } starknet-core = { workspace = true } starknet-ff = { workspace = true } starknet-providers = { workspace = true } starknet-signers = { workspace = true } -url = { workspace = true } \ No newline at end of file +thiserror = { workspace = true } +tokio = { workspace = true } +url = { workspace = true } diff --git a/foundry.toml b/foundry.toml index 4ff40c4..e883058 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,4 +3,4 @@ src = "src" out = "out" libs = ["lib"] -# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file +# See more config options https://github.com/foundry-rs/foundry/tree/master/config diff --git a/taplo/taplo.toml b/taplo/taplo.toml new file mode 100644 index 0000000..ab1ae63 --- /dev/null +++ b/taplo/taplo.toml @@ -0,0 +1,11 @@ +include = ["**/*.toml"] +exclude = ["**/bad.toml", "lib/*.toml"] + +[formatting] +align_entries = false + +[[rule]] +keys = ["dependencies"] + +[rule.formatting] +reorder_keys = true