From d387965a2636396ca91f042215169463c15fdbbe Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 6 Oct 2025 20:44:46 -0600 Subject: [PATCH 1/3] fix: bump to 0.17 with new UDC arg --- .gitignore | 1 + Cargo.lock | 709 +++++++++++------- Cargo.toml | 5 +- src/account.rs | 2 +- src/block_id.rs | 4 +- src/compiler.rs | 9 +- src/main.rs | 3 +- src/provider.rs | 14 +- src/subcommands/account/deploy.rs | 26 +- src/subcommands/account/fetch.rs | 26 +- src/subcommands/balance.rs | 2 +- src/subcommands/block_time.rs | 6 +- src/subcommands/block_traces.rs | 4 +- src/subcommands/class_at.rs | 2 +- src/subcommands/class_by_hash.rs | 2 +- src/subcommands/class_hash_at.rs | 2 +- src/subcommands/declare.rs | 9 +- src/subcommands/deploy.rs | 17 +- src/subcommands/invoke.rs | 7 +- src/subcommands/nonce.rs | 2 +- src/subcommands/signer/ledger/app_version.rs | 3 +- .../signer/ledger/get_public_key.rs | 3 +- src/subcommands/signer/ledger/sign_hash.rs | 3 +- src/udc.rs | 56 ++ 24 files changed, 593 insertions(+), 324 deletions(-) create mode 100644 src/udc.rs diff --git a/.gitignore b/.gitignore index 44306a2..7af7370 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /book/book/ /target/ +.DS_Store diff --git a/Cargo.lock b/Cargo.lock index fb57c77..57c2f1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -186,7 +186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -371,6 +371,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -419,9 +428,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cairo-felt" @@ -1712,7 +1721,7 @@ dependencies = [ "serde_json", "sha3", "smol_str 0.2.0", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 1.0.61", ] @@ -1738,7 +1747,7 @@ dependencies = [ "serde_json", "sha3", "smol_str 0.3.2", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 2.0.12", ] @@ -2215,7 +2224,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 1.0.61", ] @@ -2235,7 +2244,7 @@ dependencies = [ "itertools 0.14.0", "num-bigint", "num-traits", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 2.0.12", ] @@ -2517,7 +2526,7 @@ dependencies = [ "serde_json", "sha3", "smol_str 0.2.0", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 1.0.61", ] @@ -2539,7 +2548,7 @@ dependencies = [ "serde_json", "sha3", "smol_str 0.3.2", - "starknet-types-core", + "starknet-types-core 0.1.7", "thiserror 2.0.12", ] @@ -2790,12 +2799,14 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.2.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb" dependencies = [ + "find-msvc-tools", "jobserver", "libc", + "shlex", ] [[package]] @@ -2931,7 +2942,7 @@ dependencies = [ "byteorder", "cfg-if", "const-hex", - "getrandom", + "getrandom 0.2.16", "hidapi-rusb", "js-sys", "log", @@ -3116,7 +3127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -3305,7 +3316,7 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -3320,15 +3331,6 @@ dependencies = [ "log", ] -[[package]] -name = "encoding_rs" -version = "0.8.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_logger" version = "0.9.3" @@ -3404,7 +3406,7 @@ dependencies = [ "hex", "hmac", "pbkdf2", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", @@ -3453,10 +3455,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -3464,7 +3472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -3533,23 +3541,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - [[package]] name = "futures-task" version = "0.3.28" @@ -3563,11 +3554,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", - "futures-macro", "futures-task", "pin-project-lite", "pin-utils", - "slab", ] [[package]] @@ -3605,9 +3594,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", @@ -3616,6 +3605,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasi 0.14.7+wasi-0.2.4", + "wasm-bindgen", +] + [[package]] name = "gimli" version = "0.27.3" @@ -3652,29 +3655,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] -[[package]] -name = "h2" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3778,9 +3762,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -3789,26 +3773,32 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", - "pin-project-lite", ] [[package]] -name = "httparse" -version = "1.8.0" +name = "http-body-util" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] [[package]] -name = "httpdate" -version = "1.0.2" +name = "httparse" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "humantime" @@ -3818,40 +3808,62 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", + "hyper-util", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -3991,9 +4003,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] [[package]] name = "is-terminal" @@ -4050,19 +4072,21 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -4190,7 +4214,21 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbc2a4da0d9e52ccfe6306801a112e81a8fc0c76aa3e4449fefeda7fef72bb34" dependencies = [ - "lambdaworks-math", + "lambdaworks-math 0.10.0", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "lambdaworks-crypto" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce8f59622ed408c318c9b5eca17f1a1154159e3738b5c4d5a22a0dd3700c906" +dependencies = [ + "lambdaworks-math 0.12.0", + "rand 0.8.5", + "rand_chacha 0.3.1", "serde", "sha2", "sha3", @@ -4206,20 +4244,32 @@ dependencies = [ "serde_json", ] +[[package]] +name = "lambdaworks-math" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "405d65a26831650ba348a503a2881ed7a0483ef3ec17f66e0fc8e2f9c97fc7ca" +dependencies = [ + "getrandom 0.2.16", + "rand 0.8.5", + "serde", + "serde_json", +] + [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] name = "libc" -version = "0.2.155" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "libgit2-sys" @@ -4285,6 +4335,12 @@ version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "matrixmultiply" version = "0.3.9" @@ -4329,12 +4385,6 @@ dependencies = [ "sprs", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -4749,13 +4799,68 @@ dependencies = [ "bitflags 2.3.3", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax 0.8.4", "unarray", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.1", + "rustls", + "socket2", + "thiserror 2.0.12", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash 2.1.1", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.12", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.39" @@ -4765,6 +4870,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "radium" version = "0.7.0" @@ -4778,8 +4889,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -4789,7 +4910,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -4798,7 +4929,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", ] [[package]] @@ -4807,7 +4947,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4862,7 +5002,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom", + "getrandom 0.2.16", "redox_syscall 0.2.16", "thiserror 1.0.61", ] @@ -4927,41 +5067,40 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ - "base64 0.21.2", + "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", - "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", - "ipnet", + "hyper-util", "js-sys", "log", - "mime", - "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", - "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "tokio", "tokio-rustls", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", ] [[package]] @@ -4976,17 +5115,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", + "cfg-if", + "getrandom 0.2.16", "libc", - "once_cell", - "spin 0.5.2", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -5050,7 +5188,7 @@ dependencies = [ "oorandom", "parking_lot 0.12.1", "rust-analyzer-salsa-macros", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", "tracing", "triomphe", @@ -5080,6 +5218,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -5110,32 +5254,36 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.23.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" dependencies = [ - "log", + "once_cell", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] -name = "rustls-pemfile" -version = "1.0.3" +name = "rustls-pki-types" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ - "base64 0.21.2", + "web-time", + "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.101.2" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] @@ -5163,7 +5311,7 @@ dependencies = [ "log", "oorandom", "parking_lot 0.11.2", - "rustc-hash", + "rustc-hash 1.1.0", "salsa-macros", "smallvec", ] @@ -5241,16 +5389,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sec1" version = "0.7.3" @@ -5407,6 +5545,12 @@ dependencies = [ "dirs", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" version = "2.2.0" @@ -5414,7 +5558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -5434,9 +5578,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smol_str" @@ -5459,30 +5603,14 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -5537,6 +5665,7 @@ dependencies = [ "clap", "clap_complete", "coins-bip32", + "coins-ledger", "colored", "colored_json", "env_logger 0.10.0", @@ -5549,7 +5678,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "rand", + "rand 0.8.5", "rayon", "regex", "rpassword", @@ -5560,7 +5689,7 @@ dependencies = [ "sha2", "shellexpand", "starknet", - "starknet-crypto 0.7.4", + "starknet-crypto 0.8.1", "tempfile", "thiserror 1.0.61", "tokio", @@ -5571,15 +5700,15 @@ dependencies = [ [[package]] name = "starknet" -version = "0.14.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e2e53e7705c9a9aad7f118a4bac7386afeb8db272b3eb445a464ca4c3dfee5" +checksum = "f5ed01c14136e56dcdf21385d20c4a6fdd3509947cb56cca45fc765ef5809add" dependencies = [ "starknet-accounts", "starknet-contract", "starknet-core", "starknet-core-derive", - "starknet-crypto 0.7.4", + "starknet-crypto 0.8.1", "starknet-macros", "starknet-providers", "starknet-signers", @@ -5587,14 +5716,14 @@ dependencies = [ [[package]] name = "starknet-accounts" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca52534db01eda3bf3250f398bd4597aed3856d0d17d84070efbc7919abad71" +checksum = "4f7c118729bcdcfa1610844047cbdb23090fb1d4172a36bb97a663be8d022d1a" dependencies = [ "async-trait", "auto_impl", "starknet-core", - "starknet-crypto 0.7.4", + "starknet-crypto 0.8.1", "starknet-providers", "starknet-signers", "thiserror 1.0.61", @@ -5602,9 +5731,9 @@ dependencies = [ [[package]] name = "starknet-contract" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67d8d5a5306527eedcb4bd70afecfc6824add631a08eac8fd1cf9c2bdfd21e77" +checksum = "ccb64331b72caf51c0d8b684b62012f9a771015b4cf5e52cba9bf61be8384ad3" dependencies = [ "serde", "serde_json", @@ -5617,9 +5746,9 @@ dependencies = [ [[package]] name = "starknet-core" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b53a16799e4a75173839d868a1a48ff5d3e10456febd4dec91b04ba6521741d5" +checksum = "efb7212226769766c1c7d79b70f9242ffbd213290a41604ecc7e78faa0ed0deb" dependencies = [ "base64 0.21.2", "crypto-bigint", @@ -5634,8 +5763,8 @@ dependencies = [ "serde_with", "sha3", "starknet-core-derive", - "starknet-crypto 0.7.4", - "starknet-types-core", + "starknet-crypto 0.8.1", + "starknet-types-core 0.2.2", ] [[package]] @@ -5671,9 +5800,9 @@ dependencies = [ [[package]] name = "starknet-crypto" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039a3bad70806b494c9e6b21c5238a6c8a373d66a26071859deb0ccca6f93634" +checksum = "1004a16c25dc6113c19d4f9d0c19ff97d85804829894bba22c0d0e9e7b249812" dependencies = [ "crypto-bigint", "hex", @@ -5683,8 +5812,8 @@ dependencies = [ "num-traits", "rfc6979", "sha2", - "starknet-curve 0.5.1", - "starknet-types-core", + "starknet-curve 0.6.0", + "starknet-types-core 0.2.2", "zeroize", ] @@ -5710,11 +5839,11 @@ dependencies = [ [[package]] name = "starknet-curve" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcde6bd74269b8161948190ace6cf069ef20ac6e79cd2ba09b320efa7500b6de" +checksum = "22c898ae81b6409532374cf237f1bd752d068b96c6ad500af9ebbd0d9bb712f6" dependencies = [ - "starknet-types-core", + "starknet-types-core 0.2.2", ] [[package]] @@ -5725,15 +5854,15 @@ checksum = "7584bc732e4d2a8ccebdd1dda8236f7940a79a339e30ebf338d45c329659e36c" dependencies = [ "ark-ff", "crypto-bigint", - "getrandom", + "getrandom 0.2.16", "hex", ] [[package]] name = "starknet-macros" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb14b6714e7625aca063e91022e574ee0bca863df98071dd7191e24919a367b0" +checksum = "6d59e1eb22f4366385b132ba7016faa5a6457f1f23f896f737a06da626455e7b" dependencies = [ "starknet-core", "syn 2.0.100", @@ -5741,15 +5870,15 @@ dependencies = [ [[package]] name = "starknet-providers" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c74c3850a661fa1ffd3c3e2cb9db6e28c94ab9aaaa0496503014a814f09cd455" +checksum = "15fc3d94cc008cea64e291b261e8349065424ee7491e5dd0fa9bd688818bece1" dependencies = [ "async-trait", "auto_impl", "ethereum-types", "flate2", - "getrandom", + "getrandom 0.2.16", "log", "reqwest", "serde", @@ -5762,9 +5891,9 @@ dependencies = [ [[package]] name = "starknet-signers" -version = "0.11.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2aeca13b8c61165b69d4775880d74ff9bbb9bafa36a297899e0f160619631b3" +checksum = "d839b06d899ef3a0de11b1e9a91a14c118b1ed36830ec8e59d9fbc9a1e51976b" dependencies = [ "async-trait", "auto_impl", @@ -5772,11 +5901,11 @@ dependencies = [ "coins-ledger", "crypto-bigint", "eth-keystore", - "getrandom", - "rand", + "getrandom 0.2.16", + "rand 0.8.5", "semver", "starknet-core", - "starknet-crypto 0.7.4", + "starknet-crypto 0.8.1", "thiserror 1.0.61", ] @@ -5786,8 +5915,8 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa1b9e01ccb217ab6d475c5cda05dbb22c30029f7bb52b192a010a00d77a3d74" dependencies = [ - "lambdaworks-crypto", - "lambdaworks-math", + "lambdaworks-crypto 0.10.0", + "lambdaworks-math 0.10.0", "lazy_static", "num-bigint", "num-integer", @@ -5795,6 +5924,24 @@ dependencies = [ "serde", ] +[[package]] +name = "starknet-types-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92eb6db1a763c350ffa50ed65ea3a92de9888239357cfbcb633e29a4da77f122" +dependencies = [ + "blake2", + "digest", + "lambdaworks-crypto 0.12.0", + "lambdaworks-math 0.12.0", + "num-bigint", + "num-integer", + "num-traits", + "rand 0.9.2", + "serde", + "zeroize", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -5848,6 +5995,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "tap" version = "1.0.1" @@ -6017,7 +6173,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -6035,28 +6191,14 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - [[package]] name = "toml" version = "0.4.10" @@ -6136,11 +6278,50 @@ dependencies = [ "winnow 0.7.3", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags 2.3.3", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -6258,9 +6439,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -6285,7 +6466,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom", + "getrandom 0.2.16", "serde", ] @@ -6344,25 +6525,45 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.100", @@ -6383,9 +6584,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6393,9 +6594,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", @@ -6406,9 +6607,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" @@ -6421,22 +6625,22 @@ dependencies = [ ] [[package]] -name = "webpki" -version = "0.22.0" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "ring", - "untrusted", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" dependencies = [ - "webpki", + "rustls-pki-types", ] [[package]] @@ -6630,13 +6834,10 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.10.1" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "wyz" diff --git a/Cargo.toml b/Cargo.toml index 40ac29c..9e0e23f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ chrono = "0.4.26" clap = { version = "4.3.8", features = ["derive", "env", "string"] } clap_complete = "4.3.1" coins-bip32 = "0.11.1" +coins-ledger = "0.12.0" colored = "2.0.0" colored_json = "3.2.0" env_logger = "0.10.0" @@ -44,8 +45,8 @@ serde_json_pythonic = { version = "0.1.2", default-features = false, features = serde_with = "3.11.0" sha2 = "0.10.8" shellexpand = "3.1.0" -starknet = "0.14.0" -starknet-crypto = "0.7.4" +starknet = "0.17.0" +starknet-crypto = "0.8.1" tempfile = "3.8.0" thiserror = "1.0.40" tokio = { version = "1.28.2", default-features = false, features = ["macros"] } diff --git a/src/account.rs b/src/account.rs index 23fc667..3b58783 100644 --- a/src/account.rs +++ b/src/account.rs @@ -438,7 +438,7 @@ impl AccountArgs { ) }; - account.set_block_id(BlockId::Tag(BlockTag::Pending)); + account.set_block_id(BlockId::Tag(BlockTag::PreConfirmed)); Ok(account) } diff --git a/src/block_id.rs b/src/block_id.rs index bc97b79..b49d71e 100644 --- a/src/block_id.rs +++ b/src/block_id.rs @@ -23,8 +23,8 @@ impl TypedValueParser for BlockIdParser { if value == "latest" { Ok(BlockId::Tag(BlockTag::Latest)) - } else if value == "pending" { - Ok(BlockId::Tag(BlockTag::Pending)) + } else if value == "pending" || value == "preconfirmed" { + Ok(BlockId::Tag(BlockTag::PreConfirmed)) } else if regex_block_number.is_match(value) { Ok(BlockId::Number(value.parse::().map_err(|err| { cmd.clone().error( diff --git a/src/compiler.rs b/src/compiler.rs index d6a555d..fd54e41 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -53,7 +53,7 @@ pub struct CompilerBinary { } /// Statically linked Sierra compiler versions. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum LinkedCompilerVersion { V1_0_0, V1_1_1, @@ -62,6 +62,7 @@ pub enum LinkedCompilerVersion { V2_5_4, V2_6_4, V2_9_4, + #[default] V2_12_0, } @@ -295,12 +296,6 @@ impl MaybeUnknownSierraVersion { } } -impl Default for LinkedCompilerVersion { - fn default() -> Self { - Self::V2_12_0 - } -} - impl Display for LinkedCompilerVersion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { diff --git a/src/main.rs b/src/main.rs index ec40ab1..0da90db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use anyhow::Result; use clap::{CommandFactory, Parser, Subcommand}; use colored::Colorize; -use crate::{provider::ProviderArgs, subcommands::*}; +use crate::{provider::ProviderArgs, subcommands::*, udc::UdcArgs}; mod account; mod account_factory; @@ -21,6 +21,7 @@ mod profile; mod provider; mod signer; mod subcommands; +mod udc; mod utils; mod verbosity; diff --git a/src/provider.rs b/src/provider.rs index 1d60f79..3f55b1c 100644 --- a/src/provider.rs +++ b/src/provider.rs @@ -289,7 +289,7 @@ impl Provider for ExtendedProvider { async fn get_block_with_tx_hashes( &self, block_id: B, - ) -> Result + ) -> Result where B: AsRef + Send + Sync, { @@ -303,7 +303,7 @@ impl Provider for ExtendedProvider { async fn get_block_with_txs( &self, block_id: B, - ) -> Result + ) -> Result where B: AsRef + Send + Sync, { @@ -314,7 +314,7 @@ impl Provider for ExtendedProvider { async fn get_block_with_receipts( &self, block_id: B, - ) -> Result + ) -> Result where B: AsRef + Send + Sync, { @@ -328,7 +328,7 @@ impl Provider for ExtendedProvider { async fn get_state_update( &self, block_id: B, - ) -> Result + ) -> Result where B: AsRef + Send + Sync, { @@ -358,7 +358,7 @@ impl Provider for ExtendedProvider { async fn get_messages_status( &self, transaction_hash: Hash256, - ) -> Result, ProviderError> { + ) -> Result, ProviderError> { as Provider>::get_messages_status( &self.provider, transaction_hash, @@ -538,7 +538,7 @@ impl Provider for ExtendedProvider { &self, message: M, block_id: B, - ) -> Result + ) -> Result where M: AsRef + Send + Sync, B: AsRef + Send + Sync, @@ -699,7 +699,7 @@ impl Provider for ExtendedProvider { block_id: B, ) -> Result, ProviderError> where - B: AsRef + Send + Sync, + B: AsRef + Send + Sync, { as Provider>::trace_block_transactions( &self.provider, diff --git a/src/subcommands/account/deploy.rs b/src/subcommands/account/deploy.rs index 67d18fe..063e474 100644 --- a/src/subcommands/account/deploy.rs +++ b/src/subcommands/account/deploy.rs @@ -129,7 +129,7 @@ impl Deploy { provider.clone(), ) .await?; - factory.set_block_id(BlockId::Tag(BlockTag::Pending)); + factory.set_block_id(BlockId::Tag(BlockTag::PreConfirmed)); AnyAccountFactory::OpenZeppelin(factory) } @@ -159,7 +159,7 @@ impl Deploy { provider.clone(), ) .await?; - factory.set_block_id(BlockId::Tag(BlockTag::Pending)); + factory.set_block_id(BlockId::Tag(BlockTag::PreConfirmed)); AnyAccountFactory::Argent(factory) } @@ -194,7 +194,7 @@ impl Deploy { provider.clone(), ) .await?; - factory.set_block_id(BlockId::Tag(BlockTag::Pending)); + factory.set_block_id(BlockId::Tag(BlockTag::PreConfirmed)); AnyAccountFactory::Braavos(factory) } // Reject other variants as we add more types @@ -334,8 +334,11 @@ impl Deploy { if fee_setting.is_estimate_only() { println!( "{} STRK", - format!("{}", felt_to_bigdecimal(estimated_fee.overall_fee, 18)) - .bright_yellow(), + format!( + "{}", + felt_to_bigdecimal(Felt::from(estimated_fee.overall_fee), 18) + ) + .bright_yellow(), ); return Ok(()); } @@ -468,14 +471,15 @@ fn resolve_estimate_buffer<'a>( MaxFeeType, AccountDeploymentV3<'a, AnyAccountFactory, Arc>>, )> { - let l1_gas = resolve_amount_buffer(l1_gas, estimated_fee.l1_gas_consumed)?; - let l2_gas = resolve_amount_buffer(l2_gas, estimated_fee.l2_gas_consumed)?; - let l1_data_gas = resolve_amount_buffer(l1_data_gas, estimated_fee.l1_data_gas_consumed)?; + let l1_gas = resolve_amount_buffer(l1_gas, estimated_fee.l1_gas_consumed.into())?; + let l2_gas = resolve_amount_buffer(l2_gas, estimated_fee.l2_gas_consumed.into())?; + let l1_data_gas = + resolve_amount_buffer(l1_data_gas, estimated_fee.l1_data_gas_consumed.into())?; - let l1_gas_price = resolve_amount_buffer(l1_gas_price, estimated_fee.l1_gas_price)?; - let l2_gas_price = resolve_amount_buffer(l2_gas_price, estimated_fee.l2_gas_price)?; + let l1_gas_price = resolve_amount_buffer(l1_gas_price, estimated_fee.l1_gas_price.into())?; + let l2_gas_price = resolve_amount_buffer(l2_gas_price, estimated_fee.l2_gas_price.into())?; let l1_data_gas_price = - resolve_amount_buffer(l1_data_gas_price, estimated_fee.l1_data_gas_price)?; + resolve_amount_buffer(l1_data_gas_price, estimated_fee.l1_data_gas_price.into())?; Ok(( MaxFeeType::Estimated { diff --git a/src/subcommands/account/fetch.rs b/src/subcommands/account/fetch.rs index e46a984..683a533 100644 --- a/src/subcommands/account/fetch.rs +++ b/src/subcommands/account/fetch.rs @@ -56,7 +56,7 @@ impl Fetch { let address = Felt::from_hex(&self.address)?; let class_hash = provider - .get_class_hash_at(BlockId::Tag(BlockTag::Pending), address) + .get_class_hash_at(BlockId::Tag(BlockTag::PreConfirmed), address) .await?; let known_class = match KNOWN_ACCOUNT_CLASSES @@ -105,7 +105,7 @@ impl Fetch { entry_point_selector: selector!("getPublicKey"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; @@ -123,7 +123,7 @@ impl Fetch { entry_point_selector: selector!("get_implementation"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; let signer = provider @@ -133,7 +133,7 @@ impl Fetch { entry_point_selector: selector!("getSigner"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; let guardian = provider @@ -143,7 +143,7 @@ impl Fetch { entry_point_selector: selector!("getGuardian"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; @@ -162,7 +162,7 @@ impl Fetch { entry_point_selector: selector!("get_implementation"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; let signers = provider @@ -172,7 +172,7 @@ impl Fetch { entry_point_selector: selector!("get_signers"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?; let multisig = provider @@ -182,7 +182,7 @@ impl Fetch { entry_point_selector: selector!("get_multisig"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; @@ -234,7 +234,7 @@ impl Fetch { entry_point_selector: selector!("get_owner"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; let guardian = provider @@ -244,7 +244,7 @@ impl Fetch { entry_point_selector: selector!("get_guardian"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; @@ -263,7 +263,7 @@ impl Fetch { entry_point_selector: selector!("get_signers"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?; let multisig = provider @@ -273,7 +273,7 @@ impl Fetch { entry_point_selector: selector!("get_multisig_threshold"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; @@ -320,7 +320,7 @@ impl Fetch { entry_point_selector: selector!("get_public_key"), calldata: vec![], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?[0]; diff --git a/src/subcommands/balance.rs b/src/subcommands/balance.rs index e8f0d7c..a3285ab 100644 --- a/src/subcommands/balance.rs +++ b/src/subcommands/balance.rs @@ -58,7 +58,7 @@ impl Balance { entry_point_selector: selector!("balanceOf"), calldata: vec![account_address], }, - BlockId::Tag(BlockTag::Pending), + BlockId::Tag(BlockTag::PreConfirmed), ) .await?; diff --git a/src/subcommands/block_time.rs b/src/subcommands/block_time.rs index a159f1d..e348b9e 100644 --- a/src/subcommands/block_time.rs +++ b/src/subcommands/block_time.rs @@ -2,7 +2,7 @@ use anyhow::Result; use chrono::{TimeZone, Utc}; use clap::Parser; use starknet::{ - core::types::{BlockId, MaybePendingBlockWithTxHashes}, + core::types::{BlockId, MaybePreConfirmedBlockWithTxHashes}, providers::Provider, }; @@ -42,8 +42,8 @@ impl BlockTime { let block = provider.get_block_with_tx_hashes(self.block_id).await?; let timestamp = match block { - MaybePendingBlockWithTxHashes::Block(block) => block.timestamp, - MaybePendingBlockWithTxHashes::PendingBlock(block) => block.timestamp, + MaybePreConfirmedBlockWithTxHashes::Block(block) => block.timestamp, + MaybePreConfirmedBlockWithTxHashes::PreConfirmedBlock(block) => block.timestamp, }; if self.unix { diff --git a/src/subcommands/block_traces.rs b/src/subcommands/block_traces.rs index cff317a..94bf953 100644 --- a/src/subcommands/block_traces.rs +++ b/src/subcommands/block_traces.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::Parser; -use starknet::{core::types::BlockId, providers::Provider}; +use starknet::{core::types::ConfirmedBlockId, providers::Provider}; use crate::{ block_id::BlockIdParser, utils::print_colored_json, verbosity::VerbosityArgs, ProviderArgs, @@ -15,7 +15,7 @@ pub struct BlockTraces { default_value = "latest", help = "Block number, hash, or tag (latest/pending)" )] - block_id: BlockId, + block_id: ConfirmedBlockId, #[clap(flatten)] verbosity: VerbosityArgs, } diff --git a/src/subcommands/class_at.rs b/src/subcommands/class_at.rs index 9da1b09..4a22358 100644 --- a/src/subcommands/class_at.rs +++ b/src/subcommands/class_at.rs @@ -35,7 +35,7 @@ impl ClassAt { // TODO: allow custom block let class = provider - .get_class_at(BlockId::Tag(BlockTag::Pending), address) + .get_class_at(BlockId::Tag(BlockTag::PreConfirmed), address) .await?; if self.parse { diff --git a/src/subcommands/class_by_hash.rs b/src/subcommands/class_by_hash.rs index b02064e..9d0612b 100644 --- a/src/subcommands/class_by_hash.rs +++ b/src/subcommands/class_by_hash.rs @@ -35,7 +35,7 @@ impl ClassByHash { // TODO: allow custom block let class = provider - .get_class(BlockId::Tag(BlockTag::Pending), class_hash) + .get_class(BlockId::Tag(BlockTag::PreConfirmed), class_hash) .await?; if self.parse { diff --git a/src/subcommands/class_hash_at.rs b/src/subcommands/class_hash_at.rs index 0f2952a..40e8b58 100644 --- a/src/subcommands/class_hash_at.rs +++ b/src/subcommands/class_hash_at.rs @@ -26,7 +26,7 @@ impl ClassHashAt { // TODO: allow custom block let class_hash = provider - .get_class_hash_at(BlockId::Tag(BlockTag::Pending), address) + .get_class_hash_at(BlockId::Tag(BlockTag::PreConfirmed), address) .await?; println!("{class_hash:#064x}"); diff --git a/src/subcommands/declare.rs b/src/subcommands/declare.rs index 26277b5..74caa79 100644 --- a/src/subcommands/declare.rs +++ b/src/subcommands/declare.rs @@ -202,8 +202,11 @@ impl Declare { println!( "{} STRK", - format!("{}", felt_to_bigdecimal(estimated_fee, 18)) - .bright_yellow(), + format!( + "{}", + felt_to_bigdecimal(Felt::from(estimated_fee), 18) + ) + .bright_yellow(), ); return Ok(()); } @@ -289,7 +292,7 @@ impl Declare { P: Provider, { match provider - .get_class(BlockId::Tag(BlockTag::Pending), class_hash) + .get_class(BlockId::Tag(BlockTag::PreConfirmed), class_hash) .await { Ok(_) => { diff --git a/src/subcommands/deploy.rs b/src/subcommands/deploy.rs index 6ccebea..df61767 100644 --- a/src/subcommands/deploy.rs +++ b/src/subcommands/deploy.rs @@ -3,7 +3,7 @@ use std::{sync::Arc, time::Duration}; use anyhow::Result; use clap::Parser; use colored::Colorize; -use starknet::{contract::ContractFactory, core::types::Felt, macros::felt, signers::SigningKey}; +use starknet::{contract::ContractFactory, core::types::Felt, signers::SigningKey}; use crate::{ account::AccountArgs, @@ -13,13 +13,9 @@ use crate::{ fee::{FeeArgs, FeeSetting, TokenFeeSetting}, utils::{felt_to_bigdecimal, print_colored_json, watch_tx}, verbosity::VerbosityArgs, - ProviderArgs, + ProviderArgs, UdcArgs, }; -/// The default UDC address: 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf. -const DEFAULT_UDC_ADDRESS: Felt = - felt!("0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"); - #[derive(Debug, Parser)] pub struct Deploy { #[clap(flatten)] @@ -51,6 +47,8 @@ pub struct Deploy { ctor_args: Vec, #[clap(flatten)] verbosity: VerbosityArgs, + #[clap(flatten)] + udc: UdcArgs, } impl Deploy { @@ -79,8 +77,10 @@ impl Deploy { let account = self.account.into_account(provider.clone()).await?; + let udc = self.udc.try_into()?; + // TODO: allow custom UDC - let factory = ContractFactory::new_with_udc(class_hash, account, DEFAULT_UDC_ADDRESS); + let factory = ContractFactory::new_with_udc(class_hash, account, udc); let deployed_address = factory .deploy_v3(ctor_args.clone(), salt, !self.not_unique) @@ -116,7 +116,8 @@ impl Deploy { eprintln!( "{} STRK", - format!("{}", felt_to_bigdecimal(estimated_fee, 18)).bright_yellow(), + format!("{}", felt_to_bigdecimal(Felt::from(estimated_fee), 18)) + .bright_yellow(), ); return Ok(()); } diff --git a/src/subcommands/invoke.rs b/src/subcommands/invoke.rs index 2f0b35e..9f4ba24 100644 --- a/src/subcommands/invoke.rs +++ b/src/subcommands/invoke.rs @@ -119,8 +119,11 @@ impl Invoke { println!( "{} STRK", - format!("{}", felt_to_bigdecimal(estimated_fee.overall_fee, 18)) - .bright_yellow(), + format!( + "{}", + felt_to_bigdecimal(Felt::from(estimated_fee.overall_fee), 18) + ) + .bright_yellow(), ); return Ok(()); } diff --git a/src/subcommands/nonce.rs b/src/subcommands/nonce.rs index b8321ac..98c7d8a 100644 --- a/src/subcommands/nonce.rs +++ b/src/subcommands/nonce.rs @@ -26,7 +26,7 @@ impl Nonce { // TODO: allow custom block let nonce = provider - .get_nonce(BlockId::Tag(BlockTag::Pending), address) + .get_nonce(BlockId::Tag(BlockTag::PreConfirmed), address) .await?; println!("{nonce}"); diff --git a/src/subcommands/signer/ledger/app_version.rs b/src/subcommands/signer/ledger/app_version.rs index ee15066..cd114f8 100644 --- a/src/subcommands/signer/ledger/app_version.rs +++ b/src/subcommands/signer/ledger/app_version.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::Parser; +use coins_ledger::transports::Ledger; use starknet::signers::ledger::LedgerStarknetApp; #[derive(Debug, Parser)] @@ -7,7 +8,7 @@ pub struct AppVersion; impl AppVersion { pub async fn run(self) -> Result<()> { - let ledger = LedgerStarknetApp::new().await?; + let ledger = LedgerStarknetApp::::new().await?; let version = ledger.get_version().await?; println!("{version}"); diff --git a/src/subcommands/signer/ledger/get_public_key.rs b/src/subcommands/signer/ledger/get_public_key.rs index ef26936..15a5fae 100644 --- a/src/subcommands/signer/ledger/get_public_key.rs +++ b/src/subcommands/signer/ledger/get_public_key.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::Parser; +use coins_ledger::transports::Ledger; use starknet::signers::{ledger::LedgerStarknetApp, DerivationPath}; use crate::hd_path::DerivationPathParser; @@ -21,7 +22,7 @@ pub struct GetPublicKey { impl GetPublicKey { pub async fn run(self) -> Result<()> { - let ledger = LedgerStarknetApp::new().await?; + let ledger = LedgerStarknetApp::::new().await?; if !self.no_display { eprintln!("Please confirm the public key on your Ledger"); diff --git a/src/subcommands/signer/ledger/sign_hash.rs b/src/subcommands/signer/ledger/sign_hash.rs index 2ab0ce5..57d4dd6 100644 --- a/src/subcommands/signer/ledger/sign_hash.rs +++ b/src/subcommands/signer/ledger/sign_hash.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::Parser; +use coins_ledger::transports::Ledger; use colored::Colorize; use starknet::{ core::types::Felt, @@ -33,7 +34,7 @@ impl SignHash { .bright_magenta() ); - let ledger = LedgerStarknetApp::new().await?; + let ledger = LedgerStarknetApp::::new().await?; eprintln!("Please confirm the signing operation on your Ledger"); diff --git a/src/udc.rs b/src/udc.rs new file mode 100644 index 0000000..0ea7975 --- /dev/null +++ b/src/udc.rs @@ -0,0 +1,56 @@ +use anyhow::Result; +use clap::Parser; +use starknet::{contract::UdcSelector, core::types::Felt}; +use thiserror::Error; + +/// Universal Deployer Contract (UDC) selection arguments. +/// +/// The Universal Deployer Contract is a standardized contract that allows deploying +/// any contract class to a deterministic address based on the class hash and salt. +#[derive(Debug, Clone, Parser)] +pub struct UdcArgs { + /// Universal Deployer Contract to use for deployment. + /// + /// Options: + /// - `legacy`: The original UDC at 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf (deprecated) + /// - `new`: The latest UDC at 0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125 (recommended) + /// - `
`: Use a custom UDC contract address (must start with 0x) + /// + /// Examples: + /// - `--udc new` (recommended) + /// - `--udc legacy` (for compatibility) + /// - `--udc 0x1234...` (for custom deployments) + #[clap( + long, + default_value = "new", + help = "Universal Deployer Contract to use for deployment. Options: 'legacy', 'new', or a hex address starting with `0x`." + )] + pub udc: String, +} + +#[derive(Error, Debug)] +pub enum UdcError { + #[error( + "Invalid UDC option '{0}'. Must be 'legacy', 'new', or a hex address starting with 0x" + )] + InvalidUdc(String), +} + +/// Attempts to convert the UDC arguments to a starknet-rs [`UdcSelector`]. +impl TryFrom for UdcSelector { + type Error = UdcError; + + fn try_from(value: UdcArgs) -> Result { + if value.udc == "legacy" { + Ok(UdcSelector::Legacy) + } else if value.udc == "new" { + Ok(UdcSelector::New) + } else if value.udc.starts_with("0x") { + let address = + Felt::from_hex(&value.udc).map_err(|_| UdcError::InvalidUdc(value.udc))?; + Ok(UdcSelector::Custom(address)) + } else { + Err(UdcError::InvalidUdc(value.udc)) + } + } +} From fa1225bedc5329908540ada9b5642f7d1c862635 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 6 Oct 2025 20:46:29 -0600 Subject: [PATCH 2/3] fix: rename pending to preconfirmed --- src/block_id.rs | 2 +- src/subcommands/block.rs | 2 +- src/subcommands/block_time.rs | 2 +- src/subcommands/block_traces.rs | 2 +- src/subcommands/call.rs | 4 ++-- src/subcommands/chain_id.rs | 2 +- src/subcommands/state_update.rs | 2 +- src/subcommands/storage.rs | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/block_id.rs b/src/block_id.rs index b49d71e..52ef812 100644 --- a/src/block_id.rs +++ b/src/block_id.rs @@ -23,7 +23,7 @@ impl TypedValueParser for BlockIdParser { if value == "latest" { Ok(BlockId::Tag(BlockTag::Latest)) - } else if value == "pending" || value == "preconfirmed" { + } else if value == "preconfirmed" { Ok(BlockId::Tag(BlockTag::PreConfirmed)) } else if regex_block_number.is_match(value) { Ok(BlockId::Number(value.parse::().map_err(|err| { diff --git a/src/subcommands/block.rs b/src/subcommands/block.rs index 4448e5b..8702a9b 100644 --- a/src/subcommands/block.rs +++ b/src/subcommands/block.rs @@ -17,7 +17,7 @@ pub struct Block { #[clap( value_parser = BlockIdParser, default_value = "latest", - help = "Block number, hash, or tag (latest/pending)" + help = "Block number, hash, or tag (latest/preconfirmed)" )] block_id: BlockId, #[clap(flatten)] diff --git a/src/subcommands/block_time.rs b/src/subcommands/block_time.rs index e348b9e..75bdfa7 100644 --- a/src/subcommands/block_time.rs +++ b/src/subcommands/block_time.rs @@ -27,7 +27,7 @@ pub struct BlockTime { #[clap( value_parser = BlockIdParser, default_value = "latest", - help = "Block number, hash, or tag (latest/pending)" + help = "Block number, hash, or tag (latest/preconfirmed)" )] block_id: BlockId, #[clap(flatten)] diff --git a/src/subcommands/block_traces.rs b/src/subcommands/block_traces.rs index 94bf953..21ce6bc 100644 --- a/src/subcommands/block_traces.rs +++ b/src/subcommands/block_traces.rs @@ -13,7 +13,7 @@ pub struct BlockTraces { #[clap( value_parser = BlockIdParser, default_value = "latest", - help = "Block number, hash, or tag (latest/pending)" + help = "Block number, hash, or tag (latest/preconfirmed)" )] block_id: ConfirmedBlockId, #[clap(flatten)] diff --git a/src/subcommands/call.rs b/src/subcommands/call.rs index 14e83c4..c1c494b 100644 --- a/src/subcommands/call.rs +++ b/src/subcommands/call.rs @@ -19,8 +19,8 @@ pub struct Call { #[clap( long, value_parser = BlockIdParser, - default_value = "pending", - help = "Block number, hash, or tag (latest/pending)" + default_value = "preconfirmed", + help = "Block number, hash, or tag (latest/preconfirmed)" )] block: BlockId, #[clap(help = "Contract address")] diff --git a/src/subcommands/chain_id.rs b/src/subcommands/chain_id.rs index 076d4cc..03c83bb 100644 --- a/src/subcommands/chain_id.rs +++ b/src/subcommands/chain_id.rs @@ -17,7 +17,7 @@ pub struct ChainId { dec: bool, #[clap( default_value = "latest", - help = "Block number, hash, or tag (latest/pending)" + help = "Block number, hash, or tag (latest/preconfirmed)" )] block_id: String, #[clap(flatten)] diff --git a/src/subcommands/state_update.rs b/src/subcommands/state_update.rs index 9854a15..ae497f5 100644 --- a/src/subcommands/state_update.rs +++ b/src/subcommands/state_update.rs @@ -13,7 +13,7 @@ pub struct StateUpdate { #[clap( value_parser = BlockIdParser, default_value = "latest", - help = "Block number, hash, or tag (latest/pending)" + help = "Block number, hash, or tag (latest/preconfirmed)" )] block_id: BlockId, #[clap(flatten)] diff --git a/src/subcommands/storage.rs b/src/subcommands/storage.rs index 493d36b..9317a27 100644 --- a/src/subcommands/storage.rs +++ b/src/subcommands/storage.rs @@ -16,8 +16,8 @@ pub struct Storage { #[clap( long, value_parser = BlockIdParser, - default_value = "pending", - help = "Block number, hash, or tag (latest/pending)" + default_value = "preconfirmed", + help = "Block number, hash, or tag (latest/preconfirmed)" )] block: BlockId, #[clap(help = "Contract address")] From 1d3681e8a76aaf0bfc54c4e0a15fc169cb7dadf3 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 6 Oct 2025 20:50:36 -0600 Subject: [PATCH 3/3] fix: shorten the UDC help --- src/udc.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/udc.rs b/src/udc.rs index 0ea7975..4418405 100644 --- a/src/udc.rs +++ b/src/udc.rs @@ -9,22 +9,8 @@ use thiserror::Error; /// any contract class to a deterministic address based on the class hash and salt. #[derive(Debug, Clone, Parser)] pub struct UdcArgs { - /// Universal Deployer Contract to use for deployment. - /// - /// Options: - /// - `legacy`: The original UDC at 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf (deprecated) - /// - `new`: The latest UDC at 0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125 (recommended) - /// - `
`: Use a custom UDC contract address (must start with 0x) - /// - /// Examples: - /// - `--udc new` (recommended) - /// - `--udc legacy` (for compatibility) - /// - `--udc 0x1234...` (for custom deployments) - #[clap( - long, - default_value = "new", - help = "Universal Deployer Contract to use for deployment. Options: 'legacy', 'new', or a hex address starting with `0x`." - )] + /// Universal Deployer Contract to use for deployment. Options: 'legacy' (deprecated), 'new' (recommended), or hex address starting with 0x. + #[clap(long, default_value = "new")] pub udc: String, }