From 1bddaedb9554c9e9a8dd9c5873ca3d4615633f3e Mon Sep 17 00:00:00 2001 From: FroVolod Date: Thu, 14 Sep 2023 21:11:30 +0300 Subject: [PATCH 01/15] start --- Cargo.lock | 2601 ++++++++++++++++++++++++++++++++++++----- cargo-near/Cargo.toml | 14 +- 2 files changed, 2347 insertions(+), 268 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d98527d3..e1908924 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" dependencies = [ "actix-rt", "actix_derive", - "bitflags", + "bitflags 1.3.2", "bytes", "crossbeam-channel", "futures-core", @@ -23,7 +23,7 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", - "tokio-util", + "tokio-util 0.7.3", ] [[package]] @@ -44,7 +44,7 @@ checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -97,12 +97,69 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" +[[package]] +name = "arbitrary" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -123,9 +180,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "async-channel" -version = "1.7.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -134,47 +191,78 @@ dependencies = [ [[package]] name = "async-io" -version = "1.8.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab006897723d9352f63e2b13047177c3982d8d79709d713ce7747a8f19fd1b0" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ + "async-lock", "autocfg", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite", - "libc", "log", - "once_cell", "parking", "polling", + "rustix 0.37.20", "slab", "socket2", "waker-fn", - "winapi", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", ] [[package]] name = "async-process" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" dependencies = [ "async-io", + "async-lock", "autocfg", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", - "libc", - "once_cell", + "rustix 0.37.20", "signal-hook", - "winapi", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", ] [[package]] name = "async-task" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" @@ -184,14 +272,14 @@ checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atty" @@ -237,6 +325,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + [[package]] name = "binary-install" version = "0.0.2" @@ -254,12 +348,37 @@ dependencies = [ "zip", ] +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.3", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "0.20.4" @@ -290,7 +409,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ - "crypto-mac", + "crypto-mac 0.8.0", "digest 0.9.0", "opaque-debug", ] @@ -326,16 +445,17 @@ dependencies = [ [[package]] name = "blocking" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ "async-channel", + "async-lock", "async-task", "atomic-waker", "fastrand", "futures-lite", - "once_cell", + "log", ] [[package]] @@ -344,21 +464,44 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" dependencies = [ - "borsh-derive", + "borsh-derive 0.9.3", "hashbrown 0.11.2", ] +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.12.3", +] + [[package]] name = "borsh-derive" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.99", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", "proc-macro2", - "syn", + "syn 1.0.99", ] [[package]] @@ -369,7 +512,18 @@ checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", ] [[package]] @@ -380,7 +534,18 @@ checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", ] [[package]] @@ -398,6 +563,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.11.0" @@ -406,9 +580,9 @@ checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byte-slice-cast" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" @@ -427,6 +601,9 @@ name = "bytesize" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" +dependencies = [ + "serde", +] [[package]] name = "bzip2" @@ -459,12 +636,6 @@ dependencies = [ "ppv-lite86", ] -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - [[package]] name = "camino" version = "1.1.1" @@ -480,19 +651,28 @@ version = "0.3.1" dependencies = [ "anyhow", "atty", - "bs58", + "bs58 0.4.0", "camino", "cargo_metadata", "clap", + "color-eyre", "colored", + "derive_more", "env_logger", + "inquire", + "interactive-clap", + "interactive-clap-derive", "libloading", "log", "near-abi", + "near-cli-rs", "rustc_version", "schemars", "serde_json", "sha2 0.10.3", + "shell-words", + "strum", + "strum_macros", "symbolic-debuginfo", "zstd", ] @@ -502,7 +682,7 @@ name = "cargo-near-integration-tests" version = "0.1.0" dependencies = [ "anyhow", - "borsh", + "borsh 0.9.3", "camino", "cargo-near", "clap", @@ -516,7 +696,7 @@ dependencies = [ "quote", "schemars", "serde_json", - "syn", + "syn 1.0.99", "tempfile", "tokio", "workspaces", @@ -532,6 +712,28 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a51c783163bdf4549820b80968d386c94ed45ed23819c93f59cca7ebd97fe0eb" +dependencies = [ + "anyhow", + "core-foundation", + "crypto-hash", + "filetime", + "hex 0.4.3", + "jobserver", + "libc", + "log", + "miow", + "same-file", + "shell-escape", + "tempfile", + "walkdir", + "winapi", +] + [[package]] name = "cargo_metadata" version = "0.14.2" @@ -577,7 +779,7 @@ dependencies = [ "js-sys", "num-traits", "serde", - "time", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -593,43 +795,77 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.19" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68d43934757334b5c0519ff882e1ab9647ac0258b47c24c4f490d78e42697fd5" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "indexmap", - "once_cell", "strsim", - "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ - "heck", - "proc-macro-error", + "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "color-eyre" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" dependencies = [ - "os_str_bytes", + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "colored" version = "2.0.0" @@ -641,29 +877,60 @@ dependencies = [ "winapi", ] +[[package]] +name = "commoncrypto" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" +dependencies = [ + "commoncrypto-sys", +] + +[[package]] +name = "commoncrypto-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" +dependencies = [ + "libc", +] + [[package]] name = "concurrent-queue" -version = "1.2.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ - "cache-padded", + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode 0.3.6", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", ] [[package]] name = "const_format" -version = "0.2.30" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7309d9b4d3d2c0641e018d449232f2e28f1b22933c137f157d3dbc14228b8c0e" +checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.29" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f47bf7270cf70d370f8f98c1abb6d2d4cf60a6845d30e05bfb90c6568650" +checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" dependencies = [ "proc-macro2", "quote", @@ -736,6 +1003,31 @@ dependencies = [ "once_cell", ] +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -752,6 +1044,18 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-hash" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" +dependencies = [ + "commoncrypto", + "hex 0.3.2", + "openssl", + "winapi", +] + [[package]] name = "crypto-mac" version = "0.8.0" @@ -763,27 +1067,58 @@ dependencies = [ ] [[package]] -name = "curl" -version = "0.4.44" +name = "crypto-mac" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca" dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2", - "winapi", + "generic-array", + "subtle", ] [[package]] -name = "curl-sys" -version = "0.4.56+curl-7.83.1" +name = "csv" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093e169dd4de29e468fa649fbae11cdcd5551c81fe5bf1b0677adad7ef3d26f" +checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" dependencies = [ - "cc", + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.65+curl-8.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" +dependencies = [ + "cc", "libc", "libz-sys", "openssl-sys", @@ -805,13 +1140,68 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.32", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.32", +] + [[package]] name = "debugid" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" dependencies = [ - "uuid", + "uuid 0.8.2", +] + +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", ] [[package]] @@ -824,7 +1214,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.99", ] [[package]] @@ -863,7 +1253,26 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] @@ -877,12 +1286,41 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.4.3", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users 0.4.3", + "winapi", +] + [[package]] name = "dmsort" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "dyn-clone" version = "1.0.9" @@ -895,6 +1333,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" +[[package]] +name = "easy-ext" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49457524c7e65648794c98283282a0b7c73b10018e7091f1cdcfff314fd7ae59" + [[package]] name = "ed25519" version = "1.5.2" @@ -918,6 +1362,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + [[package]] name = "elementtree" version = "0.7.0" @@ -928,6 +1378,18 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "encoding_rs" version = "0.8.31" @@ -937,6 +1399,26 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "enum-map" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "env_logger" version = "0.9.0" @@ -950,6 +1432,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -977,6 +1465,16 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "failure" version = "0.1.8" @@ -995,7 +1493,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", "synstructure", ] @@ -1038,6 +1536,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.24" @@ -1079,6 +1583,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "function_name" version = "0.3.0" @@ -1106,32 +1620,59 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "fastrand", "futures-core", @@ -1142,28 +1683,45 @@ dependencies = [ "waker-fn", ] +[[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.32", +] + [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", ] [[package]] @@ -1214,7 +1772,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "libgit2-sys", "log", @@ -1246,10 +1804,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.1", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.3", "tracing", ] @@ -1267,6 +1825,24 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "heck" @@ -1300,16 +1876,41 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] -name = "home" -version = "0.5.3" +name = "hidapi" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" +checksum = "798154e4b6570af74899d71155fb0072d5b17e6aa12f39c8ef22c60fb8ec99e7" dependencies = [ + "cc", + "libc", + "pkg-config", "winapi", ] +[[package]] +name = "hmac" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff" +dependencies = [ + "crypto-mac 0.9.1", + "digest 0.9.0", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "http" version = "0.2.8" @@ -1352,9 +1953,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1374,6 +1975,18 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -1401,6 +2014,12 @@ dependencies = [ "winapi", ] +[[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.2.3" @@ -1429,7 +2048,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -1438,6 +2057,12 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.9.1" @@ -1446,34 +2071,128 @@ checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] -name = "instant" -version = "0.1.12" +name = "indexmap" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "cfg-if 1.0.0", + "equivalent", + "hashbrown 0.14.0", + "serde", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "indicatif" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", ] [[package]] -name = "ipnet" +name = "inquire" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33e7c1ddeb15c9abcbfef6029d8e29f69b52b6d6c891031b88ed91b5065803b" +dependencies = [ + "bitflags 1.3.2", + "crossterm", + "dyn-clone", + "lazy_static", + "newline-converter", + "thiserror", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "interactive-clap" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9a4460797bc616e3256b1becad15e859c4f8d63a8a379c87fdcb1734206cf0a" +dependencies = [ + "interactive-clap-derive", + "strum", + "strum_macros", +] + +[[package]] +name = "interactive-clap-derive" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4d0f6a898a8dc1bcea5b00552c5a3fa3f64a2634f84b854390269238abdc9ed" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.1", + "rustix 0.38.3", + "windows-sys 0.48.0", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "is_executable" version = "0.1.2" @@ -1483,6 +2202,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.3" @@ -1513,6 +2241,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json_comments" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ee439ee368ba4a77ac70d04f14015415af8600d6c894dc1f11bd79758c57d5" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1525,6 +2259,43 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "ledger-apdu" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe435806c197dfeaa5efcded5e623c4b8230fd28fdf1e91e7a86e40ef2acbf90" +dependencies = [ + "arrayref", + "no-std-compat", + "snafu", +] + +[[package]] +name = "ledger-transport" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1117f2143d92c157197785bf57711d7b02f2cfa101e162f8ca7900fb7f976321" +dependencies = [ + "async-trait", + "ledger-apdu", +] + +[[package]] +name = "ledger-transport-hid" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ba81a1f5f24396b37211478aff7fbcd605dd4544df8dbed07b9da3c2057aee" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "hex 0.4.3", + "hidapi", + "ledger-transport", + "libc", + "log", + "thiserror", +] + [[package]] name = "libc" version = "0.2.146" @@ -1571,9 +2342,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "libc", @@ -1581,12 +2352,27 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +dependencies = [ + "serde", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + [[package]] name = "lock_api" version = "0.4.8" @@ -1606,6 +2392,15 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + [[package]] name = "matches" version = "0.1.9" @@ -1666,6 +2461,21 @@ dependencies = [ "windows-sys 0.36.1", ] +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "native-tls" version = "0.2.10" @@ -1690,7 +2500,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" dependencies = [ - "borsh", + "borsh 0.9.3", "schemars", "semver", "serde", @@ -1702,7 +2512,27 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" dependencies = [ - "borsh", + "borsh 0.9.3", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d924011380de759c3dc6fdbcda37a19a5c061f56dab69d28a34ecee765e23e4" +dependencies = [ + "borsh 0.9.3", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0cb40869cab7f5232f934f45db35bffe0f2d2a7cb0cd0346202fbe4ebf2dd7" +dependencies = [ + "borsh 0.10.3", "serde", ] @@ -1715,13 +2545,54 @@ dependencies = [ "anyhow", "chrono", "derive_more", - "near-crypto", - "near-primitives", + "near-crypto 0.14.0", + "near-primitives 0.14.0", "num-rational", "serde", "serde_json", "sha2 0.10.3", - "smart-default", + "smart-default 0.6.0", + "tracing", +] + +[[package]] +name = "near-chain-configs" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1faf676a95bd1718b06e5957e01a9415fedf7900f32d94d5bcf70abd678b10a2" +dependencies = [ + "anyhow", + "chrono", + "derive_more", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "num-rational", + "serde", + "serde_json", + "sha2 0.10.3", + "smart-default 0.6.0", + "tracing", +] + +[[package]] +name = "near-chain-configs" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f9a1c805846237d56f99b328ba6ab77e5d43ef59aaaf8d2a41d42fdc708a7b" +dependencies = [ + "anyhow", + "chrono", + "derive_more", + "near-config-utils", + "near-crypto 0.17.0", + "near-o11y", + "near-primitives 0.17.0", + "num-rational", + "once_cell", + "serde", + "serde_json", + "sha2 0.10.3", + "smart-default 0.6.0", "tracing", ] @@ -1732,8 +2603,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a734353027698b21633a49d478e564c61ae0171c32f6912bb8844add15d72ebe" dependencies = [ "chrono", - "near-crypto", - "near-primitives", + "near-crypto 0.14.0", + "near-primitives 0.14.0", "thiserror", "tracing", ] @@ -1745,7 +2616,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17f6f22f1ab710731dfba4101f12a99cac120d6af80b99899bd335bb8971477" dependencies = [ "near-chain-primitives", - "near-primitives", + "near-primitives 0.14.0", +] + +[[package]] +name = "near-cli-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea25dbad109b5f1be55b4c5aa4a062f59b3a9cd1a047aed2000a6773ac24518" +dependencies = [ + "bip39", + "bs58 0.5.0", + "bytesize", + "cargo-util", + "clap", + "color-eyre", + "derive_more", + "dirs 5.0.1", + "easy-ext 1.0.1", + "ed25519-dalek", + "futures", + "hex 0.4.3", + "inquire", + "interactive-clap", + "interactive-clap-derive", + "linked-hash-map", + "near-crypto 0.17.0", + "near-jsonrpc-client 0.6.0", + "near-jsonrpc-primitives 0.17.0", + "near-ledger", + "near-primitives 0.17.0", + "open", + "openssl", + "prettytable", + "reqwest", + "security-framework", + "self_update", + "semver", + "serde", + "serde_json", + "shell-words", + "shellexpand", + "slip10", + "smart-default 0.7.1", + "strum", + "strum_macros", + "thiserror", + "tokio", + "toml 0.7.8", + "url", ] [[package]] @@ -1756,18 +2675,30 @@ checksum = "e1065d86012eeea838661434549f33bb6267c9950fd2aadd2af617fe773def38" dependencies = [ "actix", "chrono", - "near-chain-configs", + "near-chain-configs 0.14.0", "near-chain-primitives", "near-chunks-primitives", - "near-crypto", + "near-crypto 0.14.0", "near-network-primitives", - "near-primitives", + "near-primitives 0.14.0", "serde", "serde_json", "strum", "thiserror", ] +[[package]] +name = "near-config-utils" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5523e7dce493c45bc3241eb3100d943ec471852f9b1f84b46a34789eadf17031" +dependencies = [ + "anyhow", + "json_comments", + "thiserror", + "tracing", +] + [[package]] name = "near-crypto" version = "0.14.0" @@ -1776,13 +2707,13 @@ checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" dependencies = [ "arrayref", "blake2", - "borsh", - "bs58", + "borsh 0.9.3", + "bs58 0.4.0", "c2-chacha", "curve25519-dalek", "derive_more", "ed25519-dalek", - "near-account-id", + "near-account-id 0.14.0", "once_cell", "parity-secp256k1", "primitive-types", @@ -1794,24 +2725,104 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-crypto" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7754612b47737d277fb818e9fdbb1406e90f9e57151c55c3584d714421976cb6" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58 0.4.0", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "near-account-id 0.15.0", + "once_cell", + "primitive-types", + "rand 0.7.3", + "secp256k1 0.24.3", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-crypto" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6b382b626e7e0cd372d027c6672ac97b4b6ee6114288c9e58d8180b935d315" +dependencies = [ + "blake2", + "borsh 0.10.3", + "bs58 0.4.0", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "hex 0.4.3", + "near-account-id 0.17.0", + "near-config-utils", + "near-stdx", + "once_cell", + "primitive-types", + "rand 0.7.3", + "secp256k1 0.27.0", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-fmt" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44c842c6cfcd9b8c387cccd4cd0619a5f21920cde5d5c292af3cc5d40510672" +dependencies = [ + "near-primitives-core 0.17.0", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1335ffce1476da6516dcd22b26cece1a495fc725c0e8fec1879073752ac068d" +dependencies = [ + "borsh 0.9.3", + "lazy_static", + "log", + "near-chain-configs 0.15.0", + "near-crypto 0.15.0", + "near-jsonrpc-primitives 0.15.0", + "near-primitives 0.15.0", + "reqwest", + "serde", + "serde_json", + "thiserror", + "uuid 1.4.1", +] + [[package]] name = "near-jsonrpc-client" -version = "0.4.0-beta.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bba462f54bc35289a1013ed3a2ebfa67cc8b12699f81c12dd67687f200c7b871" +checksum = "118f44c02ad211db805c1370ad3ff26576af6ff554093c9fece1b835d29d233a" dependencies = [ - "borsh", + "borsh 0.10.3", "lazy_static", "log", - "near-chain-configs", - "near-crypto", - "near-jsonrpc-primitives", - "near-primitives", + "near-chain-configs 0.17.0", + "near-crypto 0.17.0", + "near-jsonrpc-primitives 0.17.0", + "near-primitives 0.17.0", "reqwest", "serde", "serde_json", "thiserror", - "uuid", ] [[package]] @@ -1820,15 +2831,59 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34a14ee8ca393c0140cb232789259ebc61b13b4cceb177267d0131f50d0eda6c" dependencies = [ - "near-chain-configs", + "near-chain-configs 0.14.0", "near-client-primitives", - "near-crypto", - "near-primitives", - "near-rpc-error-macro", + "near-crypto 0.14.0", + "near-primitives 0.14.0", + "near-rpc-error-macro 0.14.0", + "serde", + "serde_json", + "thiserror", + "uuid 0.8.2", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada226c74f05508c516f109a97b9f23335120d0bfda208f0d187b6bbfe6eef5a" +dependencies = [ + "near-chain-configs 0.15.0", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "near-rpc-error-macro 0.15.0", "serde", "serde_json", "thiserror", - "uuid", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b2934b5ab243e25e951c984525ba0aff0e719ed915c988c5195405aa0f6987" +dependencies = [ + "arbitrary", + "near-chain-configs 0.17.0", + "near-crypto 0.17.0", + "near-primitives 0.17.0", + "near-rpc-error-macro 0.17.0", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "near-ledger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edfdfadf4d772ea67c11d69cdbc8b8f0e0742d88c3baac64bdcf21482f7c950" +dependencies = [ + "ed25519-dalek", + "ledger-apdu", + "ledger-transport", + "ledger-transport-hid", + "slip10", ] [[package]] @@ -1839,33 +2894,89 @@ checksum = "5aa998a1e70ebf8cf3efa76c4562ef36038cc88b4aee60efb708d14273910357" dependencies = [ "actix", "anyhow", - "borsh", + "borsh 0.9.3", "chrono", - "near-crypto", - "near-primitives", + "near-crypto 0.14.0", + "near-primitives 0.14.0", "serde", "strum", "tokio", "tracing", ] +[[package]] +name = "near-o11y" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7d35397b02b131c188c72f3885e97daeccab134ec2fc8cc0073a94cf1cfe19" +dependencies = [ + "actix", + "atty", + "clap", + "near-crypto 0.17.0", + "near-primitives-core 0.17.0", + "once_cell", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "prometheus", + "serde", + "strum", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-opentelemetry", + "tracing-subscriber", +] + [[package]] name = "near-primitives" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" dependencies = [ - "borsh", + "borsh 0.9.3", + "byteorder", + "bytesize", + "chrono", + "derive_more", + "easy-ext 0.2.9", + "hex 0.4.3", + "near-crypto 0.14.0", + "near-primitives-core 0.14.0", + "near-rpc-error-macro 0.14.0", + "near-vm-errors 0.14.0", + "num-rational", + "once_cell", + "primitive-types", + "rand 0.7.3", + "reed-solomon-erasure", + "serde", + "serde_json", + "smart-default 0.6.0", + "strum", + "thiserror", +] + +[[package]] +name = "near-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97670b302dce15f09bba50f24c67aa08130fd01528cc61d4415892401e88e974" +dependencies = [ + "borsh 0.9.3", "byteorder", "bytesize", + "cfg-if 1.0.0", "chrono", "derive_more", - "easy-ext", + "easy-ext 0.2.9", "hex 0.4.3", - "near-crypto", - "near-primitives-core", - "near-rpc-error-macro", - "near-vm-errors", + "near-crypto 0.15.0", + "near-primitives-core 0.15.0", + "near-rpc-error-macro 0.15.0", + "near-vm-errors 0.15.0", "num-rational", "once_cell", "primitive-types", @@ -1873,11 +2984,48 @@ dependencies = [ "reed-solomon-erasure", "serde", "serde_json", - "smart-default", + "smart-default 0.6.0", "strum", "thiserror", ] +[[package]] +name = "near-primitives" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f7051aaf199adc4d068620fca6d5f70f906a1540d03a8bb3701271f8881835" +dependencies = [ + "arbitrary", + "borsh 0.10.3", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext 0.2.9", + "enum-map", + "hex 0.4.3", + "near-crypto 0.17.0", + "near-fmt", + "near-primitives-core 0.17.0", + "near-rpc-error-macro 0.17.0", + "near-stdx", + "near-vm-errors 0.17.0", + "num-rational", + "once_cell", + "primitive-types", + "rand 0.8.5", + "reed-solomon-erasure", + "serde", + "serde_json", + "serde_with", + "serde_yaml", + "smart-default 0.6.0", + "strum", + "thiserror", + "time 0.3.28", + "tracing", +] + [[package]] name = "near-primitives-core" version = "0.14.0" @@ -1885,14 +3033,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" dependencies = [ "base64 0.11.0", - "borsh", - "bs58", + "borsh 0.9.3", + "bs58 0.4.0", + "derive_more", + "near-account-id 0.14.0", + "num-rational", + "serde", + "sha2 0.10.3", + "strum", +] + +[[package]] +name = "near-primitives-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7929e19d862221949734c4a0063a8f55e7069de3a2ebc2d4f4c13497a5e953cb" +dependencies = [ + "base64 0.13.0", + "borsh 0.9.3", + "bs58 0.4.0", + "derive_more", + "near-account-id 0.15.0", + "num-rational", + "serde", + "serde_repr", + "sha2 0.10.3", + "strum", +] + +[[package]] +name = "near-primitives-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775fec19ef51a341abdbf792a9dda5b4cb89f488f681b2fd689b9321d24db47b" +dependencies = [ + "arbitrary", + "base64 0.21.4", + "borsh 0.10.3", + "bs58 0.4.0", "derive_more", - "near-account-id", + "enum-map", + "near-account-id 0.17.0", "num-rational", "serde", + "serde_repr", + "serde_with", "sha2 0.10.3", "strum", + "thiserror", ] [[package]] @@ -1903,7 +3091,29 @@ checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" dependencies = [ "quote", "serde", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36addf90cc04bd547a627b3a292f59d7de4dd6fb5042115419ae901b93ce6c2d" +dependencies = [ + "quote", + "serde", + "syn 1.0.99", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" +dependencies = [ + "quote", + "serde", + "syn 2.0.32", ] [[package]] @@ -1912,9 +3122,32 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" dependencies = [ - "near-rpc-error-core", + "near-rpc-error-core 0.14.0", + "serde", + "syn 1.0.99", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5beb352f3b91d8c491646c2fa4fdbbbf463c7b9c0226951c28f0197de44f99" +dependencies = [ + "near-rpc-error-core 0.15.0", "serde", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d2dadd765101c77e664029dd6fbec090e696877d4ae903c620d02ceda4969a" +dependencies = [ + "fs2", + "near-rpc-error-core 0.17.0", + "serde", + "syn 2.0.32", ] [[package]] @@ -1931,24 +3164,72 @@ dependencies = [ "home", ] +[[package]] +name = "near-stdx" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6540152fba5e96fe5d575b79e8cd244cf2add747bb01362426bdc069bc3a23bc" + [[package]] name = "near-vm-errors" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" dependencies = [ - "borsh", - "near-account-id", - "near-rpc-error-macro", + "borsh 0.9.3", + "near-account-id 0.14.0", + "near-rpc-error-macro 0.14.0", "serde", ] +[[package]] +name = "near-vm-errors" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5591c9c8afa83a040cb5c3f29bc52b2efae2c32d4bcaee1bba723738da1a5cf6" +dependencies = [ + "borsh 0.9.3", + "near-account-id 0.15.0", + "near-rpc-error-macro 0.15.0", + "serde", + "strum", +] + +[[package]] +name = "near-vm-errors" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec545d1bede0579e7c15dd2dce9b998dc975c52f2165702ff40bec7ff69728bb" +dependencies = [ + "borsh 0.10.3", + "near-account-id 0.17.0", + "near-rpc-error-macro 0.17.0", + "serde", + "strum", + "thiserror", +] + [[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "newline-converter" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f71d09d5c87634207f894c6b31b6a2b2c64ea3bdcf71bd5599fdbbe1600c00f" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nom" version = "7.1.1" @@ -1972,6 +3253,16 @@ dependencies = [ "nom", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.3.3" @@ -2025,6 +3316,12 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" version = "0.29.0" @@ -2036,9 +3333,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -2046,13 +3343,24 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "openssl" version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "foreign-types", "libc", @@ -2069,7 +3377,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2078,6 +3386,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.25.0+1.1.1t" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.90" @@ -2086,15 +3403,76 @@ checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] [[package]] -name = "os_str_bytes" -version = "6.3.0" +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "opentelemetry-otlp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1a6ca9de4c8b00aa7f1a153bd76cb263287155cec642680d79d98706f3d28a" +dependencies = [ + "async-trait", + "futures", + "futures-util", + "http", + "opentelemetry", + "prost", + "thiserror", + "tokio", + "tonic", + "tonic-build", +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985cc35d832d412224b2cffe2f9194b1b89b6aa5d0bef76d080dce09d90e62bd" +dependencies = [ + "opentelemetry", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parity-scale-codec" @@ -2116,10 +3494,10 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ - "proc-macro-crate 1.2.1", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2136,9 +3514,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -2163,6 +3541,12 @@ dependencies = [ "windows-sys 0.36.1", ] +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "pdb" version = "0.7.0" @@ -2171,7 +3555,7 @@ checksum = "13f4d162ecaaa1467de5afbe62d597757b674b51da8bb4e587430c5fdb2af7aa" dependencies = [ "fallible-iterator", "scroll 0.10.2", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -2180,6 +3564,16 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.0", +] + [[package]] name = "phf_shared" version = "0.10.0" @@ -2206,7 +3600,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2235,18 +3629,26 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "polling" -version = "2.3.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", + "bitflags 1.3.2", "cfg-if 1.0.0", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "winapi", + "pin-project-lite", + "windows-sys 0.48.0", ] +[[package]] +name = "portable-atomic" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" + [[package]] name = "portpicker" version = "0.1.1" @@ -2270,12 +3672,26 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.1.19" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49e86d2c26a24059894a3afa13fd17d063419b05dfb83f06d9c3566060c3f5a" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "prettytable" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46480520d1b77c9a3482d39939fcf96831537a250ec62d4fd8fbdf8e0302e781" +dependencies = [ + "csv", + "encode_unicode 1.0.0", + "is-terminal", + "lazy_static", + "term", + "unicode-width", ] [[package]] @@ -2295,18 +3711,17 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.9", ] [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -2318,7 +3733,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.99", "version_check", ] @@ -2335,18 +3750,101 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +dependencies = [ + "bytes", + "heck 0.3.3", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "prost-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +dependencies = [ + "bytes", + "prost", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "quick-xml" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +dependencies = [ + "memchr", +] + [[package]] name = "quote" -version = "1.0.21" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2446,7 +3944,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2455,7 +3953,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2500,6 +3998,15 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + [[package]] name = "regex-syntax" version = "0.6.27" @@ -2508,11 +4015,11 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.13.0", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -2524,10 +4031,10 @@ dependencies = [ "hyper-tls", "ipnet", "js-sys", - "lazy_static", "log", "mime", "native-tls", + "once_cell", "percent-encoding", "pin-project-lite", "serde", @@ -2582,11 +4089,24 @@ version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.7", "windows-sys 0.48.0", ] @@ -2602,6 +4122,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.20" @@ -2633,7 +4162,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 1.0.99", ] [[package]] @@ -2665,7 +4194,45 @@ checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys 0.6.1", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys 0.8.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", ] [[package]] @@ -2674,7 +4241,7 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2691,6 +4258,27 @@ dependencies = [ "libc", ] +[[package]] +name = "self_update" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca4e4e6f29fddb78b3e7a6e5a395e8274d4aca2d36b2278a297fa49673a5b7c7" +dependencies = [ + "either", + "flate2", + "hyper", + "indicatif", + "log", + "quick-xml", + "regex", + "reqwest", + "semver", + "serde_json", + "tar", + "tempfile", + "urlencoding", +] + [[package]] name = "semver" version = "1.0.13" @@ -2702,22 +4290,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.144" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -2728,7 +4316,7 @@ checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] @@ -2742,6 +4330,26 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2754,6 +4362,48 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" +dependencies = [ + "base64 0.21.4", + "chrono", + "hex 0.4.3", + "indexmap 1.9.1", + "indexmap 2.0.0", + "serde", + "serde_json", + "serde_with_macros", + "time 0.3.28", +] + +[[package]] +name = "serde_with_macros" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "serde_yaml" +version = "0.9.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +dependencies = [ + "indexmap 2.0.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha2" version = "0.9.9" @@ -2778,6 +4428,36 @@ dependencies = [ "digest 0.10.3", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "dirs 5.0.1", +] + [[package]] name = "signal-hook" version = "0.3.14" @@ -2788,6 +4468,17 @@ dependencies = [ "signal-hook-registry", ] +[[package]] +name = "signal-hook-mio" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -2825,27 +4516,71 @@ dependencies = [ ] [[package]] -name = "smallvec" -version = "1.9.0" +name = "slip10" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28724a6e6f70b0cb115c580891483da6f3aa99e6a353598303a57f89d23aa6bc" +dependencies = [ + "ed25519-dalek", + "hmac", + "sha2 0.9.9", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "snafu" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" +dependencies = [ + "doc-comment", + "snafu-derive", +] [[package]] -name = "smart-default" -version = "0.6.0" +name = "snafu-derive" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ + "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] name = "socket2" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c98bba371b9b22a71a9414e420f92ddeb2369239af08200816169d5e2dd7aa" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2898,11 +4633,11 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.0", "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.99", ] [[package]] @@ -2920,7 +4655,7 @@ dependencies = [ "debugid", "memmap2", "stable_deref_trait", - "uuid", + "uuid 0.8.2", ] [[package]] @@ -2964,6 +4699,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -2972,7 +4718,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", "unicode-xid", ] @@ -3003,10 +4749,21 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.20", "windows-sys 0.48.0", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -3016,30 +4773,34 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - [[package]] name = "thiserror" -version = "1.0.33" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0a539a918745651435ac7db7a18761589a94cd7e94cd56999f828bf73c8a57" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.33" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", ] [[package]] @@ -3053,6 +4814,34 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +dependencies = [ + "deranged", + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +dependencies = [ + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3070,14 +4859,13 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.26.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot", @@ -3085,18 +4873,28 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -3120,6 +4918,31 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.3" @@ -3143,6 +4966,109 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64 0.13.0", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "prost-derive", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +dependencies = [ + "proc-macro2", + "prost-build", + "quote", + "syn 1.0.99", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.1", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util 0.7.3", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -3156,11 +5082,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if 1.0.0", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +dependencies = [ + "crossbeam-channel", + "time 0.3.28", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.22" @@ -3169,16 +5107,80 @@ checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", ] [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +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]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ + "matchers", + "nu-ansi-term", "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -3219,19 +5221,37 @@ checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "unicode-xid" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + [[package]] name = "url" version = "2.2.2" @@ -3245,6 +5265,18 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" @@ -3254,6 +5286,21 @@ dependencies = [ "getrandom 0.2.7", ] +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -3272,6 +5319,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.0" @@ -3321,7 +5378,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.99", "wasm-bindgen-shared", ] @@ -3355,7 +5412,7 @@ checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3383,12 +5440,14 @@ dependencies = [ ] [[package]] -name = "wepoll-ffi" -version = "0.1.2" +name = "which" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ - "cc", + "either", + "libc", + "once_cell", ] [[package]] @@ -3597,13 +5656,23 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "winnow" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] @@ -3615,16 +5684,16 @@ dependencies = [ "anyhow", "async-trait", "base64 0.13.0", - "borsh", + "borsh 0.9.3", "chrono", "dirs 3.0.2", "hex 0.4.3", "libc", - "near-account-id", - "near-crypto", - "near-jsonrpc-client", - "near-jsonrpc-primitives", - "near-primitives", + "near-account-id 0.14.0", + "near-crypto 0.14.0", + "near-jsonrpc-client 0.4.1", + "near-jsonrpc-primitives 0.14.0", + "near-primitives 0.14.0", "near-sandbox-utils", "portpicker", "rand 0.8.5", @@ -3684,7 +5753,7 @@ checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.99", "synstructure", ] @@ -3699,7 +5768,7 @@ dependencies = [ "crc32fast", "flate2", "thiserror", - "time", + "time 0.1.45", ] [[package]] diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index 0845c4a0..5f715d6b 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-near" version = "0.3.1" authors = ["Near Inc "] edition = "2021" -rust-version = "1.60.0" +rust-version = "1.70.0" description = "Cargo extension for building Rust smart contracts on NEAR" readme = "README.md" repository = "https://github.com/near/cargo-near" @@ -16,7 +16,7 @@ anyhow = "1.0" bs58 = "0.4" camino = "1.1.1" cargo_metadata = "0.14" -clap = { version = "3.2", features = ["derive", "env"] } +clap = { version = "4.0.18", features = ["derive", "env"] } colored = "2.0" env_logger = "0.9" log = "0.4" @@ -29,3 +29,13 @@ near-abi = { version = "0.3.0", features = ["__chunked-entries"] } libloading = "0.7.3" zstd = "0.11" atty = "0.2.14" + +color-eyre = "0.6" +inquire = "0.6" +strum = { version = "0.24", features = ["derive"] } +strum_macros = "0.24" +interactive-clap = "0.2.4" +interactive-clap-derive = "0.2.4" +near-cli-rs = { version = "0.5.2" } +derive_more = "0.99.9" +shell-words = "1.0.0" From 0d5a09f94f3d27dacc5907e372f85951f10fa943 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Thu, 14 Sep 2023 21:24:15 +0300 Subject: [PATCH 02/15] added interactive_clap for abi --- cargo-near/src/abi.rs | 15 +- cargo-near/src/lib.rs | 255 +++++++++++++++++++------- cargo-near/src/main.rs | 79 ++++++-- cargo-near/src/types/mod.rs | 1 + cargo-near/src/types/utf8_path_buf.rs | 21 +++ cargo-near/src/util/mod.rs | 1 + integration-tests/Cargo.toml | 2 +- 7 files changed, 287 insertions(+), 87 deletions(-) create mode 100644 cargo-near/src/types/mod.rs create mode 100644 cargo-near/src/types/utf8_path_buf.rs diff --git a/cargo-near/src/abi.rs b/cargo-near/src/abi.rs index d2a54252..df865f07 100644 --- a/cargo-near/src/abi.rs +++ b/cargo-near/src/abi.rs @@ -175,17 +175,22 @@ fn strip_docs(abi_root: &mut near_abi::AbiRoot) { } pub(crate) fn run(args: AbiCommand) -> anyhow::Result<()> { - args.color.apply(); + let color = args.color.unwrap_or_else(|| ColorPreference::Auto); + color.apply(); let crate_metadata = util::handle_step("Collecting cargo project metadata...", || { - CrateMetadata::collect(CargoManifestPath::try_from( - args.manifest_path.unwrap_or_else(|| "Cargo.toml".into()), - )?) + let manifest_path: Utf8PathBuf = if let Some(manifest_path) = args.manifest_path { + manifest_path.into() + } else { + "Cargo.toml".into() + }; + CrateMetadata::collect(CargoManifestPath::try_from(manifest_path)?) })?; let out_dir = args .out_dir .map_or(Ok(crate_metadata.target_directory.clone()), |out_dir| { + let out_dir = Utf8PathBuf::from(out_dir); util::force_canonicalize_dir(&out_dir) })?; @@ -194,7 +199,7 @@ pub(crate) fn run(args: AbiCommand) -> anyhow::Result<()> { } else { AbiFormat::Json }; - let contract_abi = generate_abi(&crate_metadata, args.doc, false, args.color)?; + let contract_abi = generate_abi(&crate_metadata, args.doc, false, color)?; let AbiResult { path } = write_to_file(&contract_abi, &crate_metadata, format, AbiCompression::NoOp)?; diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs index e664ee78..aaaff488 100644 --- a/cargo-near/src/lib.rs +++ b/cargo-near/src/lib.rs @@ -1,110 +1,210 @@ use std::{env, str::FromStr}; use camino::Utf8PathBuf; -use clap::{AppSettings, Args, Parser, Subcommand}; +use colored::Colorize; +use inquire::{CustomType, Select, Text}; +use interactive_clap::ToCliArgs; +pub use near_cli_rs::CliResult; +use strum::{EnumDiscriminants, EnumIter, EnumMessage, IntoEnumIterator}; + +use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; pub mod abi; -pub mod build; +// pub mod build; mod cargo; +mod types; pub mod util; -#[derive(Debug, Parser)] -#[clap(bin_name = "cargo", version, about)] -pub enum Opts { - #[clap(name = "near", version, about)] - #[clap(setting = AppSettings::DeriveDisplayOrder)] - Near(NearArgs), -} - -#[derive(Debug, Args)] +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] pub struct NearArgs { - #[clap(subcommand)] + #[interactive_clap(subcommand)] pub cmd: NearCommand, } -#[derive(Debug, Subcommand)] +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) pub enum NearCommand { - /// Build a NEAR contract and optionally embed ABI - #[clap(name = "build")] - Build(BuildCommand), + // #[strum_discriminants(strum( + // message = "components - Build a NEAR contract and optionally embed ABI" + // ))] + // /// Build a NEAR contract and optionally embed ABI + // Build(BuildCommand), + #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] /// Generates ABI for the contract - #[clap(name = "abi")] Abi(AbiCommand), } -#[derive(Debug, clap::Args)] -#[clap(setting = AppSettings::DeriveDisplayOrder)] +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(skip_default_from_cli)] pub struct AbiCommand { /// Include rustdocs in the ABI file - #[clap(long)] + #[interactive_clap(long)] pub doc: bool, /// Generate compact (minified) JSON - #[clap(long)] + #[interactive_clap(long)] pub compact_abi: bool, /// Copy final artifacts to this directory - #[clap(long, parse(from_str), value_name = "PATH")] - pub out_dir: Option, + #[interactive_clap(long)] + #[interactive_clap(value_name = "PATH")] + #[interactive_clap(skip_default_input_arg)] + pub out_dir: Option, /// Path to the `Cargo.toml` of the contract to build - #[clap(long, parse(from_str), value_name = "PATH")] - pub manifest_path: Option, + #[interactive_clap(long)] + #[interactive_clap(value_name = "PATH")] + #[interactive_clap(skip_default_input_arg)] + pub manifest_path: Option, + // /// Coloring: auto, always, never + // #[interactive_clap(long, value_name = "WHEN")] + // #[interactive_clap(default_value = "auto", possible_values = &["auto", "always", "never"])] + // #[interactive_clap(hide_default_value = true, hide_possible_values = true)] + // #[interactive_clap(parse(try_from_str = ColorPreference::from_str))] + #[interactive_clap(long)] + #[interactive_clap(value_enum)] + #[interactive_clap(skip_default_input_arg)] /// Coloring: auto, always, never - #[clap(long, value_name = "WHEN")] - #[clap(default_value = "auto", possible_values = &["auto", "always", "never"])] - #[clap(hide_default_value = true, hide_possible_values = true)] - #[clap(parse(try_from_str = ColorPreference::from_str))] - pub color: ColorPreference, + pub color: Option, } -#[derive(Debug, clap::Args)] -#[clap(setting = AppSettings::DeriveDisplayOrder)] -pub struct BuildCommand { - /// Build contract in release mode, with optimizations - #[clap(short, long)] - pub release: bool, - /// Embed the ABI in the contract binary - #[clap(long)] - pub embed_abi: bool, - /// Include rustdocs in the embedded ABI - #[clap(long)] - pub doc: bool, - /// Do not generate ABI for the contract - #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] - pub no_abi: bool, - /// Copy final artifacts to this directory - #[clap(long, parse(from_str), value_name = "PATH")] - pub out_dir: Option, - /// Path to the `Cargo.toml` of the contract to build - #[clap(long, parse(from_str), value_name = "PATH")] - pub manifest_path: Option, - /// Coloring: auto, always, never - #[clap(long, value_name = "WHEN")] - #[clap(default_value = "auto", possible_values = &["auto", "always", "never"])] - #[clap(hide_default_value = true, hide_possible_values = true)] - #[clap(parse(try_from_str = ColorPreference::from_str))] - pub color: ColorPreference, +impl interactive_clap::FromCli for AbiCommand { + type FromCliContext = near_cli_rs::GlobalContext; + type FromCliError = color_eyre::eyre::Error; + fn from_cli( + optional_clap_variant: Option<::CliVariant>, + context: Self::FromCliContext, + ) -> interactive_clap::ResultFromCli< + ::CliVariant, + Self::FromCliError, + > + where + Self: Sized + interactive_clap::ToCli, + { + let mut clap_variant = optional_clap_variant.unwrap_or_default(); + let doc = clap_variant.doc.clone(); + let compact_abi = clap_variant.compact_abi.clone(); + if clap_variant.out_dir.is_none() { + clap_variant.out_dir = match Self::input_out_dir(&context) { + Ok(optional_out_dir) => optional_out_dir, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let out_dir = clap_variant.out_dir.clone(); + if clap_variant.manifest_path.is_none() { + clap_variant.manifest_path = match Self::input_manifest_path(&context) { + Ok(optional_manifest_path) => optional_manifest_path, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let manifest_path = clap_variant.manifest_path.clone(); + if clap_variant.color.is_none() { + clap_variant.color = match Self::input_color(&context) { + Ok(optional_color) => optional_color, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let color = clap_variant.color.clone(); + + let args = Self { + doc, + compact_abi, + out_dir, + manifest_path, + color, + }; + match abi::run(args) { + Ok(_) => interactive_clap::ResultFromCli::Ok(clap_variant), + Err(err) => interactive_clap::ResultFromCli::Err( + Some(clap_variant), + color_eyre::Report::msg(err), + ), + } + } } -#[derive(Copy, Clone, Debug)] +impl AbiCommand { + fn input_color( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_out_dir( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_manifest_path( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } +} + +// #[derive(Debug, Clone, interactive_clap::InteractiveClap)] +// #[interactive_clap(context = near_cli_rs::GlobalContext)] +// pub struct BuildCommand { +// /// Build contract in release mode, with optimizations +// #[clap(short, long)] +// pub release: bool, +// /// Embed the ABI in the contract binary +// #[clap(long)] +// pub embed_abi: bool, +// /// Include rustdocs in the embedded ABI +// #[clap(long)] +// pub doc: bool, +// /// Do not generate ABI for the contract +// #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] +// pub no_abi: bool, +// /// Copy final artifacts to this directory +// #[clap(long, parse(from_str), value_name = "PATH")] +// pub out_dir: Option, +// /// Path to the `Cargo.toml` of the contract to build +// #[clap(long, parse(from_str), value_name = "PATH")] +// pub manifest_path: Option, +// /// Coloring: auto, always, never +// // #[clap(long, value_name = "WHEN")] +// // #[clap(default_value = "auto", possible_values = &["auto", "always", "never"])] +// // #[clap(hide_default_value = true, hide_possible_values = true)] +// // #[clap(parse(try_from_str = ColorPreference::from_str))] +// #[interactive_clap(value_enum)] +// #[interactive_clap(skip_default_input_arg)] +// /// How do you want to pass the function call arguments? +// pub color: ColorPreference, +// } + +#[derive(Debug, EnumDiscriminants, Clone, clap::ValueEnum)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] pub enum ColorPreference { + Auto, Always, Never, } +impl interactive_clap::ToCli for ColorPreference { + type CliVariant = ColorPreference; +} + +impl std::fmt::Display for ColorPreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Auto => write!(f, "auto"), + Self::Always => write!(f, "always"), + Self::Never => write!(f, "never"), + } + } +} + impl FromStr for ColorPreference { type Err = String; fn from_str(s: &str) -> Result { match s { - "auto" => match env::var("NO_COLOR") { - Ok(v) if v != "0" => Ok(ColorPreference::Never), - _ => { - if atty::is(atty::Stream::Stderr) { - Ok(ColorPreference::Always) - } else { - Ok(ColorPreference::Never) - } - } - }, + "auto" => Ok(default_mode()), "always" => Ok(ColorPreference::Always), "never" => Ok(ColorPreference::Never), _ => Err(format!("invalid color preference: {}", s)), @@ -112,9 +212,23 @@ impl FromStr for ColorPreference { } } +fn default_mode() -> ColorPreference { + match env::var("NO_COLOR") { + Ok(v) if v != "0" => ColorPreference::Never, + _ => { + if atty::is(atty::Stream::Stderr) { + ColorPreference::Always + } else { + ColorPreference::Never + } + } + } +} + impl ColorPreference { pub fn as_str(&self) -> &str { match self { + ColorPreference::Auto => "auto", ColorPreference::Always => "always", ColorPreference::Never => "never", } @@ -122,6 +236,9 @@ impl ColorPreference { pub fn apply(&self) { match self { + ColorPreference::Auto => { + default_mode().apply(); + } ColorPreference::Always => colored::control::set_override(true), ColorPreference::Never => colored::control::set_override(false), } @@ -131,6 +248,6 @@ impl ColorPreference { pub fn exec(cmd: NearCommand) -> anyhow::Result<()> { match cmd { NearCommand::Abi(args) => abi::run(args), - NearCommand::Build(args) => build::run(args).map(|_| ()), + // NearCommand::Build(args) => build::run(args).map(|_| ()), } } diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index 962c5b13..467dd6ab 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -1,9 +1,32 @@ -use cargo_near::Opts; +// use cargo_near::Opts; +use camino::Utf8PathBuf; use clap::Parser; use colored::Colorize; +use inquire::{CustomType, Select, Text}; +use interactive_clap::ToCliArgs; +pub use near_cli_rs::CliResult; use std::env; +use strum::{EnumDiscriminants, EnumIter, EnumMessage, IntoEnumIterator}; -fn main() { +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +struct Cmd { + #[interactive_clap(subcommand)] + opts: Opts, +} + +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// Near +pub enum Opts { + #[strum_discriminants(strum(message = "near - Near"))] + /// Near + Near(cargo_near::NearArgs), +} + +fn main() -> CliResult { env_logger::init(); match env::var("NO_COLOR") { @@ -11,17 +34,49 @@ fn main() { _ => colored::control::set_override(atty::is(atty::Stream::Stderr)), } - let Opts::Near(args) = Opts::parse(); - match cargo_near::exec(args.cmd) { - Ok(()) => {} - Err(err) => { - let err = format!("{:?}", err); - let mut err_lines = err.lines(); - eprintln!(" {} {}", "✗".bright_red().bold(), err_lines.next().unwrap()); - for line in err_lines { - eprintln!(" {}", line); + let config = near_cli_rs::common::get_config_toml()?; + + color_eyre::install()?; + + let cli = match Cmd::try_parse() { + Ok(cli) => cli, + Err(error) => error.exit(), + }; + + let global_context = near_cli_rs::GlobalContext { + config, + offline: false, + }; + + loop { + match ::from_cli( + Some(cli.clone()), + global_context.clone(), + ) { + interactive_clap::ResultFromCli::Ok(cli_cmd) + | interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => { + eprintln!( + "Your console command:\n{} {}", + std::env::args().next().as_deref().unwrap_or("./validator"), + shell_words::join(cli_cmd.to_cli_args()) + ); + return Ok(()); + } + interactive_clap::ResultFromCli::Cancel(None) => { + eprintln!("Goodbye!"); + return Ok(()); + } + interactive_clap::ResultFromCli::Back => {} + interactive_clap::ResultFromCli::Err(optional_cli_cmd, err) => { + if let Some(cli_cmd) = optional_cli_cmd { + eprintln!( + "Your console command:\n{} {}", + std::env::args().next().as_deref().unwrap_or("./bos"), + shell_words::join(cli_cmd.to_cli_args()) + ); + } + return Err(err); } - std::process::exit(1); } } } diff --git a/cargo-near/src/types/mod.rs b/cargo-near/src/types/mod.rs new file mode 100644 index 00000000..6c0f23ab --- /dev/null +++ b/cargo-near/src/types/mod.rs @@ -0,0 +1 @@ +pub mod utf8_path_buf; diff --git a/cargo-near/src/types/utf8_path_buf.rs b/cargo-near/src/types/utf8_path_buf.rs new file mode 100644 index 00000000..2cb01d09 --- /dev/null +++ b/cargo-near/src/types/utf8_path_buf.rs @@ -0,0 +1,21 @@ +#[derive( + Debug, + Default, + Clone, + derive_more::AsRef, + derive_more::From, + derive_more::Into, + derive_more::FromStr, +)] +#[as_ref(forward)] +pub struct Utf8PathBuf(pub camino::Utf8PathBuf); + +impl std::fmt::Display for Utf8PathBuf { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } +} + +impl interactive_clap::ToCli for Utf8PathBuf { + type CliVariant = Utf8PathBuf; +} diff --git a/cargo-near/src/util/mod.rs b/cargo-near/src/util/mod.rs index 32f50296..5ec43bd0 100644 --- a/cargo-near/src/util/mod.rs +++ b/cargo-near/src/util/mod.rs @@ -62,6 +62,7 @@ where cmd.args(args); match color { + ColorPreference::Auto => cmd.args(["--color", "auto"]), ColorPreference::Always => cmd.args(["--color", "always"]), ColorPreference::Never => cmd.args(["--color", "never"]), }; diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index aab160d5..19280aaa 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -13,7 +13,7 @@ anyhow = "1.0" borsh = "0.9" camino = "1.1.1" cargo-near = { path = "../cargo-near" } -clap = "3.2" +clap = "4.0.18" function_name = "0.3" git2 = "0.14" minifier = "0.2.2" From 6510b3d8602f0d81273f8de88f7ba77b149ca05c Mon Sep 17 00:00:00 2001 From: FroVolod Date: Fri, 15 Sep 2023 10:42:41 +0300 Subject: [PATCH 03/15] added interactive_clap for build --- cargo-near/src/abi.rs | 2 +- cargo-near/src/build.rs | 27 +++--- cargo-near/src/lib.rs | 183 ++++++++++++++++++++++++++-------------- cargo-near/src/main.rs | 9 +- 4 files changed, 141 insertions(+), 80 deletions(-) diff --git a/cargo-near/src/abi.rs b/cargo-near/src/abi.rs index df865f07..f0765fe1 100644 --- a/cargo-near/src/abi.rs +++ b/cargo-near/src/abi.rs @@ -175,7 +175,7 @@ fn strip_docs(abi_root: &mut near_abi::AbiRoot) { } pub(crate) fn run(args: AbiCommand) -> anyhow::Result<()> { - let color = args.color.unwrap_or_else(|| ColorPreference::Auto); + let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); let crate_metadata = util::handle_step("Collecting cargo project metadata...", || { diff --git a/cargo-near/src/build.rs b/cargo-near/src/build.rs index 90710af1..14aa1ab8 100644 --- a/cargo-near/src/build.rs +++ b/cargo-near/src/build.rs @@ -1,16 +1,19 @@ -use crate::abi::{AbiCompression, AbiFormat, AbiResult}; -use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; -use crate::util::CompilationArtifact; -use crate::{abi, util, BuildCommand}; +use camino::Utf8PathBuf; use colored::Colorize; use near_abi::BuildInfo; use sha2::{Digest, Sha256}; use std::io::BufRead; +use crate::abi::{AbiCompression, AbiFormat, AbiResult}; +use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; +use crate::util::CompilationArtifact; +use crate::{abi, util, BuildCommand, ColorPreference}; + const COMPILATION_TARGET: &str = "wasm32-unknown-unknown"; pub fn run(args: BuildCommand) -> anyhow::Result { - args.color.apply(); + let color = args.color.unwrap_or(ColorPreference::Auto); + color.apply(); util::handle_step("Checking the host environment...", || { if !util::invoke_rustup(["target", "list", "--installed"])? @@ -23,14 +26,18 @@ pub fn run(args: BuildCommand) -> anyhow::Result { })?; let crate_metadata = util::handle_step("Collecting cargo project metadata...", || { - CrateMetadata::collect(CargoManifestPath::try_from( - args.manifest_path.unwrap_or_else(|| "Cargo.toml".into()), - )?) + let manifest_path: Utf8PathBuf = if let Some(manifest_path) = args.manifest_path { + manifest_path.into() + } else { + "Cargo.toml".into() + }; + CrateMetadata::collect(CargoManifestPath::try_from(manifest_path)?) })?; let out_dir = args .out_dir .map_or(Ok(crate_metadata.target_directory.clone()), |out_dir| { + let out_dir = Utf8PathBuf::from(out_dir); util::force_canonicalize_dir(&out_dir) })?; @@ -43,7 +50,7 @@ pub fn run(args: BuildCommand) -> anyhow::Result { let mut abi = None; let mut min_abi_path = None; if !args.no_abi { - let mut contract_abi = abi::generate_abi(&crate_metadata, args.doc, true, args.color)?; + let mut contract_abi = abi::generate_abi(&crate_metadata, args.doc, true, color.clone())?; contract_abi.metadata.build = Some(BuildInfo { compiler: format!("rustc {}", rustc_version::version()?), builder: format!("cargo-near {}", env!("CARGO_PKG_VERSION")), @@ -75,7 +82,7 @@ pub fn run(args: BuildCommand) -> anyhow::Result { build_env, "wasm", false, - args.color, + color, )?; wasm_artifact.path = util::copy(&wasm_artifact.path, &out_dir)?; diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs index aaaff488..572ddb49 100644 --- a/cargo-near/src/lib.rs +++ b/cargo-near/src/lib.rs @@ -1,16 +1,10 @@ use std::{env, str::FromStr}; -use camino::Utf8PathBuf; -use colored::Colorize; -use inquire::{CustomType, Select, Text}; -use interactive_clap::ToCliArgs; pub use near_cli_rs::CliResult; -use strum::{EnumDiscriminants, EnumIter, EnumMessage, IntoEnumIterator}; - -use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; +use strum::{EnumDiscriminants, EnumIter, EnumMessage}; pub mod abi; -// pub mod build; +pub mod build; mod cargo; mod types; pub mod util; @@ -28,12 +22,12 @@ pub struct NearArgs { #[interactive_clap(disable_back)] /// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) pub enum NearCommand { - // #[strum_discriminants(strum( - // message = "components - Build a NEAR contract and optionally embed ABI" - // ))] - // /// Build a NEAR contract and optionally embed ABI - // Build(BuildCommand), - #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] + #[strum_discriminants(strum( + message = "build - Build a NEAR contract and optionally embed ABI" + ))] + /// Build a NEAR contract and optionally embed ABI + Build(BuildCommand), + #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] /// Generates ABI for the contract Abi(AbiCommand), } @@ -50,23 +44,16 @@ pub struct AbiCommand { pub compact_abi: bool, /// Copy final artifacts to this directory #[interactive_clap(long)] - #[interactive_clap(value_name = "PATH")] #[interactive_clap(skip_default_input_arg)] pub out_dir: Option, /// Path to the `Cargo.toml` of the contract to build #[interactive_clap(long)] - #[interactive_clap(value_name = "PATH")] #[interactive_clap(skip_default_input_arg)] pub manifest_path: Option, - // /// Coloring: auto, always, never - // #[interactive_clap(long, value_name = "WHEN")] - // #[interactive_clap(default_value = "auto", possible_values = &["auto", "always", "never"])] - // #[interactive_clap(hide_default_value = true, hide_possible_values = true)] - // #[interactive_clap(parse(try_from_str = ColorPreference::from_str))] + /// Coloring: auto, always, never #[interactive_clap(long)] #[interactive_clap(value_enum)] #[interactive_clap(skip_default_input_arg)] - /// Coloring: auto, always, never pub color: Option, } @@ -84,8 +71,8 @@ impl interactive_clap::FromCli for AbiCommand { Self: Sized + interactive_clap::ToCli, { let mut clap_variant = optional_clap_variant.unwrap_or_default(); - let doc = clap_variant.doc.clone(); - let compact_abi = clap_variant.compact_abi.clone(); + let doc = clap_variant.doc; + let compact_abi = clap_variant.compact_abi; if clap_variant.out_dir.is_none() { clap_variant.out_dir = match Self::input_out_dir(&context) { Ok(optional_out_dir) => optional_out_dir, @@ -145,37 +132,116 @@ impl AbiCommand { } } -// #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -// #[interactive_clap(context = near_cli_rs::GlobalContext)] -// pub struct BuildCommand { -// /// Build contract in release mode, with optimizations -// #[clap(short, long)] -// pub release: bool, -// /// Embed the ABI in the contract binary -// #[clap(long)] -// pub embed_abi: bool, -// /// Include rustdocs in the embedded ABI -// #[clap(long)] -// pub doc: bool, -// /// Do not generate ABI for the contract -// #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] -// pub no_abi: bool, -// /// Copy final artifacts to this directory -// #[clap(long, parse(from_str), value_name = "PATH")] -// pub out_dir: Option, -// /// Path to the `Cargo.toml` of the contract to build -// #[clap(long, parse(from_str), value_name = "PATH")] -// pub manifest_path: Option, -// /// Coloring: auto, always, never -// // #[clap(long, value_name = "WHEN")] -// // #[clap(default_value = "auto", possible_values = &["auto", "always", "never"])] -// // #[clap(hide_default_value = true, hide_possible_values = true)] -// // #[clap(parse(try_from_str = ColorPreference::from_str))] -// #[interactive_clap(value_enum)] -// #[interactive_clap(skip_default_input_arg)] -// /// How do you want to pass the function call arguments? -// pub color: ColorPreference, -// } +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(skip_default_from_cli)] +pub struct BuildCommand { + /// Build contract in release mode, with optimizations + #[interactive_clap(long)] + pub release: bool, + /// Embed the ABI in the contract binary + #[interactive_clap(long)] + pub embed_abi: bool, + /// Include rustdocs in the embedded ABI + #[interactive_clap(long)] + pub doc: bool, + /// Do not generate ABI for the contract + #[interactive_clap(long)] + // #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] + pub no_abi: bool, + /// Copy final artifacts to this directory + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub out_dir: Option, + /// Path to the `Cargo.toml` of the contract to build + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub manifest_path: Option, + /// Coloring: auto, always, never + #[interactive_clap(long)] + #[interactive_clap(value_enum)] + #[interactive_clap(skip_default_input_arg)] + pub color: Option, +} + +impl interactive_clap::FromCli for BuildCommand { + type FromCliContext = near_cli_rs::GlobalContext; + type FromCliError = color_eyre::eyre::Error; + fn from_cli( + optional_clap_variant: Option<::CliVariant>, + context: Self::FromCliContext, + ) -> interactive_clap::ResultFromCli< + ::CliVariant, + Self::FromCliError, + > + where + Self: Sized + interactive_clap::ToCli, + { + let mut clap_variant = optional_clap_variant.unwrap_or_default(); + let release = clap_variant.release; + let embed_abi = clap_variant.embed_abi; + let doc = clap_variant.doc; + let no_abi = clap_variant.no_abi; + if clap_variant.out_dir.is_none() { + clap_variant.out_dir = match Self::input_out_dir(&context) { + Ok(optional_out_dir) => optional_out_dir, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let out_dir = clap_variant.out_dir.clone(); + if clap_variant.manifest_path.is_none() { + clap_variant.manifest_path = match Self::input_manifest_path(&context) { + Ok(optional_manifest_path) => optional_manifest_path, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let manifest_path = clap_variant.manifest_path.clone(); + if clap_variant.color.is_none() { + clap_variant.color = match Self::input_color(&context) { + Ok(optional_color) => optional_color, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let color = clap_variant.color.clone(); + + let args = Self { + release, + embed_abi, + doc, + no_abi, + out_dir, + manifest_path, + color, + }; + match build::run(args).map(|_| ()) { + Ok(_) => interactive_clap::ResultFromCli::Ok(clap_variant), + Err(err) => interactive_clap::ResultFromCli::Err( + Some(clap_variant), + color_eyre::Report::msg(err), + ), + } + } +} + +impl BuildCommand { + fn input_color( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_out_dir( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_manifest_path( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } +} #[derive(Debug, EnumDiscriminants, Clone, clap::ValueEnum)] #[strum_discriminants(derive(EnumMessage, EnumIter))] @@ -244,10 +310,3 @@ impl ColorPreference { } } } - -pub fn exec(cmd: NearCommand) -> anyhow::Result<()> { - match cmd { - NearCommand::Abi(args) => abi::run(args), - // NearCommand::Build(args) => build::run(args).map(|_| ()), - } -} diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index 467dd6ab..36a2ee39 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -1,12 +1,7 @@ -// use cargo_near::Opts; -use camino::Utf8PathBuf; -use clap::Parser; -use colored::Colorize; -use inquire::{CustomType, Select, Text}; use interactive_clap::ToCliArgs; pub use near_cli_rs::CliResult; use std::env; -use strum::{EnumDiscriminants, EnumIter, EnumMessage, IntoEnumIterator}; +use strum::{EnumDiscriminants, EnumIter, EnumMessage}; #[derive(Debug, Clone, interactive_clap::InteractiveClap)] #[interactive_clap(context = near_cli_rs::GlobalContext)] @@ -57,7 +52,7 @@ fn main() -> CliResult { | interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => { eprintln!( "Your console command:\n{} {}", - std::env::args().next().as_deref().unwrap_or("./validator"), + std::env::args().next().as_deref().unwrap_or("./cargo-near"), shell_words::join(cli_cmd.to_cli_args()) ); return Ok(()); From 40d6f2d74bcbcb969843b052787f7c1624d7ad1d Mon Sep 17 00:00:00 2001 From: FroVolod Date: Fri, 15 Sep 2023 11:23:40 +0300 Subject: [PATCH 04/15] refactored --- cargo-near/src/lib.rs | 48 ++++++++++++++++++------------------------ cargo-near/src/main.rs | 18 ++++------------ 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs index 572ddb49..c446346a 100644 --- a/cargo-near/src/lib.rs +++ b/cargo-near/src/lib.rs @@ -10,14 +10,14 @@ mod types; pub mod util; #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] pub struct NearArgs { #[interactive_clap(subcommand)] pub cmd: NearCommand, } #[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] #[strum_discriminants(derive(EnumMessage, EnumIter))] #[interactive_clap(disable_back)] /// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) @@ -33,7 +33,7 @@ pub enum NearCommand { } #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] #[interactive_clap(skip_default_from_cli)] pub struct AbiCommand { /// Include rustdocs in the ABI file @@ -58,7 +58,7 @@ pub struct AbiCommand { } impl interactive_clap::FromCli for AbiCommand { - type FromCliContext = near_cli_rs::GlobalContext; + type FromCliContext = (); type FromCliError = color_eyre::eyre::Error; fn from_cli( optional_clap_variant: Option<::CliVariant>, @@ -102,38 +102,34 @@ impl interactive_clap::FromCli for AbiCommand { manifest_path, color, }; - match abi::run(args) { - Ok(_) => interactive_clap::ResultFromCli::Ok(clap_variant), - Err(err) => interactive_clap::ResultFromCli::Err( - Some(clap_variant), - color_eyre::Report::msg(err), - ), + if let Err(err) = abi::run(args) { + interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) + } else { + interactive_clap::ResultFromCli::Ok(clap_variant) } } } impl AbiCommand { - fn input_color( - _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + fn input_color(_context: &()) -> color_eyre::eyre::Result> { Ok(None) } fn input_out_dir( - _context: &near_cli_rs::GlobalContext, + _context: &(), ) -> color_eyre::eyre::Result> { Ok(None) } fn input_manifest_path( - _context: &near_cli_rs::GlobalContext, + _context: &(), ) -> color_eyre::eyre::Result> { Ok(None) } } #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] #[interactive_clap(skip_default_from_cli)] pub struct BuildCommand { /// Build contract in release mode, with optimizations @@ -165,7 +161,7 @@ pub struct BuildCommand { } impl interactive_clap::FromCli for BuildCommand { - type FromCliContext = near_cli_rs::GlobalContext; + type FromCliContext = (); type FromCliError = color_eyre::eyre::Error; fn from_cli( optional_clap_variant: Option<::CliVariant>, @@ -213,31 +209,27 @@ impl interactive_clap::FromCli for BuildCommand { manifest_path, color, }; - match build::run(args).map(|_| ()) { - Ok(_) => interactive_clap::ResultFromCli::Ok(clap_variant), - Err(err) => interactive_clap::ResultFromCli::Err( - Some(clap_variant), - color_eyre::Report::msg(err), - ), + if let Err(err) = build::run(args).map(|_| ()) { + interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) + } else { + interactive_clap::ResultFromCli::Ok(clap_variant) } } } impl BuildCommand { - fn input_color( - _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + fn input_color(_context: &()) -> color_eyre::eyre::Result> { Ok(None) } fn input_out_dir( - _context: &near_cli_rs::GlobalContext, + _context: &(), ) -> color_eyre::eyre::Result> { Ok(None) } fn input_manifest_path( - _context: &near_cli_rs::GlobalContext, + _context: &(), ) -> color_eyre::eyre::Result> { Ok(None) } diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index 36a2ee39..f4a235a9 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -4,14 +4,14 @@ use std::env; use strum::{EnumDiscriminants, EnumIter, EnumMessage}; #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] struct Cmd { #[interactive_clap(subcommand)] opts: Opts, } #[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(context = ())] #[strum_discriminants(derive(EnumMessage, EnumIter))] #[interactive_clap(disable_back)] /// Near @@ -29,8 +29,6 @@ fn main() -> CliResult { _ => colored::control::set_override(atty::is(atty::Stream::Stderr)), } - let config = near_cli_rs::common::get_config_toml()?; - color_eyre::install()?; let cli = match Cmd::try_parse() { @@ -38,16 +36,8 @@ fn main() -> CliResult { Err(error) => error.exit(), }; - let global_context = near_cli_rs::GlobalContext { - config, - offline: false, - }; - loop { - match ::from_cli( - Some(cli.clone()), - global_context.clone(), - ) { + match ::from_cli(Some(cli.clone()), ()) { interactive_clap::ResultFromCli::Ok(cli_cmd) | interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => { eprintln!( @@ -66,7 +56,7 @@ fn main() -> CliResult { if let Some(cli_cmd) = optional_cli_cmd { eprintln!( "Your console command:\n{} {}", - std::env::args().next().as_deref().unwrap_or("./bos"), + std::env::args().next().as_deref().unwrap_or("./cargo-near"), shell_words::join(cli_cmd.to_cli_args()) ); } From 55568aea7c5fbc38f9d789acea92677a241b934c Mon Sep 17 00:00:00 2001 From: FroVolod Date: Fri, 15 Sep 2023 17:40:12 +0300 Subject: [PATCH 05/15] refactored --- Cargo.lock | 31 +- cargo-near/Cargo.toml | 4 +- cargo-near/src/{ => abi_command}/abi.rs | 13 +- cargo-near/src/abi_command/mod.rs | 99 +++++++ cargo-near/src/{ => build_command}/build.rs | 11 +- cargo-near/src/build_command/mod.rs | 110 +++++++ cargo-near/src/cargo/mod.rs | 2 - cargo-near/src/common.rs | 72 +++++ cargo-near/src/lib.rs | 304 -------------------- cargo-near/src/main.rs | 51 +++- cargo-near/src/{cargo => types}/manifest.rs | 0 cargo-near/src/{cargo => types}/metadata.rs | 2 +- cargo-near/src/types/mod.rs | 2 + cargo-near/src/util/mod.rs | 12 +- 14 files changed, 378 insertions(+), 335 deletions(-) rename cargo-near/src/{ => abi_command}/abi.rs (97%) create mode 100644 cargo-near/src/abi_command/mod.rs rename cargo-near/src/{ => build_command}/build.rs (93%) create mode 100644 cargo-near/src/build_command/mod.rs delete mode 100644 cargo-near/src/cargo/mod.rs create mode 100644 cargo-near/src/common.rs delete mode 100644 cargo-near/src/lib.rs rename cargo-near/src/{cargo => types}/manifest.rs (100%) rename cargo-near/src/{cargo => types}/metadata.rs (97%) diff --git a/Cargo.lock b/Cargo.lock index e1908924..e7c13b7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,8 +660,8 @@ dependencies = [ "derive_more", "env_logger", "inquire", - "interactive-clap", - "interactive-clap-derive", + "interactive-clap 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", + "interactive-clap-derive 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", "libloading", "log", "near-abi", @@ -2129,7 +2129,17 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9a4460797bc616e3256b1becad15e859c4f8d63a8a379c87fdcb1734206cf0a" dependencies = [ - "interactive-clap-derive", + "interactive-clap-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "strum", + "strum_macros", +] + +[[package]] +name = "interactive-clap" +version = "0.2.4" +source = "git+https://github.com/near-cli-rs/interactive-clap#2cc575c8de3c8745f513f2f07261dd1ba437fdd0" +dependencies = [ + "interactive-clap-derive 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", "strum", "strum_macros", ] @@ -2146,6 +2156,17 @@ dependencies = [ "syn 1.0.99", ] +[[package]] +name = "interactive-clap-derive" +version = "0.2.4" +source = "git+https://github.com/near-cli-rs/interactive-clap#2cc575c8de3c8745f513f2f07261dd1ba437fdd0" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.99", +] + [[package]] name = "io-lifetimes" version = "1.0.11" @@ -2638,8 +2659,8 @@ dependencies = [ "futures", "hex 0.4.3", "inquire", - "interactive-clap", - "interactive-clap-derive", + "interactive-clap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "interactive-clap-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map", "near-crypto 0.17.0", "near-jsonrpc-client 0.6.0", diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index 5f715d6b..4c838385 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -34,8 +34,8 @@ color-eyre = "0.6" inquire = "0.6" strum = { version = "0.24", features = ["derive"] } strum_macros = "0.24" -interactive-clap = "0.2.4" -interactive-clap-derive = "0.2.4" +interactive-clap = {git = "https://github.com/near-cli-rs/interactive-clap"} +interactive-clap-derive = {git = "https://github.com/near-cli-rs/interactive-clap"} near-cli-rs = { version = "0.5.2" } derive_more = "0.99.9" shell-words = "1.0.0" diff --git a/cargo-near/src/abi.rs b/cargo-near/src/abi_command/abi.rs similarity index 97% rename from cargo-near/src/abi.rs rename to cargo-near/src/abi_command/abi.rs index f0765fe1..09c2f058 100644 --- a/cargo-near/src/abi.rs +++ b/cargo-near/src/abi_command/abi.rs @@ -1,10 +1,13 @@ -use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; -use crate::{util, AbiCommand, ColorPreference}; +use std::collections::HashMap; +use std::fs; + use camino::Utf8PathBuf; use colored::Colorize; use near_abi::AbiRoot; -use std::collections::HashMap; -use std::fs; + +use crate::common::ColorPreference; +use crate::types::{manifest::CargoManifestPath, metadata::CrateMetadata}; +use crate::util; /// ABI generation result. pub(crate) struct AbiResult { @@ -174,7 +177,7 @@ fn strip_docs(abi_root: &mut near_abi::AbiRoot) { } } -pub(crate) fn run(args: AbiCommand) -> anyhow::Result<()> { +pub(crate) fn run(args: super::AbiCommand) -> anyhow::Result<()> { let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); diff --git a/cargo-near/src/abi_command/mod.rs b/cargo-near/src/abi_command/mod.rs new file mode 100644 index 00000000..f6bb4e64 --- /dev/null +++ b/cargo-near/src/abi_command/mod.rs @@ -0,0 +1,99 @@ +pub mod abi; + +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(skip_default_from_cli)] +pub struct AbiCommand { + /// Include rustdocs in the ABI file + #[interactive_clap(long)] + pub doc: bool, + /// Generate compact (minified) JSON + #[interactive_clap(long)] + pub compact_abi: bool, + /// Copy final artifacts to this directory + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub out_dir: Option, + /// Path to the `Cargo.toml` of the contract to build + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub manifest_path: Option, + /// Coloring: auto, always, never + #[interactive_clap(long)] + #[interactive_clap(value_enum)] + #[interactive_clap(skip_default_input_arg)] + pub color: Option, +} + +impl interactive_clap::FromCli for AbiCommand { + type FromCliContext = near_cli_rs::GlobalContext; + type FromCliError = color_eyre::eyre::Error; + fn from_cli( + optional_clap_variant: Option<::CliVariant>, + context: Self::FromCliContext, + ) -> interactive_clap::ResultFromCli< + ::CliVariant, + Self::FromCliError, + > + where + Self: Sized + interactive_clap::ToCli, + { + let mut clap_variant = optional_clap_variant.unwrap_or_default(); + let doc = clap_variant.doc; + let compact_abi = clap_variant.compact_abi; + if clap_variant.out_dir.is_none() { + clap_variant.out_dir = match Self::input_out_dir(&context) { + Ok(optional_out_dir) => optional_out_dir, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let out_dir = clap_variant.out_dir.clone(); + if clap_variant.manifest_path.is_none() { + clap_variant.manifest_path = match Self::input_manifest_path(&context) { + Ok(optional_manifest_path) => optional_manifest_path, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let manifest_path = clap_variant.manifest_path.clone(); + if clap_variant.color.is_none() { + clap_variant.color = match Self::input_color(&context) { + Ok(optional_color) => optional_color, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let color = clap_variant.color.clone(); + + let args = Self { + doc, + compact_abi, + out_dir, + manifest_path, + color, + }; + if let Err(err) = self::abi::run(args) { + interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) + } else { + interactive_clap::ResultFromCli::Ok(clap_variant) + } + } +} + +impl AbiCommand { + fn input_color( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_out_dir( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_manifest_path( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } +} diff --git a/cargo-near/src/build.rs b/cargo-near/src/build_command/build.rs similarity index 93% rename from cargo-near/src/build.rs rename to cargo-near/src/build_command/build.rs index 14aa1ab8..4f217944 100644 --- a/cargo-near/src/build.rs +++ b/cargo-near/src/build_command/build.rs @@ -4,14 +4,15 @@ use near_abi::BuildInfo; use sha2::{Digest, Sha256}; use std::io::BufRead; -use crate::abi::{AbiCompression, AbiFormat, AbiResult}; -use crate::cargo::{manifest::CargoManifestPath, metadata::CrateMetadata}; -use crate::util::CompilationArtifact; -use crate::{abi, util, BuildCommand, ColorPreference}; +use crate::abi_command::abi; +use crate::abi_command::abi::{AbiCompression, AbiFormat, AbiResult}; +use crate::common::ColorPreference; +use crate::types::{manifest::CargoManifestPath, metadata::CrateMetadata}; +use crate::util; const COMPILATION_TARGET: &str = "wasm32-unknown-unknown"; -pub fn run(args: BuildCommand) -> anyhow::Result { +pub fn run(args: super::BuildCommand) -> anyhow::Result { let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); diff --git a/cargo-near/src/build_command/mod.rs b/cargo-near/src/build_command/mod.rs new file mode 100644 index 00000000..59b7918b --- /dev/null +++ b/cargo-near/src/build_command/mod.rs @@ -0,0 +1,110 @@ +mod build; + +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[interactive_clap(skip_default_from_cli)] +pub struct BuildCommand { + /// Build contract in release mode, with optimizations + #[interactive_clap(long)] + pub release: bool, + /// Embed the ABI in the contract binary + #[interactive_clap(long)] + pub embed_abi: bool, + /// Include rustdocs in the embedded ABI + #[interactive_clap(long)] + pub doc: bool, + /// Do not generate ABI for the contract + #[interactive_clap(long)] + // #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] + pub no_abi: bool, + /// Copy final artifacts to this directory + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub out_dir: Option, + /// Path to the `Cargo.toml` of the contract to build + #[interactive_clap(long)] + #[interactive_clap(skip_default_input_arg)] + pub manifest_path: Option, + /// Coloring: auto, always, never + #[interactive_clap(long)] + #[interactive_clap(value_enum)] + #[interactive_clap(skip_default_input_arg)] + pub color: Option, +} + +impl interactive_clap::FromCli for BuildCommand { + type FromCliContext = near_cli_rs::GlobalContext; + type FromCliError = color_eyre::eyre::Error; + fn from_cli( + optional_clap_variant: Option<::CliVariant>, + context: Self::FromCliContext, + ) -> interactive_clap::ResultFromCli< + ::CliVariant, + Self::FromCliError, + > + where + Self: Sized + interactive_clap::ToCli, + { + let mut clap_variant = optional_clap_variant.unwrap_or_default(); + let release = clap_variant.release; + let embed_abi = clap_variant.embed_abi; + let doc = clap_variant.doc; + let no_abi = clap_variant.no_abi; + if clap_variant.out_dir.is_none() { + clap_variant.out_dir = match Self::input_out_dir(&context) { + Ok(optional_out_dir) => optional_out_dir, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let out_dir = clap_variant.out_dir.clone(); + if clap_variant.manifest_path.is_none() { + clap_variant.manifest_path = match Self::input_manifest_path(&context) { + Ok(optional_manifest_path) => optional_manifest_path, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let manifest_path = clap_variant.manifest_path.clone(); + if clap_variant.color.is_none() { + clap_variant.color = match Self::input_color(&context) { + Ok(optional_color) => optional_color, + Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), + }; + }; + let color = clap_variant.color.clone(); + + let args = Self { + release, + embed_abi, + doc, + no_abi, + out_dir, + manifest_path, + color, + }; + if let Err(err) = self::build::run(args).map(|_| ()) { + interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) + } else { + interactive_clap::ResultFromCli::Ok(clap_variant) + } + } +} + +impl BuildCommand { + fn input_color( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_out_dir( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } + + fn input_manifest_path( + _context: &near_cli_rs::GlobalContext, + ) -> color_eyre::eyre::Result> { + Ok(None) + } +} diff --git a/cargo-near/src/cargo/mod.rs b/cargo-near/src/cargo/mod.rs deleted file mode 100644 index 5c54ff66..00000000 --- a/cargo-near/src/cargo/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod manifest; -pub mod metadata; diff --git a/cargo-near/src/common.rs b/cargo-near/src/common.rs new file mode 100644 index 00000000..10d9831d --- /dev/null +++ b/cargo-near/src/common.rs @@ -0,0 +1,72 @@ +use std::{env, str::FromStr}; + +pub use near_cli_rs::CliResult; +use strum::{EnumDiscriminants, EnumIter, EnumMessage}; + +#[derive(Debug, EnumDiscriminants, Clone, clap::ValueEnum)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +pub enum ColorPreference { + Auto, + Always, + Never, +} + +impl interactive_clap::ToCli for ColorPreference { + type CliVariant = ColorPreference; +} + +impl std::fmt::Display for ColorPreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Auto => write!(f, "auto"), + Self::Always => write!(f, "always"), + Self::Never => write!(f, "never"), + } + } +} + +impl FromStr for ColorPreference { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + "auto" => Ok(default_mode()), + "always" => Ok(ColorPreference::Always), + "never" => Ok(ColorPreference::Never), + _ => Err(format!("invalid color preference: {}", s)), + } + } +} + +fn default_mode() -> ColorPreference { + match env::var("NO_COLOR") { + Ok(v) if v != "0" => ColorPreference::Never, + _ => { + if atty::is(atty::Stream::Stderr) { + ColorPreference::Always + } else { + ColorPreference::Never + } + } + } +} + +impl ColorPreference { + pub fn as_str(&self) -> &str { + match self { + ColorPreference::Auto => "auto", + ColorPreference::Always => "always", + ColorPreference::Never => "never", + } + } + + pub fn apply(&self) { + match self { + ColorPreference::Auto => { + default_mode().apply(); + } + ColorPreference::Always => colored::control::set_override(true), + ColorPreference::Never => colored::control::set_override(false), + } + } +} diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs deleted file mode 100644 index c446346a..00000000 --- a/cargo-near/src/lib.rs +++ /dev/null @@ -1,304 +0,0 @@ -use std::{env, str::FromStr}; - -pub use near_cli_rs::CliResult; -use strum::{EnumDiscriminants, EnumIter, EnumMessage}; - -pub mod abi; -pub mod build; -mod cargo; -mod types; -pub mod util; - -#[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] -pub struct NearArgs { - #[interactive_clap(subcommand)] - pub cmd: NearCommand, -} - -#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] -#[strum_discriminants(derive(EnumMessage, EnumIter))] -#[interactive_clap(disable_back)] -/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) -pub enum NearCommand { - #[strum_discriminants(strum( - message = "build - Build a NEAR contract and optionally embed ABI" - ))] - /// Build a NEAR contract and optionally embed ABI - Build(BuildCommand), - #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] - /// Generates ABI for the contract - Abi(AbiCommand), -} - -#[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] -#[interactive_clap(skip_default_from_cli)] -pub struct AbiCommand { - /// Include rustdocs in the ABI file - #[interactive_clap(long)] - pub doc: bool, - /// Generate compact (minified) JSON - #[interactive_clap(long)] - pub compact_abi: bool, - /// Copy final artifacts to this directory - #[interactive_clap(long)] - #[interactive_clap(skip_default_input_arg)] - pub out_dir: Option, - /// Path to the `Cargo.toml` of the contract to build - #[interactive_clap(long)] - #[interactive_clap(skip_default_input_arg)] - pub manifest_path: Option, - /// Coloring: auto, always, never - #[interactive_clap(long)] - #[interactive_clap(value_enum)] - #[interactive_clap(skip_default_input_arg)] - pub color: Option, -} - -impl interactive_clap::FromCli for AbiCommand { - type FromCliContext = (); - type FromCliError = color_eyre::eyre::Error; - fn from_cli( - optional_clap_variant: Option<::CliVariant>, - context: Self::FromCliContext, - ) -> interactive_clap::ResultFromCli< - ::CliVariant, - Self::FromCliError, - > - where - Self: Sized + interactive_clap::ToCli, - { - let mut clap_variant = optional_clap_variant.unwrap_or_default(); - let doc = clap_variant.doc; - let compact_abi = clap_variant.compact_abi; - if clap_variant.out_dir.is_none() { - clap_variant.out_dir = match Self::input_out_dir(&context) { - Ok(optional_out_dir) => optional_out_dir, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let out_dir = clap_variant.out_dir.clone(); - if clap_variant.manifest_path.is_none() { - clap_variant.manifest_path = match Self::input_manifest_path(&context) { - Ok(optional_manifest_path) => optional_manifest_path, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let manifest_path = clap_variant.manifest_path.clone(); - if clap_variant.color.is_none() { - clap_variant.color = match Self::input_color(&context) { - Ok(optional_color) => optional_color, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let color = clap_variant.color.clone(); - - let args = Self { - doc, - compact_abi, - out_dir, - manifest_path, - color, - }; - if let Err(err) = abi::run(args) { - interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) - } else { - interactive_clap::ResultFromCli::Ok(clap_variant) - } - } -} - -impl AbiCommand { - fn input_color(_context: &()) -> color_eyre::eyre::Result> { - Ok(None) - } - - fn input_out_dir( - _context: &(), - ) -> color_eyre::eyre::Result> { - Ok(None) - } - - fn input_manifest_path( - _context: &(), - ) -> color_eyre::eyre::Result> { - Ok(None) - } -} - -#[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] -#[interactive_clap(skip_default_from_cli)] -pub struct BuildCommand { - /// Build contract in release mode, with optimizations - #[interactive_clap(long)] - pub release: bool, - /// Embed the ABI in the contract binary - #[interactive_clap(long)] - pub embed_abi: bool, - /// Include rustdocs in the embedded ABI - #[interactive_clap(long)] - pub doc: bool, - /// Do not generate ABI for the contract - #[interactive_clap(long)] - // #[clap(long, conflicts_with_all = &["doc", "embed-abi"])] - pub no_abi: bool, - /// Copy final artifacts to this directory - #[interactive_clap(long)] - #[interactive_clap(skip_default_input_arg)] - pub out_dir: Option, - /// Path to the `Cargo.toml` of the contract to build - #[interactive_clap(long)] - #[interactive_clap(skip_default_input_arg)] - pub manifest_path: Option, - /// Coloring: auto, always, never - #[interactive_clap(long)] - #[interactive_clap(value_enum)] - #[interactive_clap(skip_default_input_arg)] - pub color: Option, -} - -impl interactive_clap::FromCli for BuildCommand { - type FromCliContext = (); - type FromCliError = color_eyre::eyre::Error; - fn from_cli( - optional_clap_variant: Option<::CliVariant>, - context: Self::FromCliContext, - ) -> interactive_clap::ResultFromCli< - ::CliVariant, - Self::FromCliError, - > - where - Self: Sized + interactive_clap::ToCli, - { - let mut clap_variant = optional_clap_variant.unwrap_or_default(); - let release = clap_variant.release; - let embed_abi = clap_variant.embed_abi; - let doc = clap_variant.doc; - let no_abi = clap_variant.no_abi; - if clap_variant.out_dir.is_none() { - clap_variant.out_dir = match Self::input_out_dir(&context) { - Ok(optional_out_dir) => optional_out_dir, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let out_dir = clap_variant.out_dir.clone(); - if clap_variant.manifest_path.is_none() { - clap_variant.manifest_path = match Self::input_manifest_path(&context) { - Ok(optional_manifest_path) => optional_manifest_path, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let manifest_path = clap_variant.manifest_path.clone(); - if clap_variant.color.is_none() { - clap_variant.color = match Self::input_color(&context) { - Ok(optional_color) => optional_color, - Err(err) => return interactive_clap::ResultFromCli::Err(Some(clap_variant), err), - }; - }; - let color = clap_variant.color.clone(); - - let args = Self { - release, - embed_abi, - doc, - no_abi, - out_dir, - manifest_path, - color, - }; - if let Err(err) = build::run(args).map(|_| ()) { - interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) - } else { - interactive_clap::ResultFromCli::Ok(clap_variant) - } - } -} - -impl BuildCommand { - fn input_color(_context: &()) -> color_eyre::eyre::Result> { - Ok(None) - } - - fn input_out_dir( - _context: &(), - ) -> color_eyre::eyre::Result> { - Ok(None) - } - - fn input_manifest_path( - _context: &(), - ) -> color_eyre::eyre::Result> { - Ok(None) - } -} - -#[derive(Debug, EnumDiscriminants, Clone, clap::ValueEnum)] -#[strum_discriminants(derive(EnumMessage, EnumIter))] -pub enum ColorPreference { - Auto, - Always, - Never, -} - -impl interactive_clap::ToCli for ColorPreference { - type CliVariant = ColorPreference; -} - -impl std::fmt::Display for ColorPreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Auto => write!(f, "auto"), - Self::Always => write!(f, "always"), - Self::Never => write!(f, "never"), - } - } -} - -impl FromStr for ColorPreference { - type Err = String; - - fn from_str(s: &str) -> Result { - match s { - "auto" => Ok(default_mode()), - "always" => Ok(ColorPreference::Always), - "never" => Ok(ColorPreference::Never), - _ => Err(format!("invalid color preference: {}", s)), - } - } -} - -fn default_mode() -> ColorPreference { - match env::var("NO_COLOR") { - Ok(v) if v != "0" => ColorPreference::Never, - _ => { - if atty::is(atty::Stream::Stderr) { - ColorPreference::Always - } else { - ColorPreference::Never - } - } - } -} - -impl ColorPreference { - pub fn as_str(&self) -> &str { - match self { - ColorPreference::Auto => "auto", - ColorPreference::Always => "always", - ColorPreference::Never => "never", - } - } - - pub fn apply(&self) { - match self { - ColorPreference::Auto => { - default_mode().apply(); - } - ColorPreference::Always => colored::control::set_override(true), - ColorPreference::Never => colored::control::set_override(false), - } - } -} diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index f4a235a9..0be2335d 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -3,22 +3,51 @@ pub use near_cli_rs::CliResult; use std::env; use strum::{EnumDiscriminants, EnumIter, EnumMessage}; +mod abi_command; +mod build_command; +pub mod common; +pub mod types; +pub mod util; + #[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] +#[interactive_clap(context = near_cli_rs::GlobalContext)] struct Cmd { #[interactive_clap(subcommand)] opts: Opts, } #[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = ())] +#[interactive_clap(context = near_cli_rs::GlobalContext)] #[strum_discriminants(derive(EnumMessage, EnumIter))] #[interactive_clap(disable_back)] /// Near pub enum Opts { - #[strum_discriminants(strum(message = "near - Near"))] - /// Near - Near(cargo_near::NearArgs), + #[strum_discriminants(strum(message = "near"))] + /// Which cargo extension do you want to use? + Near(NearArgs), +} + +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +pub struct NearArgs { + #[interactive_clap(subcommand)] + pub cmd: NearCommand, +} + +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) +pub enum NearCommand { + #[strum_discriminants(strum( + message = "build - Build a NEAR contract and optionally embed ABI" + ))] + /// Build a NEAR contract and optionally embed ABI + Build(self::build_command::BuildCommand), + #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] + /// Generates ABI for the contract + Abi(self::abi_command::AbiCommand), } fn main() -> CliResult { @@ -29,6 +58,8 @@ fn main() -> CliResult { _ => colored::control::set_override(atty::is(atty::Stream::Stderr)), } + let config = near_cli_rs::common::get_config_toml()?; + color_eyre::install()?; let cli = match Cmd::try_parse() { @@ -36,8 +67,16 @@ fn main() -> CliResult { Err(error) => error.exit(), }; + let global_context = near_cli_rs::GlobalContext { + config, + offline: false, + }; + loop { - match ::from_cli(Some(cli.clone()), ()) { + match ::from_cli( + Some(cli.clone()), + global_context.clone(), + ) { interactive_clap::ResultFromCli::Ok(cli_cmd) | interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => { eprintln!( diff --git a/cargo-near/src/cargo/manifest.rs b/cargo-near/src/types/manifest.rs similarity index 100% rename from cargo-near/src/cargo/manifest.rs rename to cargo-near/src/types/manifest.rs diff --git a/cargo-near/src/cargo/metadata.rs b/cargo-near/src/types/metadata.rs similarity index 97% rename from cargo-near/src/cargo/metadata.rs rename to cargo-near/src/types/metadata.rs index 91d762e7..d36422eb 100644 --- a/cargo-near/src/cargo/metadata.rs +++ b/cargo-near/src/types/metadata.rs @@ -1,4 +1,4 @@ -use crate::cargo::manifest::CargoManifestPath; +use crate::types::manifest::CargoManifestPath; use crate::util; use anyhow::{Context, Result}; use camino::Utf8PathBuf; diff --git a/cargo-near/src/types/mod.rs b/cargo-near/src/types/mod.rs index 6c0f23ab..54b7ff34 100644 --- a/cargo-near/src/types/mod.rs +++ b/cargo-near/src/types/mod.rs @@ -1 +1,3 @@ +pub mod manifest; +pub mod metadata; pub mod utf8_path_buf; diff --git a/cargo-near/src/util/mod.rs b/cargo-near/src/util/mod.rs index 5ec43bd0..d5f1c9cc 100644 --- a/cargo-near/src/util/mod.rs +++ b/cargo-near/src/util/mod.rs @@ -1,8 +1,3 @@ -use crate::cargo::manifest::CargoManifestPath; -use crate::ColorPreference; -use anyhow::{Context, Result}; -use camino::{Utf8Path, Utf8PathBuf}; -use cargo_metadata::{Artifact, Message}; use std::collections::{BTreeMap, HashSet}; use std::ffi::OsStr; use std::fs; @@ -10,6 +5,13 @@ use std::io::{BufRead, BufReader}; use std::process::Command; use std::{env, thread}; +use anyhow::{Context, Result}; +use camino::{Utf8Path, Utf8PathBuf}; +use cargo_metadata::{Artifact, Message}; + +use crate::common::ColorPreference; +use crate::types::manifest::CargoManifestPath; + mod print; pub(crate) use print::*; From 1d42c80407617a56811f86dc91fe3a2de62b68e6 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Sun, 17 Sep 2023 09:06:42 +0300 Subject: [PATCH 06/15] added lib.rs --- cargo-near/src/lib.rs | 42 +++++++++++++++++++++++++++++++++++++++++ cargo-near/src/main.rs | 43 +----------------------------------------- 2 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 cargo-near/src/lib.rs diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs new file mode 100644 index 00000000..535559d0 --- /dev/null +++ b/cargo-near/src/lib.rs @@ -0,0 +1,42 @@ +pub use near_cli_rs::CliResult; +use strum::{EnumDiscriminants, EnumIter, EnumMessage}; + +mod abi_command; +mod build_command; +pub mod common; +pub mod types; +pub mod util; + +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// Near +pub enum Opts { + #[strum_discriminants(strum(message = "near"))] + /// Which cargo extension do you want to use? + Near(NearArgs), +} + +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +pub struct NearArgs { + #[interactive_clap(subcommand)] + pub cmd: NearCommand, +} + +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) +pub enum NearCommand { + #[strum_discriminants(strum( + message = "build - Build a NEAR contract and optionally embed ABI" + ))] + /// Build a NEAR contract and optionally embed ABI + Build(self::build_command::BuildCommand), + #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] + /// Generates ABI for the contract + Abi(self::abi_command::AbiCommand), +} diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index 0be2335d..d5890484 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -1,53 +1,12 @@ use interactive_clap::ToCliArgs; pub use near_cli_rs::CliResult; use std::env; -use strum::{EnumDiscriminants, EnumIter, EnumMessage}; - -mod abi_command; -mod build_command; -pub mod common; -pub mod types; -pub mod util; #[derive(Debug, Clone, interactive_clap::InteractiveClap)] #[interactive_clap(context = near_cli_rs::GlobalContext)] struct Cmd { #[interactive_clap(subcommand)] - opts: Opts, -} - -#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] -#[strum_discriminants(derive(EnumMessage, EnumIter))] -#[interactive_clap(disable_back)] -/// Near -pub enum Opts { - #[strum_discriminants(strum(message = "near"))] - /// Which cargo extension do you want to use? - Near(NearArgs), -} - -#[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] -pub struct NearArgs { - #[interactive_clap(subcommand)] - pub cmd: NearCommand, -} - -#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] -#[strum_discriminants(derive(EnumMessage, EnumIter))] -#[interactive_clap(disable_back)] -/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) -pub enum NearCommand { - #[strum_discriminants(strum( - message = "build - Build a NEAR contract and optionally embed ABI" - ))] - /// Build a NEAR contract and optionally embed ABI - Build(self::build_command::BuildCommand), - #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] - /// Generates ABI for the contract - Abi(self::abi_command::AbiCommand), + opts: cargo_near::Opts, } fn main() -> CliResult { From 208157ca13c6a2c24f9ff07ef92c7b3c745c84b3 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Tue, 19 Sep 2023 21:00:20 +0300 Subject: [PATCH 07/15] fixed console command --- cargo-near/src/main.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index d5890484..bb00306e 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -31,6 +31,14 @@ fn main() -> CliResult { offline: false, }; + let console_command_path = if env::var("CARGO_HOME").is_ok() { + "cargo".to_string() + } else if let Ok(value) = env::var("CARGO") { + value.clone() + } else { + env::args().next().unwrap_or("./cargo".to_string()) + }; + loop { match ::from_cli( Some(cli.clone()), @@ -39,8 +47,7 @@ fn main() -> CliResult { interactive_clap::ResultFromCli::Ok(cli_cmd) | interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => { eprintln!( - "Your console command:\n{} {}", - std::env::args().next().as_deref().unwrap_or("./cargo-near"), + "Your console command:\n{console_command_path} {}", shell_words::join(cli_cmd.to_cli_args()) ); return Ok(()); @@ -53,8 +60,7 @@ fn main() -> CliResult { interactive_clap::ResultFromCli::Err(optional_cli_cmd, err) => { if let Some(cli_cmd) = optional_cli_cmd { eprintln!( - "Your console command:\n{} {}", - std::env::args().next().as_deref().unwrap_or("./cargo-near"), + "Your console command:\n{console_command_path} {}", shell_words::join(cli_cmd.to_cli_args()) ); } From 1e5587236e28b7e25e4c454bb1be0f92b4f35847 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Wed, 20 Sep 2023 15:27:05 +0300 Subject: [PATCH 08/15] changed "anyhow" to "color-eyre" --- Cargo.lock | 3 +- cargo-near/Cargo.toml | 1 - cargo-near/src/abi_command/abi.rs | 23 ++++---- cargo-near/src/abi_command/mod.rs | 2 +- cargo-near/src/build_command/build.rs | 6 +- cargo-near/src/build_command/mod.rs | 2 +- cargo-near/src/lib.rs | 6 +- cargo-near/src/types/manifest.rs | 17 +++--- cargo-near/src/types/metadata.rs | 10 ++-- cargo-near/src/util/mod.rs | 63 ++++++++++----------- cargo-near/src/util/print.rs | 4 +- integration-tests/Cargo.toml | 2 +- integration-tests/tests/abi/borsh_schema.rs | 20 +++---- integration-tests/tests/abi/callbacks.rs | 8 +-- integration-tests/tests/abi/e2e.rs | 2 +- integration-tests/tests/abi/json_schema.rs | 20 +++---- integration-tests/tests/abi/modifiers.rs | 10 ++-- integration-tests/tests/abi/negative.rs | 16 +++--- integration-tests/tests/abi/opts.rs | 6 +- integration-tests/tests/abi/result.rs | 6 +- integration-tests/tests/build/embed.rs | 4 +- integration-tests/tests/build/mod.rs | 2 +- integration-tests/tests/build/opts.rs | 18 +++--- integration-tests/tests/cargo/mod.rs | 22 +++---- integration-tests/tests/util.rs | 16 +++--- 25 files changed, 142 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7c13b7d..9f34bd86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -649,7 +649,6 @@ dependencies = [ name = "cargo-near" version = "0.3.1" dependencies = [ - "anyhow", "atty", "bs58 0.4.0", "camino", @@ -681,11 +680,11 @@ dependencies = [ name = "cargo-near-integration-tests" version = "0.1.0" dependencies = [ - "anyhow", "borsh 0.9.3", "camino", "cargo-near", "clap", + "color-eyre", "const_format", "function_name", "git2", diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index 4c838385..82c7c9ab 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -12,7 +12,6 @@ keywords = ["cargo", "near", "contract", "abi", "build"] categories = ["development-tools", "development-tools::cargo-plugins", "development-tools::build-utils", "command-line-utilities"] [dependencies] -anyhow = "1.0" bs58 = "0.4" camino = "1.1.1" cargo_metadata = "0.14" diff --git a/cargo-near/src/abi_command/abi.rs b/cargo-near/src/abi_command/abi.rs index 09c2f058..9a2cc161 100644 --- a/cargo-near/src/abi_command/abi.rs +++ b/cargo-near/src/abi_command/abi.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use std::fs; use camino::Utf8PathBuf; +use color_eyre::eyre::ContextCompat; use colored::Colorize; use near_abi::AbiRoot; @@ -32,7 +33,7 @@ pub(crate) fn generate_abi( generate_docs: bool, hide_warnings: bool, color: ColorPreference, -) -> anyhow::Result { +) -> color_eyre::eyre::Result { let root_node = crate_metadata .raw_metadata .resolve @@ -43,7 +44,7 @@ pub(crate) fn generate_abi( .iter() .find(|node| node.id == crate_metadata.root_package.id) }) - .ok_or_else(|| anyhow::anyhow!("unable to appropriately resolve the dependency graph, perhaps your `Cargo.toml` file is malformed"))?; + .wrap_err("unable to appropriately resolve the dependency graph, perhaps your `Cargo.toml` file is malformed")?; let near_sdk_dep = root_node .deps @@ -56,11 +57,11 @@ pub(crate) fn generate_abi( .iter() .find(|pkg| pkg.id == near_sdk.pkg) }) - .ok_or_else(|| anyhow::anyhow!("`near-sdk` dependency not found"))?; + .wrap_err("`near-sdk` dependency not found")?; for required_feature in ["__abi-generate", "__abi-embed"] { if !near_sdk_dep.features.contains_key(required_feature) { - anyhow::bail!("unsupported `near-sdk` version. expected 4.1.* or higher"); + color_eyre::eyre::bail!("unsupported `near-sdk` version. expected 4.1.* or higher"); } } @@ -69,7 +70,7 @@ pub(crate) fn generate_abi( .dependencies .iter() .find(|dep| dep.name == "near-sdk") - .ok_or_else(|| anyhow::anyhow!("`near-sdk` dependency not found"))?; + .wrap_err("`near-sdk` dependency not found")?; // `Dependency::features` return value does not contain default features, so we have to check // for default features separately. @@ -79,7 +80,7 @@ pub(crate) fn generate_abi( .iter() .any(|feature| feature == "abi") { - anyhow::bail!("`near-sdk` dependency must have the `abi` feature enabled") + color_eyre::eyre::bail!("`near-sdk` dependency must have the `abi` feature enabled") } util::print_step("Generating ABI"); @@ -98,10 +99,8 @@ pub(crate) fn generate_abi( let mut contract_abi = util::handle_step("Extracting ABI...", || { let abi_entries = util::extract_abi_entries(&dylib_artifact.path)?; - anyhow::Ok( - near_abi::__private::ChunkedAbiEntry::combine(abi_entries)? - .into_abi_root(extract_metadata(crate_metadata)), - ) + Ok(near_abi::__private::ChunkedAbiEntry::combine(abi_entries)? + .into_abi_root(extract_metadata(crate_metadata))) })?; if !generate_docs { @@ -116,7 +115,7 @@ pub(crate) fn write_to_file( crate_metadata: &CrateMetadata, format: AbiFormat, compression: AbiCompression, -) -> anyhow::Result { +) -> color_eyre::eyre::Result { let near_abi_serialized = match format { AbiFormat::Json => serde_json::to_vec_pretty(&contract_abi)?, AbiFormat::JsonMin => serde_json::to_vec(&contract_abi)?, @@ -177,7 +176,7 @@ fn strip_docs(abi_root: &mut near_abi::AbiRoot) { } } -pub(crate) fn run(args: super::AbiCommand) -> anyhow::Result<()> { +pub(crate) fn run(args: super::AbiCommand) -> near_cli_rs::CliResult { let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); diff --git a/cargo-near/src/abi_command/mod.rs b/cargo-near/src/abi_command/mod.rs index f6bb4e64..7f9ca8fc 100644 --- a/cargo-near/src/abi_command/mod.rs +++ b/cargo-near/src/abi_command/mod.rs @@ -71,7 +71,7 @@ impl interactive_clap::FromCli for AbiCommand { color, }; if let Err(err) = self::abi::run(args) { - interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::Report::msg(err)) + interactive_clap::ResultFromCli::Err(Some(clap_variant), color_eyre::eyre::eyre!(err)) } else { interactive_clap::ResultFromCli::Ok(clap_variant) } diff --git a/cargo-near/src/build_command/build.rs b/cargo-near/src/build_command/build.rs index 4f217944..65bdafc4 100644 --- a/cargo-near/src/build_command/build.rs +++ b/cargo-near/src/build_command/build.rs @@ -12,7 +12,7 @@ use crate::util; const COMPILATION_TARGET: &str = "wasm32-unknown-unknown"; -pub fn run(args: super::BuildCommand) -> anyhow::Result { +pub fn run(args: super::BuildCommand) -> color_eyre::eyre::Result { let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); @@ -21,7 +21,7 @@ pub fn run(args: super::BuildCommand) -> anyhow::Result anyhow::Result anyhow::Result<&Utf8Path> { - self.path.parent().ok_or_else(|| { - anyhow::anyhow!("Unable to infer the directory containing Cargo.toml file") - }) + pub fn directory(&self) -> color_eyre::eyre::Result<&Utf8Path> { + self.path + .parent() + .wrap_err("Unable to infer the directory containing Cargo.toml file") } } impl TryFrom for CargoManifestPath { - type Error = anyhow::Error; + type Error = color_eyre::eyre::ErrReport; fn try_from(manifest_path: Utf8PathBuf) -> Result { if let Some(file_name) = manifest_path.file_name() { if file_name != MANIFEST_FILE_NAME { - anyhow::bail!("the manifest-path must be a path to a Cargo.toml file") + color_eyre::eyre::bail!("the manifest-path must be a path to a Cargo.toml file") } } let canonical_manifest_path = manifest_path.canonicalize_utf8().map_err(|err| match err .kind() { std::io::ErrorKind::NotFound => { - anyhow::anyhow!("manifest path `{}` does not exist", manifest_path) + color_eyre::eyre::eyre!("manifest path `{manifest_path}` does not exist") } - _ => err.into(), + _ => color_eyre::eyre::eyre!("Failed to derive a key from the master key: {err}"), })?; Ok(CargoManifestPath { path: canonical_manifest_path, diff --git a/cargo-near/src/types/metadata.rs b/cargo-near/src/types/metadata.rs index d36422eb..daf33c8d 100644 --- a/cargo-near/src/types/metadata.rs +++ b/cargo-near/src/types/metadata.rs @@ -1,8 +1,8 @@ use crate::types::manifest::CargoManifestPath; use crate::util; -use anyhow::{Context, Result}; use camino::Utf8PathBuf; use cargo_metadata::{MetadataCommand, Package}; +use color_eyre::eyre::{ContextCompat, WrapErr}; /// Relevant metadata obtained from Cargo.toml. #[derive(Debug)] @@ -15,7 +15,7 @@ pub(crate) struct CrateMetadata { impl CrateMetadata { /// Parses the contract manifest and returns relevant metadata. - pub fn collect(manifest_path: CargoManifestPath) -> Result { + pub fn collect(manifest_path: CargoManifestPath) -> color_eyre::eyre::Result { let (mut metadata, root_package) = get_cargo_metadata(&manifest_path)?; metadata.target_directory = util::force_canonicalize_dir(&metadata.target_directory)?; @@ -47,16 +47,16 @@ impl CrateMetadata { /// Get the result of `cargo metadata`, together with the root package id. fn get_cargo_metadata( manifest_path: &CargoManifestPath, -) -> Result<(cargo_metadata::Metadata, Package)> { +) -> color_eyre::eyre::Result<(cargo_metadata::Metadata, Package)> { log::info!("Fetching cargo metadata for {}", manifest_path.path); let mut cmd = MetadataCommand::new(); let metadata = cmd .manifest_path(&manifest_path.path) .exec() - .context("Error invoking `cargo metadata`. Your `Cargo.toml` file is likely malformed")?; + .wrap_err("Error invoking `cargo metadata`. Your `Cargo.toml` file is likely malformed")?; let root_package = metadata .root_package() - .context("Error invoking `cargo metadata`. Your `Cargo.toml` file is likely malformed")? + .wrap_err("Error invoking `cargo metadata`. Your `Cargo.toml` file is likely malformed")? .clone(); Ok((metadata, root_package)) } diff --git a/cargo-near/src/util/mod.rs b/cargo-near/src/util/mod.rs index d5f1c9cc..7478bcd0 100644 --- a/cargo-near/src/util/mod.rs +++ b/cargo-near/src/util/mod.rs @@ -5,9 +5,9 @@ use std::io::{BufRead, BufReader}; use std::process::Command; use std::{env, thread}; -use anyhow::{Context, Result}; use camino::{Utf8Path, Utf8PathBuf}; use cargo_metadata::{Artifact, Message}; +use color_eyre::eyre::{ContextCompat, WrapErr}; use crate::common::ColorPreference; use crate::types::manifest::CargoManifestPath; @@ -40,7 +40,7 @@ fn invoke_cargo( working_dir: Option

, env: E, color: ColorPreference, -) -> Result> +) -> color_eyre::eyre::Result> where A: IntoIterator, P: AsRef, @@ -76,18 +76,18 @@ where .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()) .spawn() - .context(format!("Error executing `{:?}`", cmd))?; + .wrap_err_with(|| format!("Error executing `{:?}`", cmd))?; let child_stdout = child .stdout .take() - .context("could not attach to child stdout")?; + .wrap_err("could not attach to child stdout")?; let child_stderr = child .stderr .take() - .context("could not attach to child stderr")?; + .wrap_err("could not attach to child stderr")?; // stdout and stderr have to be processed concurrently to not block the process from progressing - let thread_stdout = thread::spawn(move || -> Result<_, std::io::Error> { + let thread_stdout = thread::spawn(move || -> color_eyre::eyre::Result<_, std::io::Error> { let mut artifacts = vec![]; let stdout_reader = std::io::BufReader::new(child_stdout); for message in Message::parse_stream(stdout_reader) { @@ -124,11 +124,11 @@ where if output.success() { Ok(result?) } else { - anyhow::bail!("`{:?}` failed with exit code: {:?}", cmd, output.code()); + color_eyre::eyre::bail!("`{:?}` failed with exit code: {:?}", cmd, output.code()); } } -pub(crate) fn invoke_rustup(args: I) -> anyhow::Result> +pub(crate) fn invoke_rustup(args: I) -> color_eyre::eyre::Result> where I: IntoIterator, S: AsRef, @@ -143,13 +143,13 @@ where let child = cmd .stdout(std::process::Stdio::piped()) .spawn() - .context(format!("Error executing `{:?}`", cmd))?; + .wrap_err_with(|| format!("Error executing `{:?}`", cmd))?; let output = child.wait_with_output()?; if output.status.success() { Ok(output.stdout) } else { - anyhow::bail!( + color_eyre::eyre::bail!( "`{:?}` failed with exit code: {:?}", cmd, output.status.code() @@ -170,7 +170,7 @@ pub(crate) fn compile_project( artifact_extension: &str, hide_warnings: bool, color: ColorPreference, -) -> anyhow::Result { +) -> color_eyre::eyre::Result { let mut final_env = BTreeMap::new(); if hide_warnings { @@ -204,12 +204,10 @@ pub(crate) fn compile_project( // We find the last compiler artifact message which should contain information about the // resulting dylib file - let compile_artifact = artifacts.last().ok_or_else(|| { - anyhow::anyhow!( - "Cargo failed to produce any compilation artifacts. \ - Please check that your project contains a NEAR smart contract." - ) - })?; + let compile_artifact = artifacts.last().wrap_err( + "Cargo failed to produce any compilation artifacts. \ + Please check that your project contains a NEAR smart contract.", + )?; // The project could have generated many auxiliary files, we are only interested in // dylib files with a specific (platform-dependent) extension let dylib_files = compile_artifact @@ -224,45 +222,44 @@ pub(crate) fn compile_project( .collect(); let mut dylib_files_iter = Vec::into_iter(dylib_files); match (dylib_files_iter.next(), dylib_files_iter.next()) { - (None, None) => Err(anyhow::anyhow!( - "Compilation resulted in no '.{}' target files. \ - Please check that your project contains a NEAR smart contract.", - artifact_extension - )), + (None, None) => color_eyre::eyre::bail!( + "Compilation resulted in no '.{artifact_extension}' target files. \ + Please check that your project contains a NEAR smart contract." + ), (Some(path), None) => Ok(CompilationArtifact { path, fresh: !compile_artifact.fresh, }), - _ => Err(anyhow::anyhow!( + _ => color_eyre::eyre::bail!( "Compilation resulted in more than one '.{}' target file: {:?}", artifact_extension, dylib_files_iter.as_slice() - )), + ), } } /// Create the directory if it doesn't exist, and return the absolute path to it. -pub(crate) fn force_canonicalize_dir(dir: &Utf8Path) -> anyhow::Result { - fs::create_dir_all(dir).with_context(|| format!("failed to create directory `{}`", dir))?; +pub(crate) fn force_canonicalize_dir(dir: &Utf8Path) -> color_eyre::eyre::Result { + fs::create_dir_all(dir).wrap_err_with(|| format!("failed to create directory `{}`", dir))?; dir.canonicalize_utf8() - .with_context(|| format!("failed to access output directory `{}`", dir)) + .wrap_err_with(|| format!("failed to access output directory `{}`", dir)) } /// Copy a file to a destination. /// /// Does nothing if the destination is the same as the source to avoid truncating the file. -pub(crate) fn copy(from: &Utf8Path, to: &Utf8Path) -> anyhow::Result { +pub(crate) fn copy(from: &Utf8Path, to: &Utf8Path) -> color_eyre::eyre::Result { let out_path = to.join(from.file_name().unwrap()); if from != out_path { fs::copy(from, &out_path) - .with_context(|| format!("failed to copy `{}` to `{}`", from, out_path))?; + .wrap_err_with(|| format!("failed to copy `{}` to `{}`", from, out_path))?; } Ok(out_path) } pub(crate) fn extract_abi_entries( dylib_path: &Utf8Path, -) -> anyhow::Result> { +) -> color_eyre::eyre::Result> { let dylib_file_contents = fs::read(dylib_path)?; let object = symbolic_debuginfo::Object::parse(&dylib_file_contents)?; log::debug!( @@ -277,7 +274,7 @@ pub(crate) fn extract_abi_entries( .filter(|sym_name| sym_name.starts_with("__near_abi_")) .collect::>(); if near_abi_symbols.is_empty() { - anyhow::bail!("No NEAR ABI symbols found in the dylib"); + color_eyre::eyre::bail!("No NEAR ABI symbols found in the dylib"); } log::debug!("Detected NEAR ABI symbols: {:?}", &near_abi_symbols); @@ -301,11 +298,11 @@ pub(crate) fn extract_abi_entries( { err_str.truncate(msg.len()); err_str.shrink_to_fit(); - anyhow::bail!(err_str); + color_eyre::eyre::bail!(err_str); } } } - anyhow::bail!(err); + color_eyre::eyre::bail!(err); } }; } diff --git a/cargo-near/src/util/print.rs b/cargo-near/src/util/print.rs index f8959c72..9d32aa66 100644 --- a/cargo-near/src/util/print.rs +++ b/cargo-near/src/util/print.rs @@ -1,8 +1,8 @@ use colored::Colorize; -pub(crate) fn handle_step(msg: &str, f: F) -> Result +pub(crate) fn handle_step(msg: &str, f: F) -> color_eyre::eyre::Result where - F: FnOnce() -> Result, + F: FnOnce() -> color_eyre::eyre::Result, { eprint!(" {} {}", "•".bold().cyan(), msg); let result = f(); diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 19280aaa..2b0122c2 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -9,10 +9,10 @@ const_format = "0.2" near-abi = "0.3.0" [dev-dependencies] -anyhow = "1.0" borsh = "0.9" camino = "1.1.1" cargo-near = { path = "../cargo-near" } +color-eyre = "0.6" clap = "4.0.18" function_name = "0.3" git2 = "0.14" diff --git a/integration-tests/tests/abi/borsh_schema.rs b/integration-tests/tests/abi/borsh_schema.rs index 312bf00b..4648dc79 100644 --- a/integration-tests/tests/abi/borsh_schema.rs +++ b/integration-tests/tests/abi/borsh_schema.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; #[test] #[named] -fn test_borsh_schema_numeric_primitives_signed() -> anyhow::Result<()> { +fn test_borsh_schema_numeric_primitives_signed() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -58,7 +58,7 @@ fn test_borsh_schema_numeric_primitives_signed() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_numeric_primitives_unsigned() -> anyhow::Result<()> { +fn test_borsh_schema_numeric_primitives_unsigned() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -110,7 +110,7 @@ fn test_borsh_schema_numeric_primitives_unsigned() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_numeric_primitives_float() -> anyhow::Result<()> { +fn test_borsh_schema_numeric_primitives_float() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, #[serializer(borsh)] a: f32, #[serializer(borsh)] b: f64) {} }; @@ -135,7 +135,7 @@ fn test_borsh_schema_numeric_primitives_float() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_string() -> anyhow::Result<()> { +fn test_borsh_schema_string() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, #[serializer(borsh)] a: String, #[serializer(borsh)] b: &str, #[serializer(borsh)] c: &'static str) {} }; @@ -157,7 +157,7 @@ fn test_borsh_schema_string() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_other_primitives() -> anyhow::Result<()> { +fn test_borsh_schema_other_primitives() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, #[serializer(borsh)] b: bool, #[serializer(borsh)] c: ()) {} }; @@ -187,7 +187,7 @@ fn test_borsh_schema_other_primitives() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_tuples() -> anyhow::Result<()> { +fn test_borsh_schema_tuples() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -231,7 +231,7 @@ fn test_borsh_schema_tuples() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_arrays() -> anyhow::Result<()> { +fn test_borsh_schema_arrays() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -283,7 +283,7 @@ fn test_borsh_schema_arrays() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_struct() -> anyhow::Result<()> { +fn test_borsh_schema_struct() -> cargo_near::CliResult { let abi_root = generate_abi! { // fixme! remove after borsh fixes trait qualification // fixme! https://github.com/near/borsh-rs/issues/112 @@ -346,7 +346,7 @@ fn test_borsh_schema_struct() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_enum() -> anyhow::Result<()> { +fn test_borsh_schema_enum() -> cargo_near::CliResult { let abi_root = generate_abi! { // fixme! remove after borsh fixes trait qualification // fixme! https://github.com/near/borsh-rs/issues/112 @@ -448,7 +448,7 @@ fn test_borsh_schema_enum() -> anyhow::Result<()> { #[test] #[named] -fn test_borsh_schema_complex() -> anyhow::Result<()> { +fn test_borsh_schema_complex() -> cargo_near::CliResult { let abi_root = generate_abi! { // fixme! remove after borsh fixes trait qualification // fixme! https://github.com/near/borsh-rs/issues/112 diff --git a/integration-tests/tests/abi/callbacks.rs b/integration-tests/tests/abi/callbacks.rs index 9063f511..5a068aa0 100644 --- a/integration-tests/tests/abi/callbacks.rs +++ b/integration-tests/tests/abi/callbacks.rs @@ -7,7 +7,7 @@ use crate::util::AsJsonSchema; #[test] #[named] -fn test_callbacks_unwrapped() -> anyhow::Result<()> { +fn test_callbacks_unwrapped() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, #[callback_unwrap] a: bool, #[callback_unwrap] b: u32) {} }; @@ -37,7 +37,7 @@ fn test_callbacks_unwrapped() -> anyhow::Result<()> { #[test] #[named] -fn test_callbacks_result() -> anyhow::Result<()> { +fn test_callbacks_result() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -71,7 +71,7 @@ fn test_callbacks_result() -> anyhow::Result<()> { #[test] #[named] -fn test_callbacks_vec() -> anyhow::Result<()> { +fn test_callbacks_vec() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, @@ -105,7 +105,7 @@ fn test_callbacks_vec() -> anyhow::Result<()> { #[test] #[named] -fn test_callbacks_mixed_with_params() -> anyhow::Result<()> { +fn test_callbacks_mixed_with_params() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo( &self, diff --git a/integration-tests/tests/abi/e2e.rs b/integration-tests/tests/abi/e2e.rs index 373c1c1d..f4358107 100644 --- a/integration-tests/tests/abi/e2e.rs +++ b/integration-tests/tests/abi/e2e.rs @@ -5,7 +5,7 @@ use schemars::gen::SchemaGenerator; #[test] #[named] -fn test_simple_function() -> anyhow::Result<()> { +fn test_simple_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn add(&self, a: u32, b: u32) -> u32 { a + b diff --git a/integration-tests/tests/abi/json_schema.rs b/integration-tests/tests/abi/json_schema.rs index 4d3aec37..1eee10d1 100644 --- a/integration-tests/tests/abi/json_schema.rs +++ b/integration-tests/tests/abi/json_schema.rs @@ -5,7 +5,7 @@ use schemars::schema::Schema; #[test] #[named] -fn test_schema_numeric_primitives_signed() -> anyhow::Result<()> { +fn test_schema_numeric_primitives_signed() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: i8, b: i16, c: i32, d: i64, e: i128, f: isize) {} }; @@ -79,7 +79,7 @@ fn test_schema_numeric_primitives_signed() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_numeric_primitives_unsigned() -> anyhow::Result<()> { +fn test_schema_numeric_primitives_unsigned() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: u8, b: u16, c: u32, d: u64, e: u128, f: usize) {} }; @@ -159,7 +159,7 @@ fn test_schema_numeric_primitives_unsigned() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_numeric_primitives_float() -> anyhow::Result<()> { +fn test_schema_numeric_primitives_float() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: f32, b: f64) {} }; @@ -197,7 +197,7 @@ fn test_schema_numeric_primitives_float() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_string() -> anyhow::Result<()> { +fn test_schema_string() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: String, b: &str, c: &'static str) {} }; @@ -222,7 +222,7 @@ fn test_schema_string() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_other_primitives() -> anyhow::Result<()> { +fn test_schema_other_primitives() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: char, b: bool, c: ()) {} }; @@ -263,7 +263,7 @@ fn test_schema_other_primitives() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_tuples() -> anyhow::Result<()> { +fn test_schema_tuples() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: (bool,), b: (bool, bool), c: (bool, bool, bool)) {} }; @@ -332,7 +332,7 @@ fn test_schema_tuples() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_arrays() -> anyhow::Result<()> { +fn test_schema_arrays() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self, a: [bool; 8], b: [bool; 16], c: &[bool]) {} }; @@ -384,7 +384,7 @@ fn test_schema_arrays() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_struct() -> anyhow::Result<()> { +fn test_schema_struct() -> cargo_near::CliResult { let abi_root = generate_abi! { use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::{near_bindgen, NearSchema}; @@ -489,7 +489,7 @@ fn test_schema_struct() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_enum() -> anyhow::Result<()> { +fn test_schema_enum() -> cargo_near::CliResult { let abi_root = generate_abi! { use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::{near_bindgen, NearSchema}; @@ -621,7 +621,7 @@ fn test_schema_enum() -> anyhow::Result<()> { #[test] #[named] -fn test_schema_complex() -> anyhow::Result<()> { +fn test_schema_complex() -> cargo_near::CliResult { let abi_root = generate_abi! { use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::{near_bindgen, NearSchema}; diff --git a/integration-tests/tests/abi/modifiers.rs b/integration-tests/tests/abi/modifiers.rs index fa1e5b0a..e3e3bfc2 100644 --- a/integration-tests/tests/abi/modifiers.rs +++ b/integration-tests/tests/abi/modifiers.rs @@ -4,7 +4,7 @@ use near_abi::{AbiFunctionKind, AbiFunctionModifier}; #[test] #[named] -fn test_view_function() -> anyhow::Result<()> { +fn test_view_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn add(&self, a: u32, b: u32) -> u32 { a + b @@ -21,7 +21,7 @@ fn test_view_function() -> anyhow::Result<()> { #[test] #[named] -fn test_call_function() -> anyhow::Result<()> { +fn test_call_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn add(&mut self, a: u32, b: u32) -> u32 { a + b @@ -38,7 +38,7 @@ fn test_call_function() -> anyhow::Result<()> { #[test] #[named] -fn test_init_function() -> anyhow::Result<()> { +fn test_init_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { #[init] pub fn add(a: u32, b: u32) -> Self { @@ -57,7 +57,7 @@ fn test_init_function() -> anyhow::Result<()> { #[test] #[named] -fn test_payable_function() -> anyhow::Result<()> { +fn test_payable_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { #[payable] pub fn add(&mut self, a: u32, b: u32) -> u32 { @@ -75,7 +75,7 @@ fn test_payable_function() -> anyhow::Result<()> { #[test] #[named] -fn test_private_function() -> anyhow::Result<()> { +fn test_private_function() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { #[private] pub fn add(&mut self, a: u32, b: u32) -> u32 { diff --git a/integration-tests/tests/abi/negative.rs b/integration-tests/tests/abi/negative.rs index d0b60ea1..0dfa7298 100644 --- a/integration-tests/tests/abi/negative.rs +++ b/integration-tests/tests/abi/negative.rs @@ -3,8 +3,8 @@ use function_name::named; #[test] #[named] -fn test_abi_feature_not_enabled() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_abi_feature_not_enabled() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { generate_abi_fn_with! { Cargo: "/templates/negative/_Cargo_no_abi_feature.toml"; Code: @@ -23,8 +23,8 @@ fn test_abi_feature_not_enabled() -> anyhow::Result<()> { #[test] #[named] -fn test_abi_old_sdk() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_abi_old_sdk() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { generate_abi_fn_with! { Cargo: "/templates/negative/_Cargo_old_sdk.toml"; Code: @@ -43,8 +43,8 @@ fn test_abi_old_sdk() -> anyhow::Result<()> { #[test] #[named] -fn test_abi_weird_version() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_abi_weird_version() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { generate_abi_fn_with! { Cargo: "/templates/negative/_Cargo_malformed.toml"; Code: @@ -68,8 +68,8 @@ fn test_abi_weird_version() -> anyhow::Result<()> { // with no code should work. #[test] #[named] -fn test_abi_no_code() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_abi_no_code() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { generate_abi_fn! {}; Ok(()) } diff --git a/integration-tests/tests/abi/opts.rs b/integration-tests/tests/abi/opts.rs index d7560141..675eec74 100644 --- a/integration-tests/tests/abi/opts.rs +++ b/integration-tests/tests/abi/opts.rs @@ -4,7 +4,7 @@ use std::fs; #[test] #[named] -fn test_abi_opt_doc() -> anyhow::Result<()> { +fn test_abi_opt_doc() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Opts: "--doc"; Code: @@ -23,7 +23,7 @@ fn test_abi_opt_doc() -> anyhow::Result<()> { #[test] #[named] -fn test_abi_opt_compact_abi() -> anyhow::Result<()> { +fn test_abi_opt_compact_abi() -> cargo_near::CliResult { generate_abi_fn_with! { Opts: "--compact-abi"; Code: @@ -52,7 +52,7 @@ fn test_abi_opt_compact_abi() -> anyhow::Result<()> { #[test] #[named] -fn test_abi_opt_out_dir() -> anyhow::Result<()> { +fn test_abi_opt_out_dir() -> cargo_near::CliResult { let out_dir = tempfile::tempdir()?; let abi_root = generate_abi_fn_with! { Opts: format!("--out-dir {}", out_dir.path().display()); diff --git a/integration-tests/tests/abi/result.rs b/integration-tests/tests/abi/result.rs index 520005bf..fc580258 100644 --- a/integration-tests/tests/abi/result.rs +++ b/integration-tests/tests/abi/result.rs @@ -5,7 +5,7 @@ use schemars::gen::SchemaGenerator; #[test] #[named] -fn test_result_default() -> anyhow::Result<()> { +fn test_result_default() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self) {} }; @@ -19,7 +19,7 @@ fn test_result_default() -> anyhow::Result<()> { #[test] #[named] -fn test_result_type() -> anyhow::Result<()> { +fn test_result_type() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { pub fn foo(&self) -> u32 { 1 @@ -41,7 +41,7 @@ fn test_result_type() -> anyhow::Result<()> { #[test] #[named] -fn test_result_handle_result() -> anyhow::Result<()> { +fn test_result_handle_result() -> cargo_near::CliResult { let abi_root = generate_abi_fn! { #[handle_result] pub fn foo(&self) -> Result { diff --git a/integration-tests/tests/build/embed.rs b/integration-tests/tests/build/embed.rs index 49f924b1..c42af6a9 100644 --- a/integration-tests/tests/build/embed.rs +++ b/integration-tests/tests/build/embed.rs @@ -5,7 +5,7 @@ use workspaces::prelude::DevAccountDeployer; #[tokio::test] #[named] -async fn test_build_embed_abi() -> anyhow::Result<()> { +async fn test_build_embed_abi() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--embed-abi"; Code: @@ -33,7 +33,7 @@ async fn test_build_embed_abi() -> anyhow::Result<()> { #[tokio::test] #[named] -async fn test_build_no_embed_abi() -> anyhow::Result<()> { +async fn test_build_no_embed_abi() -> cargo_near::CliResult { let build_result = build_fn! { pub fn add(&self, a: u32, b: u32) -> u32 { a + b diff --git a/integration-tests/tests/build/mod.rs b/integration-tests/tests/build/mod.rs index 2451e4c8..94bb3d1f 100644 --- a/integration-tests/tests/build/mod.rs +++ b/integration-tests/tests/build/mod.rs @@ -7,7 +7,7 @@ mod opts; #[tokio::test] #[named] -async fn test_build_simple() -> anyhow::Result<()> { +async fn test_build_simple() -> cargo_near::CliResult { let build_result = build_fn! { /// Adds `a` and `b`. pub fn add(&self, a: u32, b: u32) -> u32 { diff --git a/integration-tests/tests/build/opts.rs b/integration-tests/tests/build/opts.rs index 24db5c48..70ff17c1 100644 --- a/integration-tests/tests/build/opts.rs +++ b/integration-tests/tests/build/opts.rs @@ -5,7 +5,7 @@ use std::fs; #[test] #[named] -fn test_build_no_abi() -> anyhow::Result<()> { +fn test_build_no_abi() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--no-abi"; Code: @@ -21,7 +21,7 @@ fn test_build_no_abi() -> anyhow::Result<()> { #[test] #[named] -fn test_build_opt_doc() -> anyhow::Result<()> { +fn test_build_opt_doc() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--doc"; Code: @@ -41,7 +41,7 @@ fn test_build_opt_doc() -> anyhow::Result<()> { #[test] #[named] -fn test_build_opt_out_dir() -> anyhow::Result<()> { +fn test_build_opt_out_dir() -> cargo_near::CliResult { let out_dir = tempfile::tempdir()?; let build_result = build_fn_with! { Opts: format!("--out-dir {}", out_dir.path().display()); @@ -66,7 +66,7 @@ fn test_build_opt_out_dir() -> anyhow::Result<()> { #[tokio::test] #[named] -async fn test_build_opt_release() -> anyhow::Result<()> { +async fn test_build_opt_release() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--release"; Code: @@ -85,7 +85,7 @@ async fn test_build_opt_release() -> anyhow::Result<()> { #[tokio::test] #[named] -async fn test_build_opt_doc_embed() -> anyhow::Result<()> { +async fn test_build_opt_doc_embed() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--doc --embed-abi"; Code: @@ -112,8 +112,8 @@ async fn test_build_opt_doc_embed() -> anyhow::Result<()> { #[test] #[named] -fn test_build_opt_no_abi_doc() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_build_opt_no_abi_doc() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { build_fn_with! { Opts: "--no-abi --doc"; Code: @@ -134,8 +134,8 @@ fn test_build_opt_no_abi_doc() -> anyhow::Result<()> { #[test] #[named] -fn test_build_opt_no_abi_embed() -> anyhow::Result<()> { - fn run_test() -> anyhow::Result<()> { +fn test_build_opt_no_abi_embed() -> cargo_near::CliResult { + fn run_test() -> cargo_near::CliResult { build_fn_with! { Opts: "--no-abi --embed-abi"; Code: diff --git a/integration-tests/tests/cargo/mod.rs b/integration-tests/tests/cargo/mod.rs index ae3fffef..60fa3c9b 100644 --- a/integration-tests/tests/cargo/mod.rs +++ b/integration-tests/tests/cargo/mod.rs @@ -7,7 +7,7 @@ use tempfile::TempDir; use crate::util::AsJsonSchema; -fn clone_git_repo() -> anyhow::Result { +fn clone_git_repo() -> color_eyre::eyre::Result { let temp_dir = tempfile::tempdir()?; let repo_dir = temp_dir.path(); let repo = Repository::clone("https://github.com/near/near-sdk-rs", repo_dir)?; @@ -19,7 +19,7 @@ fn clone_git_repo() -> anyhow::Result { #[test] #[named] -fn test_dependency_local_path() -> anyhow::Result<()> { +fn test_dependency_local_path() -> cargo_near::CliResult { let near_sdk_dir = clone_git_repo()?; let near_sdk_dep_path = near_sdk_dir.path().join("near-sdk"); @@ -41,7 +41,7 @@ fn test_dependency_local_path() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_local_path_with_version() -> anyhow::Result<()> { +fn test_dependency_local_path_with_version() -> cargo_near::CliResult { let near_sdk_dir = clone_git_repo()?; let near_sdk_dep_path = near_sdk_dir.path().join("near-sdk"); @@ -62,7 +62,7 @@ fn test_dependency_local_path_with_version() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_default_features() -> anyhow::Result<()> { +fn test_dependency_default_features() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/_Cargo.toml"; Code: @@ -79,7 +79,7 @@ fn test_dependency_default_features() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_explicit() -> anyhow::Result<()> { +fn test_dependency_explicit() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/sdk-dependency/_Cargo_explicit.toml"; Code: @@ -96,7 +96,7 @@ fn test_dependency_explicit() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_no_default_features() -> anyhow::Result<()> { +fn test_dependency_no_default_features() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/sdk-dependency/_Cargo_no_default_features.toml"; Code: @@ -113,7 +113,7 @@ fn test_dependency_no_default_features() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_multiple_features() -> anyhow::Result<()> { +fn test_dependency_multiple_features() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/sdk-dependency/_Cargo_multiple_features.toml"; Code: @@ -130,7 +130,7 @@ fn test_dependency_multiple_features() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_platform_specific() -> anyhow::Result<()> { +fn test_dependency_platform_specific() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/sdk-dependency/_Cargo_platform_specific.toml"; Code: @@ -149,7 +149,7 @@ fn test_dependency_platform_specific() -> anyhow::Result<()> { #[ignore] #[test] #[named] -fn test_dependency_renamed() -> anyhow::Result<()> { +fn test_dependency_renamed() -> cargo_near::CliResult { let abi_root = generate_abi_with! { Cargo: "/templates/sdk-dependency/_Cargo_renamed.toml"; Code: @@ -176,7 +176,7 @@ fn test_dependency_renamed() -> anyhow::Result<()> { #[test] #[named] -fn test_dependency_patch() -> anyhow::Result<()> { +fn test_dependency_patch() -> cargo_near::CliResult { // [dependencies] // near-sdk = "4.0.0" // @@ -200,7 +200,7 @@ fn test_dependency_patch() -> anyhow::Result<()> { #[ignore] #[test] #[named] -fn test_abi_not_a_table() -> anyhow::Result<()> { +fn test_abi_not_a_table() -> cargo_near::CliResult { let abi_root = generate_abi_fn_with! { Cargo: "/templates/sdk-dependency/_Cargo_not_a_table.toml"; Code: diff --git a/integration-tests/tests/util.rs b/integration-tests/tests/util.rs index 0cdfcb22..42048a90 100644 --- a/integration-tests/tests/util.rs +++ b/integration-tests/tests/util.rs @@ -4,7 +4,7 @@ use serde_json::json; use workspaces::prelude::DevAccountDeployer; /// Utility method to test that the `add` function is available and works as intended -pub async fn test_add(wasm: &[u8]) -> anyhow::Result<()> { +pub async fn test_add(wasm: &[u8]) -> cargo_near::CliResult { let worker = workspaces::sandbox().await?; let contract = worker.dev_deploy(wasm).await?; let outcome = contract @@ -19,7 +19,7 @@ pub async fn test_add(wasm: &[u8]) -> anyhow::Result<()> { Ok(()) } -pub async fn fetch_contract_abi(wasm: &[u8]) -> anyhow::Result { +pub async fn fetch_contract_abi(wasm: &[u8]) -> color_eyre::eyre::Result { let worker = workspaces::sandbox().await?; let contract = worker.dev_deploy(wasm).await?; let outcome = contract.call(&worker, "__contract_abi").view().await?; @@ -28,29 +28,29 @@ pub async fn fetch_contract_abi(wasm: &[u8]) -> anyhow::Result { } pub trait AsBorshSchema { - fn borsh_schemas(&self) -> anyhow::Result<&Vec>; + fn borsh_schemas(&self) -> color_eyre::eyre::Result<&Vec>; } impl AsBorshSchema for AbiParameters { - fn borsh_schemas(&self) -> anyhow::Result<&Vec> { + fn borsh_schemas(&self) -> color_eyre::eyre::Result<&Vec> { if let AbiParameters::Borsh { args } = &self { Ok(args) } else { - anyhow::bail!("Expected Borsh serialization type, but got {:?}", self) + color_eyre::eyre::bail!("Expected Borsh serialization type, but got {:?}", self) } } } pub trait AsJsonSchema { - fn json_schemas(&self) -> anyhow::Result<&Vec>; + fn json_schemas(&self) -> color_eyre::eyre::Result<&Vec>; } impl AsJsonSchema for AbiParameters { - fn json_schemas(&self) -> anyhow::Result<&Vec> { + fn json_schemas(&self) -> color_eyre::eyre::Result<&Vec> { if let AbiParameters::Json { args } = &self { Ok(args) } else { - anyhow::bail!("Expected JSON serialization type, but got {:?}", self) + color_eyre::eyre::bail!("Expected JSON serialization type, but got {:?}", self) } } } From ed61413952eca9630e2f0a7e5829f08e71bcad77 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Thu, 21 Sep 2023 15:27:07 +0300 Subject: [PATCH 09/15] fixed tests --- Cargo.lock | 437 +++---------------------- cargo-near/src/abi_command/abi.rs | 2 +- cargo-near/src/abi_command/mod.rs | 8 +- cargo-near/src/build_command/mod.rs | 10 +- cargo-near/src/lib.rs | 13 +- cargo-near/src/main.rs | 7 +- cargo-near/src/types/utf8_path_buf.rs | 8 +- integration-tests/Cargo.toml | 2 +- integration-tests/src/lib.rs | 36 +- integration-tests/tests/build/embed.rs | 3 +- integration-tests/tests/util.rs | 7 +- 11 files changed, 108 insertions(+), 425 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f34bd86..2353cc44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,7 @@ checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "futures-lite", "log", @@ -228,7 +228,7 @@ dependencies = [ "async-lock", "autocfg", "blocking", - "cfg-if 1.0.0", + "cfg-if", "event-listener", "futures-lite", "rustix 0.37.20", @@ -306,19 +306,13 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - [[package]] name = "base64" version = "0.13.0" @@ -379,28 +373,16 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" -[[package]] -name = "bitvec" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" -dependencies = [ - "funty 1.1.0", - "radium 0.6.2", - "tap", - "wyz 0.2.0", -] - [[package]] name = "bitvec" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "funty 2.0.0", - "radium 0.7.0", + "funty", + "radium", "tap", - "wyz 0.5.0", + "wyz", ] [[package]] @@ -486,7 +468,7 @@ checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "syn 1.0.99", ] @@ -499,7 +481,7 @@ checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "syn 1.0.99", ] @@ -578,12 +560,6 @@ version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - [[package]] name = "byteorder" version = "1.4.3" @@ -755,12 +731,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -979,7 +949,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -988,7 +958,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -998,7 +968,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -1270,7 +1240,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -1395,7 +1365,7 @@ version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1517,7 +1487,7 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.2.16", "windows-sys 0.36.1", @@ -1529,9 +1499,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", "static_assertions", ] @@ -1607,12 +1574,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673464e1e314dd67a0fd9544abc99e8eb28d0c7e3b69b033bcff9b2d00b87333" -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - [[package]] name = "funty" version = "2.0.0" @@ -1739,7 +1700,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1750,7 +1711,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -2030,26 +1991,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "impl-codec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", -] - [[package]] name = "indent_write" version = "2.2.0" @@ -2119,7 +2060,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2136,7 +2077,7 @@ dependencies = [ [[package]] name = "interactive-clap" version = "0.2.4" -source = "git+https://github.com/near-cli-rs/interactive-clap#2cc575c8de3c8745f513f2f07261dd1ba437fdd0" +source = "git+https://github.com/near-cli-rs/interactive-clap#2df6182314bda4f228ec06fbc78bd47f87671cbb" dependencies = [ "interactive-clap-derive 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", "strum", @@ -2158,7 +2099,7 @@ dependencies = [ [[package]] name = "interactive-clap-derive" version = "0.2.4" -source = "git+https://github.com/near-cli-rs/interactive-clap#2cc575c8de3c8745f513f2f07261dd1ba437fdd0" +source = "git+https://github.com/near-cli-rs/interactive-clap#2df6182314bda4f228ec06fbc78bd47f87671cbb" dependencies = [ "proc-macro-error", "proc-macro2", @@ -2307,7 +2248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45ba81a1f5f24396b37211478aff7fbcd605dd4544df8dbed07b9da3c2057aee" dependencies = [ "byteorder", - "cfg-if 1.0.0", + "cfg-if", "hex 0.4.3", "hidapi", "ledger-transport", @@ -2342,7 +2283,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -2409,7 +2350,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2526,16 +2467,6 @@ dependencies = [ "serde", ] -[[package]] -name = "near-account-id" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" -dependencies = [ - "borsh 0.9.3", - "serde", -] - [[package]] name = "near-account-id" version = "0.15.0" @@ -2556,25 +2487,6 @@ dependencies = [ "serde", ] -[[package]] -name = "near-chain-configs" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3632a1c691603cb32dd9944c95d8eadbf2c09f45abd95350ea6848c649036a0b" -dependencies = [ - "anyhow", - "chrono", - "derive_more", - "near-crypto 0.14.0", - "near-primitives 0.14.0", - "num-rational", - "serde", - "serde_json", - "sha2 0.10.3", - "smart-default 0.6.0", - "tracing", -] - [[package]] name = "near-chain-configs" version = "0.15.0" @@ -2616,29 +2528,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-chain-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a734353027698b21633a49d478e564c61ae0171c32f6912bb8844add15d72ebe" -dependencies = [ - "chrono", - "near-crypto 0.14.0", - "near-primitives 0.14.0", - "thiserror", - "tracing", -] - -[[package]] -name = "near-chunks-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17f6f22f1ab710731dfba4101f12a99cac120d6af80b99899bd335bb8971477" -dependencies = [ - "near-chain-primitives", - "near-primitives 0.14.0", -] - [[package]] name = "near-cli-rs" version = "0.5.2" @@ -2687,26 +2576,6 @@ dependencies = [ "url", ] -[[package]] -name = "near-client-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1065d86012eeea838661434549f33bb6267c9950fd2aadd2af617fe773def38" -dependencies = [ - "actix", - "chrono", - "near-chain-configs 0.14.0", - "near-chain-primitives", - "near-chunks-primitives", - "near-crypto 0.14.0", - "near-network-primitives", - "near-primitives 0.14.0", - "serde", - "serde_json", - "strum", - "thiserror", -] - [[package]] name = "near-config-utils" version = "0.17.0" @@ -2719,32 +2588,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-crypto" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" -dependencies = [ - "arrayref", - "blake2", - "borsh 0.9.3", - "bs58 0.4.0", - "c2-chacha", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "near-account-id 0.14.0", - "once_cell", - "parity-secp256k1", - "primitive-types", - "rand 0.7.3", - "rand_core 0.5.1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - [[package]] name = "near-crypto" version = "0.15.0" @@ -2845,23 +2688,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-jsonrpc-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a14ee8ca393c0140cb232789259ebc61b13b4cceb177267d0131f50d0eda6c" -dependencies = [ - "near-chain-configs 0.14.0", - "near-client-primitives", - "near-crypto 0.14.0", - "near-primitives 0.14.0", - "near-rpc-error-macro 0.14.0", - "serde", - "serde_json", - "thiserror", - "uuid 0.8.2", -] - [[package]] name = "near-jsonrpc-primitives" version = "0.15.0" @@ -2906,24 +2732,6 @@ dependencies = [ "slip10", ] -[[package]] -name = "near-network-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa998a1e70ebf8cf3efa76c4562ef36038cc88b4aee60efb708d14273910357" -dependencies = [ - "actix", - "anyhow", - "borsh 0.9.3", - "chrono", - "near-crypto 0.14.0", - "near-primitives 0.14.0", - "serde", - "strum", - "tokio", - "tracing", -] - [[package]] name = "near-o11y" version = "0.17.0" @@ -2950,35 +2758,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "near-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" -dependencies = [ - "borsh 0.9.3", - "byteorder", - "bytesize", - "chrono", - "derive_more", - "easy-ext 0.2.9", - "hex 0.4.3", - "near-crypto 0.14.0", - "near-primitives-core 0.14.0", - "near-rpc-error-macro 0.14.0", - "near-vm-errors 0.14.0", - "num-rational", - "once_cell", - "primitive-types", - "rand 0.7.3", - "reed-solomon-erasure", - "serde", - "serde_json", - "smart-default 0.6.0", - "strum", - "thiserror", -] - [[package]] name = "near-primitives" version = "0.15.0" @@ -2988,7 +2767,7 @@ dependencies = [ "borsh 0.9.3", "byteorder", "bytesize", - "cfg-if 1.0.0", + "cfg-if", "chrono", "derive_more", "easy-ext 0.2.9", @@ -3018,7 +2797,7 @@ dependencies = [ "arbitrary", "borsh 0.10.3", "bytesize", - "cfg-if 1.0.0", + "cfg-if", "chrono", "derive_more", "easy-ext 0.2.9", @@ -3046,23 +2825,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-primitives-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" -dependencies = [ - "base64 0.11.0", - "borsh 0.9.3", - "bs58 0.4.0", - "derive_more", - "near-account-id 0.14.0", - "num-rational", - "serde", - "sha2 0.10.3", - "strum", -] - [[package]] name = "near-primitives-core" version = "0.15.0" @@ -3103,17 +2865,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-rpc-error-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" -dependencies = [ - "quote", - "serde", - "syn 1.0.99", -] - [[package]] name = "near-rpc-error-core" version = "0.15.0" @@ -3136,17 +2887,6 @@ dependencies = [ "syn 2.0.32", ] -[[package]] -name = "near-rpc-error-macro" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" -dependencies = [ - "near-rpc-error-core 0.14.0", - "serde", - "syn 1.0.99", -] - [[package]] name = "near-rpc-error-macro" version = "0.15.0" @@ -3172,14 +2912,15 @@ dependencies = [ [[package]] name = "near-sandbox-utils" -version = "0.4.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafbc6e0f88ba3c4dd41d947d6ef86367dc2d9b5e0112bde1a5ae8251a71b4f7" +checksum = "7479b0a2c52890000d410c6e4ba4f851334280530fa7446b78bcaf4683fe69b0" dependencies = [ "anyhow", "async-process", "binary-install", "chrono", + "fs2", "hex 0.3.2", "home", ] @@ -3190,18 +2931,6 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6540152fba5e96fe5d575b79e8cd244cf2add747bb01362426bdc069bc3a23bc" -[[package]] -name = "near-vm-errors" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" -dependencies = [ - "borsh 0.9.3", - "near-account-id 0.14.0", - "near-rpc-error-macro 0.14.0", - "serde", -] - [[package]] name = "near-vm-errors" version = "0.15.0" @@ -3381,7 +3110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -3494,44 +3223,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "parity-scale-codec" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" -dependencies = [ - "arrayvec 0.7.2", - "bitvec 0.20.4", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "parity-secp256k1" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" -dependencies = [ - "arrayvec 0.5.2", - "cc", - "cfg-if 0.1.10", - "rand 0.7.3", -] - [[package]] name = "parking" version = "2.1.0" @@ -3554,7 +3245,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.2.16", "smallvec", @@ -3655,7 +3346,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "libc", "log", @@ -3721,7 +3412,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" dependencies = [ "fixed-hash", - "impl-codec", "uint", ] @@ -3734,16 +3424,6 @@ dependencies = [ "toml 0.5.9", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -3783,7 +3463,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -3869,12 +3549,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - [[package]] name = "radium" version = "0.7.0" @@ -4088,12 +3762,6 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - [[package]] name = "rustc_version" version = "0.4.0" @@ -4431,7 +4099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -4443,7 +4111,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.3", ] @@ -4684,7 +4352,7 @@ version = "8.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1165dabf9fc1d6bb6819c2c0e27c8dd0e3068d2c53cf186d319788e96517f0d6" dependencies = [ - "bitvec 1.0.1", + "bitvec", "dmsort", "elementtree", "fallible-iterator", @@ -4766,7 +4434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "fastrand", "redox_syscall 0.3.5", "rustix 0.37.20", @@ -4819,7 +4487,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -5101,7 +4769,7 @@ version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -5302,9 +4970,6 @@ name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.7", -] [[package]] name = "uuid" @@ -5383,7 +5048,7 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -5408,7 +5073,7 @@ version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -5691,47 +5356,43 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] [[package]] name = "workspaces" -version = "0.4.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b8e4bc0367196fe6386e2c2325c13ee36066392682142d485237e355350e26" +checksum = "73b13d249618f197811e3673decc81459730cf5cc09ee7246dc4bede1e9333bc" dependencies = [ - "anyhow", + "async-process", "async-trait", "base64 0.13.0", "borsh 0.9.3", + "bs58 0.4.0", "chrono", "dirs 3.0.2", "hex 0.4.3", "libc", - "near-account-id 0.14.0", - "near-crypto 0.14.0", + "near-account-id 0.15.0", + "near-crypto 0.15.0", "near-jsonrpc-client 0.4.1", - "near-jsonrpc-primitives 0.14.0", - "near-primitives 0.14.0", + "near-jsonrpc-primitives 0.15.0", + "near-primitives 0.15.0", "near-sandbox-utils", "portpicker", "rand 0.8.5", "reqwest", "serde", "serde_json", + "thiserror", "tokio", "tokio-retry", "tracing", "url", ] -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - [[package]] name = "wyz" version = "0.5.0" diff --git a/cargo-near/src/abi_command/abi.rs b/cargo-near/src/abi_command/abi.rs index 9a2cc161..f15b44d1 100644 --- a/cargo-near/src/abi_command/abi.rs +++ b/cargo-near/src/abi_command/abi.rs @@ -176,7 +176,7 @@ fn strip_docs(abi_root: &mut near_abi::AbiRoot) { } } -pub(crate) fn run(args: super::AbiCommand) -> near_cli_rs::CliResult { +pub fn run(args: super::AbiCommand) -> near_cli_rs::CliResult { let color = args.color.unwrap_or(ColorPreference::Auto); color.apply(); diff --git a/cargo-near/src/abi_command/mod.rs b/cargo-near/src/abi_command/mod.rs index 7f9ca8fc..edeb68a6 100644 --- a/cargo-near/src/abi_command/mod.rs +++ b/cargo-near/src/abi_command/mod.rs @@ -13,11 +13,11 @@ pub struct AbiCommand { /// Copy final artifacts to this directory #[interactive_clap(long)] #[interactive_clap(skip_default_input_arg)] - pub out_dir: Option, + pub out_dir: Option, /// Path to the `Cargo.toml` of the contract to build #[interactive_clap(long)] #[interactive_clap(skip_default_input_arg)] - pub manifest_path: Option, + pub manifest_path: Option, /// Coloring: auto, always, never #[interactive_clap(long)] #[interactive_clap(value_enum)] @@ -87,13 +87,13 @@ impl AbiCommand { fn input_out_dir( _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + ) -> color_eyre::eyre::Result> { Ok(None) } fn input_manifest_path( _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + ) -> color_eyre::eyre::Result> { Ok(None) } } diff --git a/cargo-near/src/build_command/mod.rs b/cargo-near/src/build_command/mod.rs index f7a5dca2..2aa25d24 100644 --- a/cargo-near/src/build_command/mod.rs +++ b/cargo-near/src/build_command/mod.rs @@ -1,4 +1,4 @@ -mod build; +pub mod build; #[derive(Debug, Clone, interactive_clap::InteractiveClap)] #[interactive_clap(context = near_cli_rs::GlobalContext)] @@ -20,11 +20,11 @@ pub struct BuildCommand { /// Copy final artifacts to this directory #[interactive_clap(long)] #[interactive_clap(skip_default_input_arg)] - pub out_dir: Option, + pub out_dir: Option, /// Path to the `Cargo.toml` of the contract to build #[interactive_clap(long)] #[interactive_clap(skip_default_input_arg)] - pub manifest_path: Option, + pub manifest_path: Option, /// Coloring: auto, always, never #[interactive_clap(long)] #[interactive_clap(value_enum)] @@ -98,13 +98,13 @@ impl BuildCommand { fn input_out_dir( _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + ) -> color_eyre::eyre::Result> { Ok(None) } fn input_manifest_path( _context: &near_cli_rs::GlobalContext, - ) -> color_eyre::eyre::Result> { + ) -> color_eyre::eyre::Result> { Ok(None) } } diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs index 66b60d4a..df58210f 100644 --- a/cargo-near/src/lib.rs +++ b/cargo-near/src/lib.rs @@ -1,12 +1,19 @@ pub use near_cli_rs::CliResult; use strum::{EnumDiscriminants, EnumIter, EnumMessage}; -mod abi_command; -mod build_command; +pub mod abi_command; +pub mod build_command; mod common; -mod types; +pub mod types; mod util; +#[derive(Debug, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +pub struct Cmd { + #[interactive_clap(subcommand)] + opts: Opts, +} + #[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] #[interactive_clap(context = near_cli_rs::GlobalContext)] #[strum_discriminants(derive(EnumMessage, EnumIter))] diff --git a/cargo-near/src/main.rs b/cargo-near/src/main.rs index bb00306e..e4de431b 100644 --- a/cargo-near/src/main.rs +++ b/cargo-near/src/main.rs @@ -2,12 +2,7 @@ use interactive_clap::ToCliArgs; pub use near_cli_rs::CliResult; use std::env; -#[derive(Debug, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] -struct Cmd { - #[interactive_clap(subcommand)] - opts: cargo_near::Opts, -} +use cargo_near::Cmd; fn main() -> CliResult { env_logger::init(); diff --git a/cargo-near/src/types/utf8_path_buf.rs b/cargo-near/src/types/utf8_path_buf.rs index 2cb01d09..70c86fea 100644 --- a/cargo-near/src/types/utf8_path_buf.rs +++ b/cargo-near/src/types/utf8_path_buf.rs @@ -8,14 +8,14 @@ derive_more::FromStr, )] #[as_ref(forward)] -pub struct Utf8PathBuf(pub camino::Utf8PathBuf); +pub struct Utf8PathBufInner(pub camino::Utf8PathBuf); -impl std::fmt::Display for Utf8PathBuf { +impl std::fmt::Display for Utf8PathBufInner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { self.0.fmt(f) } } -impl interactive_clap::ToCli for Utf8PathBuf { - type CliVariant = Utf8PathBuf; +impl interactive_clap::ToCli for Utf8PathBufInner { + type CliVariant = Utf8PathBufInner; } diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 2b0122c2..27c71bbb 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -25,5 +25,5 @@ syn = "1.0" tempfile = "3.3" tokio = "1.0" quote = "1.0" -workspaces = "0.4.1" +workspaces = "0.7.0" zstd = "0.11" diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 73961164..9b1c39a8 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -42,12 +42,34 @@ macro_rules! invoke_cargo_near { std::env::set_var("CARGO_TARGET_DIR", workspace_dir.join("target")); - let cargo_near::Opts::Near(mut args) = clap::Parser::try_parse_from($cli_opts.split(" "))?; - match &mut args.cmd { - cargo_near::NearCommand::Abi(cmd) => cmd.manifest_path = Some(cargo_path), - cargo_near::NearCommand::Build(cmd) => cmd.manifest_path = Some(cargo_path), + let cargo_near::CliOpts::Near(cli_args) = cargo_near::Opts::try_parse_from($cli_opts)?; + + match cli_args.cmd { + Some(cargo_near::CliNearCommand::Abi(cmd)) => { + let args = cargo_near::abi_command::AbiCommand { + doc: cmd.doc, + compact_abi: cmd.compact_abi, + out_dir: cmd.out_dir, + manifest_path: Some(cargo_near::types::utf8_path_buf::Utf8PathBufInner(cargo_path)), + color: cmd.color, + }; + cargo_near::abi_command::abi::run(args)?; + }, + Some(cargo_near::CliNearCommand::Build(cmd)) => { + let args = cargo_near::build_command::BuildCommand { + release: cmd.release, + embed_abi: cmd.embed_abi, + doc: cmd.doc, + no_abi: cmd.no_abi, + out_dir: cmd.out_dir, + manifest_path: Some(cargo_near::types::utf8_path_buf::Utf8PathBufInner(cargo_path)), + color: cmd.color, + }; + println!("### {args:?}"); + cargo_near::build_command::build::run(args)?; + }, + None => () } - cargo_near::exec(args.cmd)?; workspace_dir.join("target").join("near") }}; @@ -60,7 +82,7 @@ macro_rules! generate_abi_with { $(let opts = format!("cargo near abi {}", $cli_opts);)?; let result_dir = $crate::invoke_cargo_near! { $(Cargo: $cargo_path;)? $(Vars: $cargo_vars;)? - Opts: opts; + Opts: &opts; Code: $($code)* }; @@ -132,7 +154,7 @@ macro_rules! build_with { $(let opts = format!("cargo near build {}", $cli_opts);)?; let result_dir = $crate::invoke_cargo_near! { $(Cargo: $cargo_path;)? $(Vars: $cargo_vars;)? - Opts: opts; + Opts: &opts; Code: $($code)* }; diff --git a/integration-tests/tests/build/embed.rs b/integration-tests/tests/build/embed.rs index c42af6a9..15ad435a 100644 --- a/integration-tests/tests/build/embed.rs +++ b/integration-tests/tests/build/embed.rs @@ -1,7 +1,6 @@ use crate::util; use cargo_near_integration_tests::{build_fn, build_fn_with}; use function_name::named; -use workspaces::prelude::DevAccountDeployer; #[tokio::test] #[named] @@ -42,7 +41,7 @@ async fn test_build_no_embed_abi() -> cargo_near::CliResult { let worker = workspaces::sandbox().await?; let contract = worker.dev_deploy(&build_result.wasm).await?; - let outcome = contract.call(&worker, "__contract_abi").view().await; + let outcome = contract.call("__contract_abi").view().await; outcome.unwrap_err(); Ok(()) diff --git a/integration-tests/tests/util.rs b/integration-tests/tests/util.rs index 42048a90..d0873724 100644 --- a/integration-tests/tests/util.rs +++ b/integration-tests/tests/util.rs @@ -1,18 +1,17 @@ use near_abi::AbiRoot; use near_abi::{AbiBorshParameter, AbiJsonParameter, AbiParameters}; use serde_json::json; -use workspaces::prelude::DevAccountDeployer; /// Utility method to test that the `add` function is available and works as intended pub async fn test_add(wasm: &[u8]) -> cargo_near::CliResult { let worker = workspaces::sandbox().await?; let contract = worker.dev_deploy(wasm).await?; let outcome = contract - .call(&worker, "add") + .call("add") .args_json(json!({ "a": 2u32, "b": 3u32, - }))? + })) .view() .await?; assert_eq!(outcome.json::()?, 5); @@ -22,7 +21,7 @@ pub async fn test_add(wasm: &[u8]) -> cargo_near::CliResult { pub async fn fetch_contract_abi(wasm: &[u8]) -> color_eyre::eyre::Result { let worker = workspaces::sandbox().await?; let contract = worker.dev_deploy(wasm).await?; - let outcome = contract.call(&worker, "__contract_abi").view().await?; + let outcome = contract.call("__contract_abi").view().await?; let outcome_json = zstd::decode_all(outcome.result.as_slice())?; Ok(serde_json::from_slice::(&outcome_json)?) } From 69d1c8820ebb0707e6e0dd3b59d87d185bd15feb Mon Sep 17 00:00:00 2001 From: FroVolod Date: Thu, 21 Sep 2023 17:10:28 +0300 Subject: [PATCH 10/15] refactored --- .../src/{ => commands}/abi_command/abi.rs | 0 .../src/{ => commands}/abi_command/mod.rs | 0 .../src/{ => commands}/build_command/build.rs | 4 ++-- .../src/{ => commands}/build_command/mod.rs | 0 cargo-near/src/commands/mod.rs | 20 ++++++++++++++++ cargo-near/src/lib.rs | 23 +++---------------- integration-tests/src/lib.rs | 13 +++++------ 7 files changed, 31 insertions(+), 29 deletions(-) rename cargo-near/src/{ => commands}/abi_command/abi.rs (100%) rename cargo-near/src/{ => commands}/abi_command/mod.rs (100%) rename cargo-near/src/{ => commands}/build_command/build.rs (97%) rename cargo-near/src/{ => commands}/build_command/mod.rs (100%) create mode 100644 cargo-near/src/commands/mod.rs diff --git a/cargo-near/src/abi_command/abi.rs b/cargo-near/src/commands/abi_command/abi.rs similarity index 100% rename from cargo-near/src/abi_command/abi.rs rename to cargo-near/src/commands/abi_command/abi.rs diff --git a/cargo-near/src/abi_command/mod.rs b/cargo-near/src/commands/abi_command/mod.rs similarity index 100% rename from cargo-near/src/abi_command/mod.rs rename to cargo-near/src/commands/abi_command/mod.rs diff --git a/cargo-near/src/build_command/build.rs b/cargo-near/src/commands/build_command/build.rs similarity index 97% rename from cargo-near/src/build_command/build.rs rename to cargo-near/src/commands/build_command/build.rs index 65bdafc4..7fe0a634 100644 --- a/cargo-near/src/build_command/build.rs +++ b/cargo-near/src/commands/build_command/build.rs @@ -4,8 +4,8 @@ use near_abi::BuildInfo; use sha2::{Digest, Sha256}; use std::io::BufRead; -use crate::abi_command::abi; -use crate::abi_command::abi::{AbiCompression, AbiFormat, AbiResult}; +use crate::commands::abi_command::abi; +use crate::commands::abi_command::abi::{AbiCompression, AbiFormat, AbiResult}; use crate::common::ColorPreference; use crate::types::{manifest::CargoManifestPath, metadata::CrateMetadata}; use crate::util; diff --git a/cargo-near/src/build_command/mod.rs b/cargo-near/src/commands/build_command/mod.rs similarity index 100% rename from cargo-near/src/build_command/mod.rs rename to cargo-near/src/commands/build_command/mod.rs diff --git a/cargo-near/src/commands/mod.rs b/cargo-near/src/commands/mod.rs new file mode 100644 index 00000000..7f58522c --- /dev/null +++ b/cargo-near/src/commands/mod.rs @@ -0,0 +1,20 @@ +use strum::{EnumDiscriminants, EnumIter, EnumMessage}; + +pub mod abi_command; +pub mod build_command; + +#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] +#[interactive_clap(context = near_cli_rs::GlobalContext)] +#[strum_discriminants(derive(EnumMessage, EnumIter))] +#[interactive_clap(disable_back)] +/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) +pub enum NearCommand { + #[strum_discriminants(strum( + message = "build - Build a NEAR contract and optionally embed ABI" + ))] + /// Build a NEAR contract and optionally embed ABI + Build(self::build_command::BuildCommand), + #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] + /// Generates ABI for the contract + Abi(self::abi_command::AbiCommand), +} diff --git a/cargo-near/src/lib.rs b/cargo-near/src/lib.rs index df58210f..d8acc010 100644 --- a/cargo-near/src/lib.rs +++ b/cargo-near/src/lib.rs @@ -1,8 +1,7 @@ pub use near_cli_rs::CliResult; use strum::{EnumDiscriminants, EnumIter, EnumMessage}; -pub mod abi_command; -pub mod build_command; +pub mod commands; mod common; pub mod types; mod util; @@ -11,7 +10,7 @@ mod util; #[interactive_clap(context = near_cli_rs::GlobalContext)] pub struct Cmd { #[interactive_clap(subcommand)] - opts: Opts, + pub opts: Opts, } #[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] @@ -29,21 +28,5 @@ pub enum Opts { #[interactive_clap(context = near_cli_rs::GlobalContext)] pub struct NearArgs { #[interactive_clap(subcommand)] - pub cmd: NearCommand, -} - -#[derive(Debug, EnumDiscriminants, Clone, interactive_clap::InteractiveClap)] -#[interactive_clap(context = near_cli_rs::GlobalContext)] -#[strum_discriminants(derive(EnumMessage, EnumIter))] -#[interactive_clap(disable_back)] -/// What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) -pub enum NearCommand { - #[strum_discriminants(strum( - message = "build - Build a NEAR contract and optionally embed ABI" - ))] - /// Build a NEAR contract and optionally embed ABI - Build(self::build_command::BuildCommand), - #[strum_discriminants(strum(message = "abi - Generates ABI for the contract"))] - /// Generates ABI for the contract - Abi(self::abi_command::AbiCommand), + pub cmd: self::commands::NearCommand, } diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 9b1c39a8..cd98e3f2 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -45,18 +45,18 @@ macro_rules! invoke_cargo_near { let cargo_near::CliOpts::Near(cli_args) = cargo_near::Opts::try_parse_from($cli_opts)?; match cli_args.cmd { - Some(cargo_near::CliNearCommand::Abi(cmd)) => { - let args = cargo_near::abi_command::AbiCommand { + Some(cargo_near::commands::CliNearCommand::Abi(cmd)) => { + let args = cargo_near::commands::abi_command::AbiCommand { doc: cmd.doc, compact_abi: cmd.compact_abi, out_dir: cmd.out_dir, manifest_path: Some(cargo_near::types::utf8_path_buf::Utf8PathBufInner(cargo_path)), color: cmd.color, }; - cargo_near::abi_command::abi::run(args)?; + cargo_near::commands::abi_command::abi::run(args)?; }, - Some(cargo_near::CliNearCommand::Build(cmd)) => { - let args = cargo_near::build_command::BuildCommand { + Some(cargo_near::commands::CliNearCommand::Build(cmd)) => { + let args = cargo_near::commands::build_command::BuildCommand { release: cmd.release, embed_abi: cmd.embed_abi, doc: cmd.doc, @@ -65,8 +65,7 @@ macro_rules! invoke_cargo_near { manifest_path: Some(cargo_near::types::utf8_path_buf::Utf8PathBufInner(cargo_path)), color: cmd.color, }; - println!("### {args:?}"); - cargo_near::build_command::build::run(args)?; + cargo_near::commands::build_command::build::run(args)?; }, None => () } From d4a053ec1aa7031c73efbb8176fd34624f52afa1 Mon Sep 17 00:00:00 2001 From: FroVolod Date: Sat, 30 Sep 2023 11:40:26 +0300 Subject: [PATCH 11/15] updated: interactive-clap = "0.2.5" --- Cargo.lock | 39 +++++++++------------------------------ cargo-near/Cargo.toml | 6 +++--- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2353cc44..6063b419 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -635,8 +635,8 @@ dependencies = [ "derive_more", "env_logger", "inquire", - "interactive-clap 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", - "interactive-clap-derive 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", + "interactive-clap", + "interactive-clap-derive", "libloading", "log", "near-abi", @@ -2065,41 +2065,20 @@ dependencies = [ [[package]] name = "interactive-clap" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a4460797bc616e3256b1becad15e859c4f8d63a8a379c87fdcb1734206cf0a" +checksum = "cfa3bbd3c31d3f6765db87b260af5612dcaaeb58a48bda65b28fc939e1db3080" dependencies = [ - "interactive-clap-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "strum", - "strum_macros", -] - -[[package]] -name = "interactive-clap" -version = "0.2.4" -source = "git+https://github.com/near-cli-rs/interactive-clap#2df6182314bda4f228ec06fbc78bd47f87671cbb" -dependencies = [ - "interactive-clap-derive 0.2.4 (git+https://github.com/near-cli-rs/interactive-clap)", + "interactive-clap-derive", "strum", "strum_macros", ] [[package]] name = "interactive-clap-derive" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4d0f6a898a8dc1bcea5b00552c5a3fa3f64a2634f84b854390269238abdc9ed" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "interactive-clap-derive" -version = "0.2.4" -source = "git+https://github.com/near-cli-rs/interactive-clap#2df6182314bda4f228ec06fbc78bd47f87671cbb" +checksum = "7d2e37af37a6ee00d336794e148a508f58daf3d0484278d1ca63224ba5c0a7e0" dependencies = [ "proc-macro-error", "proc-macro2", @@ -2547,8 +2526,8 @@ dependencies = [ "futures", "hex 0.4.3", "inquire", - "interactive-clap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "interactive-clap-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "interactive-clap", + "interactive-clap-derive", "linked-hash-map", "near-crypto 0.17.0", "near-jsonrpc-client 0.6.0", diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index 82c7c9ab..dd609769 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-near" version = "0.3.1" authors = ["Near Inc "] edition = "2021" -rust-version = "1.70.0" +rust-version = "1.60.0" description = "Cargo extension for building Rust smart contracts on NEAR" readme = "README.md" repository = "https://github.com/near/cargo-near" @@ -33,8 +33,8 @@ color-eyre = "0.6" inquire = "0.6" strum = { version = "0.24", features = ["derive"] } strum_macros = "0.24" -interactive-clap = {git = "https://github.com/near-cli-rs/interactive-clap"} -interactive-clap-derive = {git = "https://github.com/near-cli-rs/interactive-clap"} +interactive-clap = "0.2.5" +interactive-clap-derive = "0.2.5" near-cli-rs = { version = "0.5.2" } derive_more = "0.99.9" shell-words = "1.0.0" From a3ce2c1154f3778228e823d31973fd7eea8d11af Mon Sep 17 00:00:00 2001 From: FroVolod Date: Sat, 30 Sep 2023 12:29:01 +0300 Subject: [PATCH 12/15] updated: rust-version = "1.70.0" --- cargo-near/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index dd609769..2c5686a4 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-near" version = "0.3.1" authors = ["Near Inc "] edition = "2021" -rust-version = "1.60.0" +rust-version = "1.70.0" description = "Cargo extension for building Rust smart contracts on NEAR" readme = "README.md" repository = "https://github.com/near/cargo-near" From 06f0369e32534833cc9d435e83619bc5f11446b4 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sat, 30 Sep 2023 12:43:35 +0200 Subject: [PATCH 13/15] ci: Added libudev as a Linux build dependency to support Ledger devices and added cargo-dist and release-plz --- .github/workflows/release-plz.yml | 32 ++ .github/workflows/release.yml | 477 +++++++++++------------------- .github/workflows/test.yml | 8 + Cargo.toml | 27 ++ cargo-near/Cargo.toml | 4 + cargo-near/wix/main.wxs | 228 ++++++++++++++ release-plz.toml | 2 + 7 files changed, 480 insertions(+), 298 deletions(-) create mode 100644 .github/workflows/release-plz.yml create mode 100644 cargo-near/wix/main.wxs create mode 100644 release-plz.toml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..c9f20c24 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,32 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.MY_GITHUB_TOKEN }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Install packages (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + # https://release-plz.ieni.dev/docs/github/trigger + GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e33d324..65de69b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,313 +1,194 @@ -# Derived from: -# - https://github.com/miraclx/zy/blob/45b1cca61061cf9f0c60ad75ba1460c80ff6481c/.github/workflows/release.yml -# - https://github.com/BurntSushi/ripgrep/blob/000015791742bb1280f1853adb714fdee1ba9f8e/.github/workflows/release.yml -# - https://github.com/near/near-cli-rs/blob/a8679a3603015f1d651f874fdf0feff0d7514131/.github/workflows/release.yml -# - https://github.com/sharkdp/bat/blob/7c847d84b0c3c97df6badfbb39d153ad93aec74e/.github/workflows/CICD.yml -# - https://github.com/near/near-jsonrpc-client-rs/blob/2a9cce4710bb87592baf5d7ca7015e3d474584e9/.github/workflows/ci.yml - -name: release - +# Copyright 2022-2023, axodotdev +# SPDX-License-Identifier: MIT or Apache-2.0 +# +# CI that: +# +# * checks for a Git Tag that looks like a release +# * builds artifacts with cargo-dist (archives, installers, hashes) +# * uploads those artifacts to temporary workflow zip +# * on success, uploads the artifacts to a Github Release™ +# +# Note that the Github Release™ will be created with a generated +# title/body based on your changelogs. +name: Release + +permissions: + contents: write + +# This task will run whenever you push a git tag that looks like a version +# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. +# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where +# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION +# must be a Cargo-style SemVer Version (must have at least major.minor.patch). +# +# If PACKAGE_NAME is specified, then the release will be for that +# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). +# +# If PACKAGE_NAME isn't specified, then the release will be for all +# (cargo-dist-able) packages in the workspace with that version (this mode is +# intended for workspaces with only one dist-able package, or with all dist-able +# packages versioned/released in lockstep). +# +# If you push multiple tags at once, separate instances of this workflow will +# spin up, creating an independent Github Release™ for each one. However Github +# will hard limit this to 3 tags per commit, as it will assume more tags is a +# mistake. +# +# If there's a prerelease-style suffix to the version, then the Github Release™ +# will be marked as a prerelease. on: push: - branches: - - main - -env: - PROJECT_DIR: cargo-near - PROJECT_INDEX_URL: https://github.com/rust-lang/crates.io-index/raw/master/ca/rg/cargo-near - RUST_BACKTRACE: 1 - CARGO_PROFILE: slim # Use slim profile for CI builds. Check the Cargo.toml for more context. + tags: + - '**[0-9]+.[0-9]+.[0-9]+*' + pull_request: jobs: - check: + # Run 'cargo dist plan' to determine what tasks we need to do + plan: runs-on: ubuntu-latest outputs: - project_name: ${{ env.PROJECT_NAME }} - project_version: ${{ env.PROJECT_VERSION }} - is_prerelease: ${{ env.IS_PRERELEASE }} - git_previous_tag: ${{ env.GIT_PREVIOUS_TAG }} - should_publish_crate: ${{ env.SHOULD_PUBLISH_CRATE }} - should_release_binary: ${{ env.SHOULD_RELEASE_BINARY }} - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - # might be a simple `fetch-tags: true` option soon, see https://github.com/actions/checkout/pull/579 - fetch-depth: 0 - - - name: Check git environment - shell: bash - run: | - GIT_PREVIOUS_TAG="$(git describe --tags --abbrev=0 --match 'v[0-9]*.[0-9]*.[0-9]*')" - echo "GIT_PREVIOUS_TAG=${GIT_PREVIOUS_TAG}" >> $GITHUB_ENV - echo "Current latest git release tag is \"${GIT_PREVIOUS_TAG}\"" - - - name: Get project name - run: | - if [ ! -f "${PROJECT_DIR}/Cargo.toml" ]; then - echo "Error: ${PROJECT_DIR}/Cargo.toml does not exist" - exit 1 - fi - - PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' "${PROJECT_DIR}/Cargo.toml" | head -n1) - echo "Project Name: $PROJECT_NAME" - - if [[ "${PROJECT_INDEX_URL}" == *"${PROJECT_NAME}" ]]; then - echo "PROJECT_NAME=${PROJECT_NAME}" >> $GITHUB_ENV - else - echo "Project name does not match the index URL [${PROJECT_INDEX_URL}]." - exit 1 - fi - - - name: Version introspection - run: | - PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' "${PROJECT_DIR}/Cargo.toml" | head -n1) - echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV - echo "Project version: ${PROJECT_VERSION}" - - if [[ ! "${PROJECT_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then - echo "Project version is not a valid semver: ${PROJECT_VERSION}" - exit 1 - fi - - if [[ "${PROJECT_VERSION}" == *-* ]]; then - echo "Project version [${PROJECT_VERSION}] is a pre-release." - echo "IS_PRERELEASE=true" >> $GITHUB_ENV - else - echo "Project version [${PROJECT_VERSION}] is not a pre-release." - echo "IS_PRERELEASE=false" >> $GITHUB_ENV - fi - - - name: Check if crates.io release exists - run: | - CRATE_VERSIONS=$(curl -sL "${PROJECT_INDEX_URL}" | jq -r '.vers') - echo -e "Already published versions:\n${CRATE_VERSIONS}" - - if echo "${CRATE_VERSIONS}" | grep -q "^${PROJECT_VERSION}$"; then - echo "Project version [${PROJECT_VERSION}] has already been released." - echo "SHOULD_PUBLISH_CRATE=false" >> $GITHUB_ENV - else - echo "Project version [${PROJECT_VERSION}] has not been released." - echo "SHOULD_PUBLISH_CRATE=true" >> $GITHUB_ENV - fi - - - name: Check if GitHub release exists - run: | - RELEASED_VERSIONS=$(git tag -l "v[0-9]*.[0-9]*.[0-9]*") - echo -e "Already released versions:\n${RELEASED_VERSIONS}" - - if echo "${RELEASED_VERSIONS}" | grep -q "^v${PROJECT_VERSION}$"; then - echo "Project version [${PROJECT_VERSION}] has already been released." - echo "SHOULD_RELEASE_BINARY=false" >> $GITHUB_ENV - else - echo "Project version [${PROJECT_VERSION}] has not been released." - echo "SHOULD_RELEASE_BINARY=true" >> $GITHUB_ENV - fi - - crate: - runs-on: ubuntu-latest - needs: check - if: needs.check.outputs.should_publish_crate == 'true' + val: ${{ steps.plan.outputs.manifest }} + tag: ${{ !github.event.pull_request && github.ref_name || '' }} + tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} + publishing: ${{ !github.event.pull_request }} env: - PROJECT_NAME: ${{ needs.check.outputs.project_name }} - + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - - uses: actions-rs/cargo@v1 - with: - command: publish - args: --package ${{ env.PROJECT_NAME }} - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - binary: - runs-on: ${{ matrix.os }} - needs: check - if: needs.check.outputs.should_release_binary == 'true' - env: - PROJECT_NAME: ${{ needs.check.outputs.project_name }} - PROJECT_VERSION: ${{ needs.check.outputs.project_version }} + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0/cargo-dist-installer.sh | sh" + - id: plan + run: | + cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json + echo "cargo dist plan ran successfully" + cat dist-manifest.json + echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" + - name: "Upload dist-manifest.json" + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: dist-manifest.json + + # Build and packages all the platform-specific things + upload-local-artifacts: + # Let the initial task tell us to not run (currently very blunt) + needs: plan + if: ${{ fromJson(needs.plan.outputs.val).releases != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} strategy: fail-fast: false - matrix: - name: [ - # aarch64 - linux-aarch64-gnu, linux-aarch64-musl, macos-aarch64, win64-aarch64-msvc, - # x86_64 - linux-x86_64-gnu, linux-x86_64-musl, macos-x86_64, win64-x86_64-gnu, win64-x86_64-msvc - ] - include: - - { name: 'linux-aarch64-gnu' , target: aarch64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true } - - { name: 'linux-aarch64-musl', target: aarch64-unknown-linux-musl , os: ubuntu-latest , use-cross: true } - - { name: 'macos-aarch64' , target: aarch64-apple-darwin , os: macos-latest , } - - { name: 'win64-aarch64-msvc', target: aarch64-pc-windows-msvc , os: windows-latest, } - - { name: 'linux-x86_64-gnu' , target: x86_64-unknown-linux-gnu , os: ubuntu-latest , } - - { name: 'linux-x86_64-musl' , target: x86_64-unknown-linux-musl , os: ubuntu-latest , use-cross: true } - - { name: 'macos-x86_64' , target: x86_64-apple-darwin , os: macos-latest , } - - { name: 'win64-x86_64-gnu' , target: x86_64-pc-windows-gnu , os: windows-latest, } - - { name: 'win64-x86_64-msvc' , target: x86_64-pc-windows-msvc , os: windows-latest, } - + # Target platforms/runners are computed by cargo-dist in create-release. + # Each member of the matrix has the following arguments: + # + # - runner: the github runner + # - dist-args: cli flags to pass to cargo dist + # - install-dist: expression to run to install cargo-dist on the runner + # + # Typically there will be: + # - 1 "global" task that builds universal installers + # - N "local" tasks that build each platform's binaries and platform-specific installers + matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }} + runs-on: ${{ matrix.runner }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install rust - uses: dtolnay/rust-toolchain@stable - with: - target: ${{ matrix.target }} - - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} - - - name: Build - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.use-cross }} - command: build - args: >- - --package ${{ env.PROJECT_NAME }} - --profile ${{ env.CARGO_PROFILE }} - --target ${{ matrix.target }} - --locked --verbose - - - name: Build archive - shell: bash - run: | - PKG_BASENAME="${{ env.PROJECT_NAME }}-v${{ env.PROJECT_VERSION }}-${{ matrix.target }}" - mkdir "${PKG_BASENAME}" - - EXE_suffix="" - case ${{ matrix.target }} in - *-pc-windows-*) EXE_suffix=".exe" ;; - esac - PROJECT_BIN_PATH="target/${{ matrix.target }}/${{ env.CARGO_PROFILE }}/${{ env.PROJECT_NAME }}${EXE_suffix}" - - cp "${PROJECT_BIN_PATH}" "${PKG_BASENAME}/" - cp README.md CHANGELOG.md LICENSE-MIT LICENSE-APACHE "${PKG_BASENAME}/" - - case ${{ matrix.target }} in - *-pc-windows-*) - PKG_PATH="${PKG_BASENAME}.zip" - 7z -y a "${PKG_PATH}" "${PKG_BASENAME}"/* | tail -2 - ;; - *) - PKG_PATH="${PKG_BASENAME}.tar.gz" - tar czf "${PKG_PATH}" "${PKG_BASENAME}"/* - ;; - esac - echo "PKG_PATH=${PKG_PATH}" >> $GITHUB_ENV - - - uses: actions/upload-artifact@v3 - with: - name: ${{ env.PKG_PATH }} - path: ${{ env.PKG_PATH }} - retention-days: 1 + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: swatinem/rust-cache@v2 + - name: Install cargo-dist + run: ${{ matrix.install_dist }} + - name: Install packages (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: Build and package + run: | + # Actually do builds and make zips and whatnot + cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + echo "cargo dist ran successfully" + - id: cargo-dist + # We force bash here just because github makes it really hard to get values up + # to "real" actions without writing to env-vars, and writing to env-vars has + # inconsistent syntax between shell and powershell. cargo-dist and jq work fine + # in powershell. + shell: bash + run: | + # Parse out what we just built and upload it to the Github Release™ + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + - name: "Upload artifacts" + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: ${{ steps.cargo-dist.outputs.paths }} + + # Build and package all the platform-agnostic(ish) things + upload-global-artifacts: + needs: [plan, upload-local-artifacts] + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0/cargo-dist-installer.sh | sh" + # Get all the local artifacts for the global tasks to use (for e.g. checksums) + - name: Fetch local artifacts + uses: actions/download-artifact@v3 + with: + name: artifacts + path: target/distrib/ + - id: cargo-dist + shell: bash + run: | + cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json + echo "cargo dist ran successfully" + + # Parse out what we just built and upload it to the Github Release™ + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + - name: "Upload artifacts" + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: ${{ steps.cargo-dist.outputs.paths }} + + should-publish: + needs: + - plan + - upload-local-artifacts + - upload-global-artifacts + if: ${{ needs.plan.outputs.publishing == 'true' }} + runs-on: ubuntu-latest + steps: + - name: print tag + run: echo "ok we're publishing!" - github: + # Create a Github Release with all the results once everything is done, + publish-release: + needs: [plan, should-publish] runs-on: ubuntu-latest - needs: [check, binary] env: - PROJECT_NAME: ${{ needs.check.outputs.project_name }} - PROJECT_VERSION: ${{ needs.check.outputs.project_version }} - GH_PROJECT_VERSION: v${{ needs.check.outputs.project_version }} - IS_PRERELEASE: ${{ needs.check.outputs.is_prerelease }} - GIT_PREVIOUS_TAG: ${{ needs.check.outputs.git_previous_tag }} - WILL_PUBLISH_CRATE: ${{ needs.check.outputs.should_publish_crate }} - + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: List artifacts - run: tree artifacts - - - name: Extract release notes - id: extract-release-notes - uses: ffurrer2/extract-release-notes@c24866884b7a0d2fd2095be2e406b6f260479da8 - - - name: Get contributors - run: | - DEFAULT_RELEASE_NOTE="$( - curl -sL \ - https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \ - -H 'Authorization: token ${{ github.token }}' \ - -d '{"tag_name":"${{ env.GH_PROJECT_VERSION }}","target_commitish":"${{ github.sha }}"}' \ - | jq -r .body - )" - echo "Default Release Note" - echo "${DEFAULT_RELEASE_NOTE}" - echo - CONTRIBUTORS="$( - <<< "${DEFAULT_RELEASE_NOTE}" \ - perl -ne 'print if s/.+ by (@[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}) in https.+$/\1/i' \ - | sort -u \ - )" - echo "Contributors" - echo "${CONTRIBUTORS}" - echo - PRETTY_CONTRIBUTOR_LIST="$( - xargs <<< "${CONTRIBUTORS}" \ - | sed 's/ /, /g;s/\(.*\), \(.*\)$/\1 and \2/' \ - )" - echo "Prettified Contributors" - echo "${PRETTY_CONTRIBUTOR_LIST}" - echo - echo "PRETTY_CONTRIBUTOR_LIST=${PRETTY_CONTRIBUTOR_LIST}" >> $GITHUB_ENV - - - name: Prepare release body - run: | - if [ -n "${PRETTY_CONTRIBUTOR_LIST}" ]; then - PRETTY_CONTRIBUTOR_LINE=" 🎉 Thanks to ${PRETTY_CONTRIBUTOR_LIST} for their contributions to this release. 🎉 " - echo "PRETTY_CONTRIBUTOR_LINE=${PRETTY_CONTRIBUTOR_LINE}" >> $GITHUB_ENV - fi - - CRATE_LINE="**Crate Link**: https://crates.io/crates/${{ env.PROJECT_NAME }}/${{ env.PROJECT_VERSION }}" - echo "CRATE_LINE=${CRATE_LINE}" >> $GITHUB_ENV - - CHANGELOG_LINE="**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ env.GIT_PREVIOUS_TAG }}...${{ env.GH_PROJECT_VERSION }}" - echo "CHANGELOG_LINE=${CHANGELOG_LINE}" >> $GITHUB_ENV - - HASH_LINE="

\nVerify the SHA256 checksums of the release artifacts\n\n| File | Hash |\n| --- | --- |" - for file in artifacts/*/*; do - filename=$(basename "$file") - HASH_LINE="${HASH_LINE}\n| [\`${filename}\`](https://github.com/near/cargo-near/releases/download/${{ env.GH_PROJECT_VERSION }}/${filename}) | \`$(sha256sum "${file}" | cut -d' ' -f1)\` |" - done - HASH_LINE="${HASH_LINE}\n\n
" - echo "HASH_LINE<> $GITHUB_ENV - echo -e "${HASH_LINE}" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Create release and upload artifacts - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ env.GH_PROJECT_VERSION }} - prerelease: ${{ env.IS_PRERELEASE }} - target_commitish: ${{ github.sha }} - token: ${{ secrets.GITHUB_TOKEN }} - files: | - artifacts/**/*.tar.gz - artifacts/**/*.zip - body: | - ## What's changed? - - ${{ steps.extract-release-notes.outputs.release_notes }} - - ${{ env.CRATE_LINE }} - - ${{ env.CHANGELOG_LINE }} - - ${{ env.PRETTY_CONTRIBUTOR_LINE }} - - ${{ env.HASH_LINE }} + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: "Download artifacts" + uses: actions/download-artifact@v3 + with: + name: artifacts + path: artifacts + - name: Create Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ needs.plan.outputs.tag }} + name: ${{ fromJson(needs.plan.outputs.val).announcement_title }} + body: ${{ fromJson(needs.plan.outputs.val).announcement_github_body }} + prerelease: ${{ fromJson(needs.plan.outputs.val).announcement_is_prerelease }} + artifacts: "artifacts/*" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cab7d33a..0f1b9b75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,10 @@ jobs: toolchain: ${{ env.RUST_MSRV }} default: true + - name: Install packages (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: Cargo check run: cargo check -p cargo-near @@ -55,6 +59,10 @@ jobs: - name: Install `wasm32-unknown-unknown` run: rustup target add wasm32-unknown-unknown + - name: Install packages (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: Run tests run: cargo test --workspace --verbose diff --git a/Cargo.toml b/Cargo.toml index 58bb9a94..44efdd61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,30 @@ inherits = "release" lto = true strip = true codegen-units = 1 + +# The profile that 'cargo dist' will build with +[profile.dist] +inherits = "release" +lto = "thin" + +# Config for 'cargo dist' +[workspace.metadata.dist] +# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) +cargo-dist-version = "0.3.0" +# CI backends to support +ci = ["github"] +# The installers to generate for each app +installers = ["shell", "powershell", "npm", "msi"] +# Target platforms to build apps for (Rust target-triple syntax) +targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"] +# The archive format to use for windows builds (defaults .zip) +windows-archive = ".tar.gz" +# The archive format to use for non-windows builds (defaults .tar.xz) +unix-archive = ".tar.gz" +# Publish jobs to run in CI +pr-run-mode = "upload" +# XXX: In order to install system dependencies, we need to edit the release.yml, +# so we allow dirty CI scripts to avoid cargo-dist complains. +# This should not be necessary once the following issue is addressed: +# https://github.com/axodotdev/cargo-dist/issues/423 +allow-dirty = ["ci"] diff --git a/cargo-near/Cargo.toml b/cargo-near/Cargo.toml index 2c5686a4..7150c331 100644 --- a/cargo-near/Cargo.toml +++ b/cargo-near/Cargo.toml @@ -11,6 +11,10 @@ license = "MIT OR Apache-2.0" keywords = ["cargo", "near", "contract", "abi", "build"] categories = ["development-tools", "development-tools::cargo-plugins", "development-tools::build-utils", "command-line-utilities"] +[package.metadata.wix] +upgrade-guid = "FFBAE83D-C3FA-45DD-9F19-C8F312E905C5" +path-guid = "4A9FB601-2F10-48F8-BBC0-B467169D6BAD" + [dependencies] bs58 = "0.4" camino = "1.1.1" diff --git a/cargo-near/wix/main.wxs b/cargo-near/wix/main.wxs new file mode 100644 index 00000000..bf518859 --- /dev/null +++ b/cargo-near/wix/main.wxs @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + + + + + + + + + + + + + + + + + + diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 00000000..e8e0670f --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,2 @@ +[workspace] +git_release_enable = false From 1631c3e377e43aef58af3864f347445abb9f13cd Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sun, 1 Oct 2023 00:37:30 +0200 Subject: [PATCH 14/15] ci: Fixing compilation errors --- .github/workflows/test.yml | 13 +- Cargo.lock | 1058 ++++++++++++++++++------------------ 2 files changed, 556 insertions(+), 515 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f1b9b75..a0b1a062 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,13 @@ jobs: if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: downgrade crates to support older Rust toolchain + if: matrix.toolchain == '1.69.0' + run: | + cargo update -p anstyle --precise 1.0.2 + cargo update -p clap --precise 4.3.24 + cargo update -p clap_lex --precise 0.5.0 + - name: Cargo check run: cargo check -p cargo-near @@ -76,6 +83,10 @@ jobs: - name: Check Formatting run: cargo fmt -- --check + - name: Install packages (Linux) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev + - name: Check Clippy run: cargo clippy --tests -- -Dclippy::all @@ -90,4 +101,4 @@ jobs: run: cargo install cargo-audit - name: Run Audit Tool - run: cargo audit --ignore RUSTSEC-2020-0071 + run: cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2022-0093 diff --git a/Cargo.lock b/Cargo.lock index 6063b419..ce648574 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,13 +4,14 @@ version = 3 [[package]] name = "actix" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" +checksum = "cba56612922b907719d4a01cf11c8d5b458e7d3dba946d0435f20f58d6795ed2" dependencies = [ + "actix-macros", "actix-rt", "actix_derive", - "bitflags 1.3.2", + "bitflags 2.4.0", "bytes", "crossbeam-channel", "futures-core", @@ -23,14 +24,24 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.37", ] [[package]] name = "actix-rt" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea16c295198e958ef31930a6ef37d0fb64e9ca3b6116e6b93a8bdae96ee1000" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" dependencies = [ "futures-core", "tokio", @@ -38,22 +49,22 @@ dependencies = [ [[package]] name = "actix_derive" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] name = "addr2line" -version = "0.17.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli", + "gimli 0.28.0", ] [[package]] @@ -68,16 +79,27 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -99,9 +121,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -113,15 +135,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -137,9 +159,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -147,9 +169,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.63" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26fa4d7e3f2eebadf743988fc8aec9fa9a9e82611acafd77c1462ed6262440a" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arbitrary" @@ -162,9 +184,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -174,9 +196,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-channel" @@ -203,7 +225,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.20", + "rustix 0.37.24", "slab", "socket2", "waker-fn", @@ -231,7 +253,7 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix 0.37.20", + "rustix 0.37.24", "signal-hook", "windows-sys 0.48.0", ] @@ -255,31 +277,31 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] name = "async-task" -version = "4.4.0" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -300,9 +322,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -315,9 +337,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" @@ -350,7 +372,7 @@ checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", "rand 0.8.5", - "rand_core 0.6.3", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -418,26 +440,27 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "blocking" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "94c4ef1f913d78636d78d538eec1f18de81e481f44b1be0a81060090530846e1" dependencies = [ "async-channel", "async-lock", "async-task", - "atomic-waker", - "fastrand", + "fastrand 2.0.1", + "futures-io", "futures-lite", - "log", + "piper", + "tracing", ] [[package]] @@ -457,7 +480,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -470,7 +493,7 @@ dependencies = [ "borsh-schema-derive-internal 0.9.3", "proc-macro-crate", "proc-macro2", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -483,7 +506,7 @@ dependencies = [ "borsh-schema-derive-internal 0.10.3", "proc-macro-crate", "proc-macro2", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -494,7 +517,7 @@ checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -505,7 +528,7 @@ checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -516,7 +539,7 @@ checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -527,7 +550,7 @@ checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -536,7 +559,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", ] [[package]] @@ -556,9 +579,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" @@ -568,15 +591,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" dependencies = [ "serde", ] @@ -614,9 +637,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.1" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] @@ -644,7 +667,7 @@ dependencies = [ "rustc_version", "schemars", "serde_json", - "sha2 0.10.3", + "sha2 0.10.8", "shell-words", "strum", "strum_macros", @@ -671,7 +694,7 @@ dependencies = [ "quote", "schemars", "serde_json", - "syn 1.0.99", + "syn 1.0.109", "tempfile", "tokio", "workspaces", @@ -680,9 +703,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -724,11 +747,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -739,18 +763,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -764,9 +787,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -774,9 +797,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -790,10 +813,10 @@ version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -837,13 +860,13 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.0" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "atty", + "is-terminal", "lazy_static", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -866,9 +889,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -930,15 +953,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.4" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -954,9 +977,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -964,12 +987,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1083,9 +1105,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.65+curl-8.2.1" +version = "0.4.66+curl-8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" +checksum = "70c44a72e830f0e40ad90dda8a6ab6ed6314d39776599a58a2e5e37fbc6db5b9" dependencies = [ "cc", "libc", @@ -1093,7 +1115,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1130,7 +1152,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1141,7 +1163,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1170,7 +1192,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1183,7 +1205,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -1197,11 +1219,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.4", "crypto-common", ] @@ -1292,9 +1314,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dyn-clone" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "easy-ext" @@ -1310,9 +1332,9 @@ checksum = "49457524c7e65648794c98283282a0b7c73b10018e7091f1cdcfff314fd7ae59" [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -1361,9 +1383,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1385,14 +1407,14 @@ checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -1409,9 +1431,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -1462,7 +1484,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", "synstructure", ] @@ -1474,23 +1496,29 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", - "windows-sys 0.36.1", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] @@ -1510,9 +1538,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -1541,11 +1569,10 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ - "matches", "percent-encoding", ] @@ -1634,7 +1661,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1651,7 +1678,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1686,9 +1713,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1707,9 +1734,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -1726,6 +1753,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "git2" version = "0.14.4" @@ -1754,9 +1787,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1764,10 +1797,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.1", + "indexmap 1.9.3", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", "tracing", ] @@ -1777,7 +1810,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1785,15 +1818,21 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.3", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -1806,9 +1845,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -1821,9 +1860,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -1873,9 +1912,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1901,9 +1940,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -1962,16 +2001,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.47" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", + "iana-time-zone-haiku", "js-sys", - "once_cell", "wasm-bindgen", - "winapi", + "windows", +] + +[[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]] @@ -1982,11 +2030,10 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -2005,9 +2052,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -2016,20 +2063,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "serde", ] [[package]] name = "indicatif" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", "instant", @@ -2083,7 +2130,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -2092,16 +2139,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-docker" @@ -2118,8 +2165,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "rustix 0.38.3", + "hermit-abi 0.3.3", + "rustix 0.38.15", "windows-sys 0.48.0", ] @@ -2153,15 +2200,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -2174,9 +2221,9 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -2238,9 +2285,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libgit2-sys" @@ -2258,9 +2305,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", "winapi", @@ -2309,15 +2356,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -2325,12 +2372,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -2338,35 +2382,29 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memmap2" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minifier" @@ -2382,23 +2420,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.4" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] @@ -2418,9 +2456,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -2480,7 +2518,7 @@ dependencies = [ "num-rational", "serde", "serde_json", - "sha2 0.10.3", + "sha2 0.10.8", "smart-default 0.6.0", "tracing", ] @@ -2502,7 +2540,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "sha2 0.10.3", + "sha2 0.10.8", "smart-default 0.6.0", "tracing", ] @@ -2800,7 +2838,7 @@ dependencies = [ "smart-default 0.6.0", "strum", "thiserror", - "time 0.3.28", + "time 0.3.29", "tracing", ] @@ -2810,7 +2848,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7929e19d862221949734c4a0063a8f55e7069de3a2ebc2d4f4c13497a5e953cb" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "borsh 0.9.3", "bs58 0.4.0", "derive_more", @@ -2818,7 +2856,7 @@ dependencies = [ "num-rational", "serde", "serde_repr", - "sha2 0.10.3", + "sha2 0.10.8", "strum", ] @@ -2839,7 +2877,7 @@ dependencies = [ "serde", "serde_repr", "serde_with", - "sha2 0.10.3", + "sha2 0.10.8", "strum", "thiserror", ] @@ -2852,7 +2890,7 @@ checksum = "36addf90cc04bd547a627b3a292f59d7de4dd6fb5042115419ae901b93ce6c2d" dependencies = [ "quote", "serde", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -2863,7 +2901,7 @@ checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" dependencies = [ "quote", "serde", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -2874,7 +2912,7 @@ checksum = "0b5beb352f3b91d8c491646c2fa4fdbbbf463c7b9c0226951c28f0197de44f99" dependencies = [ "near-rpc-error-core 0.15.0", "serde", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -2886,7 +2924,7 @@ dependencies = [ "fs2", "near-rpc-error-core 0.17.0", "serde", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -2960,9 +2998,9 @@ checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -3027,20 +3065,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.3.3", "libc", ] @@ -3052,9 +3090,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.29.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -3084,11 +3122,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -3099,13 +3137,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] @@ -3116,18 +3154,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.0+1.1.1t" +version = "300.1.5+3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6" +checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -3204,9 +3242,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" [[package]] name = "parking_lot" @@ -3220,15 +3258,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.36.1", + "windows-targets 0.48.5", ] [[package]] @@ -3250,9 +3288,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "petgraph" @@ -3261,7 +3299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.0.2", ] [[package]] @@ -3270,34 +3308,34 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher 0.3.10", + "siphasher 0.3.11", ] [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -3305,11 +3343,22 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plain" @@ -3350,9 +3399,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "precomputed-hash" @@ -3367,7 +3416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -3400,7 +3449,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml 0.5.9", + "toml 0.5.11", ] [[package]] @@ -3412,7 +3461,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", "version_check", ] @@ -3429,9 +3478,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -3491,7 +3540,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -3555,7 +3604,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -3575,7 +3624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -3589,11 +3638,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.10", ] [[package]] @@ -3646,7 +3695,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.10", "redox_syscall 0.2.16", "thiserror", ] @@ -3662,13 +3711,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.3.9", + "regex-syntax 0.7.5", ] [[package]] @@ -3677,14 +3727,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" @@ -3729,7 +3796,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "blake2b_simd", "constant_time_eq", "crossbeam-utils", @@ -3737,9 +3804,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc_version" @@ -3752,9 +3819,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", "errno", @@ -3766,28 +3833,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.8", "windows-sys 0.48.0", ] [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -3800,19 +3867,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] name = "schemars" -version = "0.8.11" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "dyn-clone", "schemars_derive", @@ -3822,21 +3888,21 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.11" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scroll" @@ -3855,13 +3921,13 @@ dependencies = [ [[package]] name = "scroll_derive" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] @@ -3904,9 +3970,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3917,9 +3983,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3948,9 +4014,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -3972,7 +4038,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -3983,14 +4049,14 @@ checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -4005,7 +4071,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -4038,12 +4104,12 @@ dependencies = [ "base64 0.21.4", "chrono", "hex 0.4.3", - "indexmap 1.9.1", - "indexmap 2.0.0", + "indexmap 1.9.3", + "indexmap 2.0.2", "serde", "serde_json", "serde_with_macros", - "time 0.3.28", + "time 0.3.29", ] [[package]] @@ -4055,7 +4121,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -4064,7 +4130,7 @@ version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "itoa", "ryu", "serde", @@ -4086,20 +4152,20 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899bf02746a2c92bf1053d9327dadb252b01af1f81f90cdb902411f518bc7215" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest 0.10.7", ] [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" dependencies = [ "lazy_static", ] @@ -4127,9 +4193,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -4148,18 +4214,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.6.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ea32af43239f0d353a7dd75a22d94c329c8cdaafdcb4c1c1335aa10c298a4a" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "siphasher" @@ -4169,15 +4235,15 @@ checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -4195,9 +4261,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smart-default" @@ -4207,7 +4273,7 @@ checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -4218,7 +4284,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -4237,10 +4303,10 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -4267,9 +4333,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_cache" -version = "0.8.4" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", @@ -4300,18 +4366,18 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "symbolic-common" @@ -4336,7 +4402,7 @@ dependencies = [ "elementtree", "fallible-iterator", "flate2", - "gimli", + "gimli 0.26.2", "goblin", "lazy_static", "lazycell", @@ -4357,9 +4423,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.99" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -4368,9 +4434,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -4385,7 +4451,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 1.0.109", "unicode-xid", ] @@ -4397,9 +4463,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.38" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ "filetime", "libc", @@ -4408,15 +4474,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", - "fastrand", + "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.37.20", + "rustix 0.38.15", "windows-sys 0.48.0", ] @@ -4433,31 +4498,31 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -4483,9 +4548,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -4496,15 +4561,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4520,9 +4585,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -4561,14 +4626,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -4612,9 +4677,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -4626,9 +4691,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -4660,7 +4725,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -4675,7 +4740,7 @@ checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" dependencies = [ "async-stream", "async-trait", - "base64 0.13.0", + "base64 0.13.1", "bytes", "futures-core", "futures-util", @@ -4707,7 +4772,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 1.0.99", + "syn 1.0.109", ] [[package]] @@ -4718,13 +4783,13 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.1", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", "tower-layer", "tower-service", "tracing", @@ -4744,9 +4809,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -4762,19 +4827,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.28", + "time 0.3.29", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", ] [[package]] @@ -4852,21 +4917,21 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", @@ -4876,15 +4941,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4903,15 +4968,15 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" @@ -4921,13 +4986,12 @@ checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "url" -version = "2.2.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", "serde", ] @@ -4956,7 +5020,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.10", ] [[package]] @@ -4979,9 +5043,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" @@ -4995,11 +5059,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -5023,9 +5086,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5033,24 +5096,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -5060,9 +5123,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5070,22 +5133,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmparser" @@ -5095,9 +5158,9 @@ checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -5105,13 +5168,14 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.15", ] [[package]] @@ -5132,9 +5196,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -5146,16 +5210,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.48.5", ] [[package]] @@ -5173,7 +5233,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -5193,17 +5253,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5214,15 +5274,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5232,15 +5286,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5250,15 +5298,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5268,15 +5310,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5286,9 +5322,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5298,15 +5334,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5316,9 +5346,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" @@ -5347,7 +5377,7 @@ checksum = "73b13d249618f197811e3673decc81459730cf5cc09ee7246dc4bede1e9333bc" dependencies = [ "async-process", "async-trait", - "base64 0.13.0", + "base64 0.13.1", "borsh 0.9.3", "bs58 0.4.0", "chrono", @@ -5374,27 +5404,27 @@ dependencies = [ [[package]] name = "wyz" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] [[package]] name = "xattr" -version = "0.2.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] [[package]] name = "xml-rs" -version = "0.8.4" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zeroize" @@ -5407,14 +5437,13 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 1.0.99", - "synstructure", + "syn 2.0.37", ] [[package]] @@ -5452,10 +5481,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", + "pkg-config", ] From 9ce42fd2e191ea8f4021b0b5aaea5bbe4cc89177 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sun, 1 Oct 2023 17:33:58 +0200 Subject: [PATCH 15/15] ci: Temporarily ignore near-workspaces-rs tests as cargo-near requires Rust 1.70+ while latest released near-workspaces-rs does not support Rust 1.70+ --- .gitattributes | 1 + .github/workflows/test.yml | 13 ++----------- Cargo.toml | 1 + integration-tests/tests/build/embed.rs | 3 +++ integration-tests/tests/build/mod.rs | 3 +++ integration-tests/tests/build/opts.rs | 12 ++++++++++++ 6 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9a0309f9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +Cargo.lock linguist-generated=true -diff diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0b1a062..3e516a70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,13 +33,6 @@ jobs: if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install --assume-yes libudev-dev - - name: downgrade crates to support older Rust toolchain - if: matrix.toolchain == '1.69.0' - run: | - cargo update -p anstyle --precise 1.0.2 - cargo update -p clap --precise 4.3.24 - cargo update -p clap_lex --precise 0.5.0 - - name: Cargo check run: cargo check -p cargo-near @@ -54,13 +47,11 @@ jobs: - name: Checkout Sources uses: actions/checkout@v2 - # Remove this whole block once nearcore supports Rust 1.70.0+ - # https://github.com/near/nearcore/issues/9143 - - name: "Install 1.69.0 toolchain" + - name: "Install stable Rust toolchain" uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.69.0 + toolchain: stable default: true - name: Install `wasm32-unknown-unknown` diff --git a/Cargo.toml b/Cargo.toml index 44efdd61..c2895f4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "cargo-near", "integration-tests", diff --git a/integration-tests/tests/build/embed.rs b/integration-tests/tests/build/embed.rs index 15ad435a..293acf3e 100644 --- a/integration-tests/tests/build/embed.rs +++ b/integration-tests/tests/build/embed.rs @@ -4,6 +4,9 @@ use function_name::named; #[tokio::test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] async fn test_build_embed_abi() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--embed-abi"; diff --git a/integration-tests/tests/build/mod.rs b/integration-tests/tests/build/mod.rs index 94bb3d1f..cf32e7d8 100644 --- a/integration-tests/tests/build/mod.rs +++ b/integration-tests/tests/build/mod.rs @@ -7,6 +7,9 @@ mod opts; #[tokio::test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] async fn test_build_simple() -> cargo_near::CliResult { let build_result = build_fn! { /// Adds `a` and `b`. diff --git a/integration-tests/tests/build/opts.rs b/integration-tests/tests/build/opts.rs index 70ff17c1..743c52da 100644 --- a/integration-tests/tests/build/opts.rs +++ b/integration-tests/tests/build/opts.rs @@ -66,6 +66,9 @@ fn test_build_opt_out_dir() -> cargo_near::CliResult { #[tokio::test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] async fn test_build_opt_release() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--release"; @@ -85,6 +88,9 @@ async fn test_build_opt_release() -> cargo_near::CliResult { #[tokio::test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] async fn test_build_opt_doc_embed() -> cargo_near::CliResult { let build_result = build_fn_with! { Opts: "--doc --embed-abi"; @@ -112,6 +118,9 @@ async fn test_build_opt_doc_embed() -> cargo_near::CliResult { #[test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] fn test_build_opt_no_abi_doc() -> cargo_near::CliResult { fn run_test() -> cargo_near::CliResult { build_fn_with! { @@ -134,6 +143,9 @@ fn test_build_opt_no_abi_doc() -> cargo_near::CliResult { #[test] #[named] +// TODO: remove ignore after near-workspaces-rs supports Rust 1.70+ +// https://github.com/near/cargo-near/issues/104 +#[ignore] fn test_build_opt_no_abi_embed() -> cargo_near::CliResult { fn run_test() -> cargo_near::CliResult { build_fn_with! {