diff --git a/Cargo.lock b/Cargo.lock index e233e8d..f858cf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" [[package]] name = "arrayvec" @@ -96,15 +96,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -112,7 +112,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -139,15 +139,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byteorder" @@ -157,24 +157,25 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.11" +version = "1.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" +checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54" dependencies = [ + "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "clap" @@ -222,6 +223,18 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys 0.59.0", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -249,6 +262,12 @@ dependencies = [ "syn", ] +[[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.35" @@ -260,18 +279,18 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -280,6 +299,12 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + [[package]] name = "fnv" version = "1.0.7" @@ -351,25 +376,25 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -380,9 +405,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.4.7" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "17da50a276f1e01e0ba6c029e47b7100754904ee8a278f886546e98575380785" dependencies = [ "atomic-waker", "bytes", @@ -399,9 +424,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -426,9 +451,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -447,12 +472,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -460,9 +485,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" @@ -486,11 +511,10 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", @@ -519,40 +543,48 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" dependencies = [ + "base64", "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", "socket2", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -561,31 +593,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -593,67 +605,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "idna" version = "1.0.3" @@ -667,9 +666,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -677,20 +676,65 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", ] +[[package]] +name = "insta" +version = "1.43.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fdb647ebde000f43b5b53f773c30cf9b0cb4300453208713fa38b2c70935a0" +dependencies = [ + "console", + "once_cell", + "regex", + "serde", + "similar", +] + +[[package]] +name = "insta-cmd" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffeeefa927925cced49ccb01bf3e57c9d4cd132df21e576eb9415baeab2d3de6" +dependencies = [ + "insta", + "serde", + "serde_json", +] + +[[package]] +name = "io-uring" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -699,9 +743,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" @@ -720,6 +764,8 @@ dependencies = [ "anyhow", "clap", "hex", + "insta", + "insta-cmd", "regex", "reqwest", "secp256k1", @@ -731,27 +777,27 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -759,15 +805,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "mime" @@ -777,29 +823,29 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] name = "native-tls" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -823,15 +869,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl" -version = "0.10.69" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ "bitflags", "cfg-if", @@ -861,9 +907,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", @@ -873,9 +919,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -883,22 +929,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" @@ -914,9 +960,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] [[package]] name = "ppv-lite86" @@ -929,22 +984,28 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" @@ -972,23 +1033,23 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -998,9 +1059,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", @@ -1009,21 +1070,20 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "reqwest" -version = "0.12.12" +version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ "base64", "bytes", "encoding_rs", "futures-core", - "futures-util", "h2", "http", "http-body", @@ -1032,70 +1092,66 @@ dependencies = [ "hyper-rustls", "hyper-tls", "hyper-util", - "ipnet", "js-sys", "log", "mime", "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-registry", ] [[package]] name = "ring" -version = "0.17.8" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "rustls" -version = "0.23.22" +version = "0.23.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" dependencies = [ "once_cell", "rustls-pki-types", @@ -1105,25 +1161,19 @@ dependencies = [ ] [[package]] -name = "rustls-pemfile" -version = "2.2.0" +name = "rustls-pki-types" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ - "rustls-pki-types", + "zeroize", ] -[[package]] -name = "rustls-pki-types" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" - [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ "ring", "rustls-pki-types", @@ -1132,15 +1182,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" @@ -1202,18 +1252,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1222,9 +1272,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" dependencies = [ "itoa", "memchr", @@ -1252,13 +1302,19 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + [[package]] name = "slab" version = "0.4.9" @@ -1270,26 +1326,20 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.8" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1332,9 +1382,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.96" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -1352,9 +1402,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1384,23 +1434,22 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.16.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1408,20 +1457,22 @@ dependencies = [ [[package]] name = "tokio" -version = "1.43.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", + "slab", "socket2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1447,9 +1498,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", "tokio", @@ -1457,9 +1508,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -1483,6 +1534,24 @@ dependencies = [ "tower-service", ] +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -1507,9 +1576,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] @@ -1522,9 +1591,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "untrusted" @@ -1543,12 +1612,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -1578,15 +1641,15 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -1672,34 +1735,39 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ + "windows-link", "windows-result", "windows-strings", - "windows-targets", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-targets", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-result", - "windows-targets", + "windows-link", ] [[package]] @@ -1708,7 +1776,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1717,7 +1785,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -1726,14 +1803,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -1742,74 +1835,116 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -1819,9 +1954,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -1852,18 +1987,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -1877,11 +2012,22 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -1890,9 +2036,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index f194d2a..ea4893a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,13 +4,17 @@ version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1.0.95" +anyhow = "1.0.99" clap = { version = "4", features = ["derive", "env"] } -regex = "1.11.1" -reqwest = { version = "0.12.12", features = ["json"] } -serde = {version = "1.0.217", features = ["derive"] } -serde_json = "1.0.138" +regex = "1.11.2" +reqwest = { version = "0.12.23", features = ["json"] } +serde = {version = "1.0.219", features = ["derive"] } +serde_json = "1.0.143" strum = { version = "0.26.3", features = ["derive"] } hex = "0.4.3" secp256k1 = "0.30.0" -tokio = { version = "1.43.0", features = ["full"] } +tokio = { version = "1.47.1", features = ["full"] } + +[dev-dependencies] +insta = { version = "1", features = ["filters"] } +insta-cmd = "0.6.0" diff --git a/src/address.rs b/src/address.rs index 4eec213..45e771e 100644 --- a/src/address.rs +++ b/src/address.rs @@ -1,8 +1,7 @@ use anyhow::Result; use clap::Parser; -use serde_json::Value; -use crate::utils::get; +use crate::utils::{get, print_output}; #[derive(Parser)] pub enum AddressSubcommands { @@ -32,10 +31,8 @@ impl AddressSubcommands { }, }; - let value: Value = get(&url, &endpoint).await?; - - serde_json::to_writer_pretty(std::io::stdout(), &value)?; - println!(); + let output = get(&url, &endpoint).await?; + print_output(output)?; Ok(()) } diff --git a/src/args.rs b/src/args.rs index d29fa96..5df2f1d 100644 --- a/src/args.rs +++ b/src/args.rs @@ -9,7 +9,7 @@ use crate::{ #[command(version)] pub struct Kermit { #[clap(long, short, env, value_hint = ValueHint::Url, - default_value = "https://node.mainnet.alephium.org")] + default_value = "http://localhost:22973")] pub url: String, #[clap(subcommand)] diff --git a/src/events.rs b/src/events.rs index 6680b8b..d2b9ca7 100644 --- a/src/events.rs +++ b/src/events.rs @@ -1,8 +1,7 @@ use anyhow::Result; use clap::Parser; -use serde_json::Value; -use crate::utils::get; +use crate::utils::{get, print_output}; /// CLI arguments for `kermit events`. #[derive(Parser)] @@ -34,7 +33,7 @@ pub enum EventsSubcommands { impl EventsSubcommands { pub async fn run(self, url: &str) -> Result<()> { - let value: Value = match self { + let output = match self { Self::ContractEvents { contract_address, start, @@ -70,8 +69,7 @@ impl EventsSubcommands { }, }; - serde_json::to_writer_pretty(std::io::stdout(), &value)?; - println!(); + print_output(output)?; Ok(()) } diff --git a/src/infos.rs b/src/infos.rs index e822a60..d48fb8e 100644 --- a/src/infos.rs +++ b/src/infos.rs @@ -1,8 +1,8 @@ -use anyhow::{Ok, Result}; +use anyhow::Result; use clap::Parser; -use serde_json::{Value, json}; +use serde_json::json; -use crate::utils::{get, post}; +use crate::utils::{get, post, print_output}; /// CLI arguments for `kermit infos`. #[derive(Parser)] @@ -51,7 +51,7 @@ pub enum InfosSubcommands { #[command(visible_alias = "hh")] HistoryHashrate { from_ts: i64, to_ts: Option }, - /// Get average hashrate from now - timespan(millis) to now. + /// Get average hashrate from `now - timespan(millis)` to now. #[command(visible_alias = "ch")] CurrentHashrate { timespan: Option }, @@ -62,7 +62,7 @@ pub enum InfosSubcommands { impl InfosSubcommands { pub async fn run(self, url: &str) -> Result<()> { - let value: Value = match self { + let output = match self { Self::Node => get(url, "/infos/node").await?, Self::Version => get(url, "/infos/version").await?, Self::ChainParams => get(url, "/infos/chain-params").await?, @@ -85,7 +85,7 @@ impl InfosSubcommands { Self::Discovery { r#type, peers } => { post( url, - "/infos/misbehaviors", + "/infos/discovery", json!({ "type": r#type, "peers": peers @@ -94,24 +94,25 @@ impl InfosSubcommands { .await? }, Self::HistoryHashrate { from_ts, to_ts } => { - let mut endpoint = format!("/infos/history-hashrate?fromTs={}", from_ts); + let mut endpoint = format!("/infos/history-hashrate?fromTs={from_ts}"); if let Some(to_ts) = to_ts { - endpoint.push_str(&format!("&toTs={}", to_ts)); + endpoint.push_str(&format!("&toTs={to_ts}")); } + get(url, &endpoint).await? }, Self::CurrentHashrate { timespan } => { let mut endpoint = "/infos/current-hashrate".to_string(); if let Some(timespan) = timespan { - endpoint.push_str(&format!("?timespan={}", timespan)); + endpoint.push_str(&format!("?timespan={timespan}")); } + get(url, &endpoint).await? }, Self::CurrentDifficulty => get(url, "/infos/current-difficulty").await?, }; - serde_json::to_writer_pretty(std::io::stdout(), &value)?; - println!(); + print_output(output)?; Ok(()) } diff --git a/src/main.rs b/src/main.rs index e70a5af..5903db6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod address; mod args; +mod contract_encoding; mod contracts; mod events; mod infos; @@ -7,8 +8,6 @@ mod transactions; mod utils; mod wallet; -mod contract_encoding; - use anyhow::Result; use args::{Kermit, KermitSubcommand}; use clap::Parser; diff --git a/src/transactions.rs b/src/transactions.rs index b9c18c5..41812f2 100644 --- a/src/transactions.rs +++ b/src/transactions.rs @@ -1,10 +1,10 @@ -use anyhow::{Result, anyhow}; +use anyhow::{Result, anyhow, bail}; use clap::Parser; use secp256k1::{Message, Secp256k1, SecretKey}; use serde::{Deserialize, de::DeserializeOwned}; use serde_json::{Value, json}; -use crate::utils::{get, post}; +use crate::utils::{get, post, print_output}; /// CLI arguments for `kermit transactions`. #[derive(Parser)] @@ -79,7 +79,7 @@ async fn build( amount: String, gas_amount: Option, gas_price: Option, -) -> Result { +) -> Result> { post( url, "/transactions/build", @@ -115,7 +115,7 @@ fn sign(tx_id: &str, private_key: &str) -> Result { Ok(signature) } -async fn submit(url: &str, unsigned_tx: &str, signature: &str) -> Result { +async fn submit(url: &str, unsigned_tx: &str, signature: &str) -> Result> { post( url, "/transactions/submit", @@ -129,7 +129,7 @@ async fn submit(url: &str, unsigned_tx: &str, signature: &str) -> Result impl TransactionsSubcommands { pub async fn run(self, url: &str) -> Result<()> { - let value: Value = match self { + let output = match self { Self::Build { public_key, to_addr, @@ -153,8 +153,11 @@ impl TransactionsSubcommands { gas_price, private_key, } => { - let BuildTransactionResponse { tx_id, unsigned_tx } = - build(url, public_key, to_addr, amount, gas_amount, gas_price).await?; + let Some(BuildTransactionResponse { tx_id, unsigned_tx }) = + build(url, public_key, to_addr, amount, gas_amount, gas_price).await? + else { + bail!("Failed to build transaction"); + }; let signature = sign(&tx_id, &private_key)?; submit(url, &unsigned_tx, &signature).await? @@ -172,8 +175,7 @@ impl TransactionsSubcommands { }, }; - serde_json::to_writer_pretty(std::io::stdout(), &value)?; - println!(); + print_output(output)?; Ok(()) } diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 43230a0..a2a2039 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,2 +1,5 @@ mod reqwest; pub use reqwest::*; + +mod print; +pub use print::*; diff --git a/src/utils/print.rs b/src/utils/print.rs new file mode 100644 index 0000000..cad29f7 --- /dev/null +++ b/src/utils/print.rs @@ -0,0 +1,13 @@ +use anyhow::Result; +use serde_json::Value; + +pub fn print_output(output: Option) -> Result<()> { + if let Some(output) = output { + serde_json::to_writer_pretty(std::io::stdout(), &output)?; + println!(); + } else { + println!("Success!"); + } + + Ok(()) +} diff --git a/src/utils/reqwest.rs b/src/utils/reqwest.rs index 4971ecd..7670fb7 100644 --- a/src/utils/reqwest.rs +++ b/src/utils/reqwest.rs @@ -8,13 +8,13 @@ struct Error { } /// Perform a GET request to the given URL -pub async fn get(url: &str, endpoint: &str) -> Result { +pub async fn get(url: &str, endpoint: &str) -> Result> { let client = Client::new(); - let url = format!("{}{}", url, endpoint); + let url = format!("{url}{endpoint}"); let res = client - .get(&url) + .get(url) .header("Content-Type", "application/json") .send() .await?; @@ -24,7 +24,11 @@ pub async fn get(url: &str, endpoint: &str) -> Result { bail!(err.detail); } - let data = res.json().await?; + let data = if res.content_length() > Some(0) { + Some(res.json().await?) + } else { + None + }; Ok(data) } @@ -34,13 +38,13 @@ pub async fn post( url: &str, endpoint: &str, body: U, -) -> Result { +) -> Result> { let client = Client::new(); - let url = format!("{}{}", url, endpoint); + let url = format!("{url}{endpoint}"); let res = client - .post(&url) + .post(url) .header("Content-Type", "application/json") .json(&body) .send() @@ -51,7 +55,11 @@ pub async fn post( bail!(err.detail); } - let data = res.json().await?; + let data = if res.content_length() > Some(0) { + Some(res.json().await?) + } else { + None + }; Ok(data) } @@ -61,13 +69,13 @@ pub async fn put( url: &str, endpoint: &str, body: U, -) -> Result { +) -> Result> { let client = Client::new(); - let url = format!("{}{}", url, endpoint); + let url = format!("{url}{endpoint}"); let res = client - .put(&url) + .put(url) .header("Content-Type", "application/json") .json(&body) .send() @@ -78,19 +86,23 @@ pub async fn put( bail!(err.detail); } - let data = res.json().await?; + let data = if res.content_length() > Some(0) { + Some(res.json().await?) + } else { + None + }; Ok(data) } /// Perform a DELETE request to the given URL -pub async fn delete(url: &str, endpoint: &str) -> Result<()> { +pub async fn delete(url: &str, endpoint: &str) -> Result> { let client = Client::new(); - let url = format!("{}{}", url, endpoint); + let url = format!("{url}{endpoint}"); let res = client - .delete(&url) + .delete(url) .header("Content-Type", "application/json") .send() .await?; @@ -100,5 +112,11 @@ pub async fn delete(url: &str, endpoint: &str) -> Result<()> { bail!(err.detail); } - Ok(()) + let data = if res.content_length() > Some(0) { + Some(res.json().await?) + } else { + None + }; + + Ok(data) } diff --git a/src/wallet.rs b/src/wallet.rs index 4c277db..4ff5e1f 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -2,7 +2,7 @@ use anyhow::{Result, anyhow}; use clap::Parser; use serde_json::{Value, json}; -use crate::utils::{delete, get, post, put}; +use crate::utils::{delete, get, post, print_output, put}; /// CLI arguments for `kermit wallets`. #[derive(Parser)] @@ -114,7 +114,7 @@ impl WalletsSubcommands { "Invalid URL: Mainnet node is not allowed for wallet operations." )); } - let value: Value = match self { + let output = match self { Self::List => get(url, "/wallets").await?, Self::Restore { mnemonic } => { put(url, "/wallets", json!({ "mnemonic": mnemonic })).await? @@ -142,13 +142,10 @@ impl WalletsSubcommands { url, &format!("/wallets/{}?password={}", wallet_name, password), ) - .await?; - json!("wallet remove") + .await? }, Self::Lock { wallet_name } => { - post::<(), Value>(url, &format!("/wallets/{}/lock", wallet_name), Value::Null) - .await?; - json!("wallet lock") + post(url, &format!("/wallets/{}/lock", wallet_name), Value::Null).await? }, Self::Unlock { wallet_name, @@ -258,8 +255,7 @@ impl WalletsSubcommands { }, }; - serde_json::to_writer_pretty(std::io::stdout(), &value)?; - println!(); + print_output(output)?; Ok(()) } diff --git a/tests/infos.rs b/tests/infos.rs new file mode 100644 index 0000000..8f78680 --- /dev/null +++ b/tests/infos.rs @@ -0,0 +1,132 @@ +mod utils; + +use crate::utils::perform_cmd_test; + +#[test] +fn test_node() { + perform_cmd_test("node", &["infos", "node"]); +} + +#[test] +fn test_version() { + perform_cmd_test("version", &["infos", "version"]); +} + +#[test] +fn test_chain_params() { + perform_cmd_test("chain_params", &["infos", "chain-params"]); +} + +#[test] +fn test_self_clique() { + perform_cmd_test("self_clique", &["infos", "self-clique"]); +} + +#[test] +fn test_inter_clique_peer_info() { + perform_cmd_test( + "inter_clique_peer_info", + &["infos", "inter-clique-peer-info"], + ); +} + +#[test] +fn test_discovered_neighbors() { + perform_cmd_test("discovered_neighbors", &["infos", "discovered-neighbors"]); +} + +#[test] +fn test_misbehaviors() { + perform_cmd_test("misbehaviors", &["infos", "misbehaviors"]); +} + +#[test] +fn test_misbehaviors_ban_unban() { + perform_cmd_test( + "misbehaviors_ban_unban", + &["infos", "misbehaviors-ban-unban", "Unban", "1.2.3.4"], + ); +} + +#[test] +fn test_misbehaviors_ban_unban_no_params() { + perform_cmd_test( + "misbehaviors_ban_unban_no_params", + &["infos", "misbehaviors-ban-unban"], + ); +} + +#[test] +fn test_misbehaviors_ban_unban_bad_param() { + perform_cmd_test( + "misbehaviors_ban_unban_bad_param", + &["infos", "misbehaviors-ban-unban", "UnknownType", "1.2.3.4"], + ); +} + +#[test] +fn test_unreachable_brokers() { + perform_cmd_test("unreachable_brokers", &["infos", "unreachable-brokers"]); +} + +#[test] +fn test_discovery() { + perform_cmd_test("discovery", &["infos", "discovery", "Reachable", "1.2.3.4"]); +} + +#[test] +fn test_discovery_no_params() { + perform_cmd_test("discovery_no_params", &["infos", "discovery"]); +} + +#[test] +fn test_discovery_bad_param() { + perform_cmd_test( + "discovery_bad_param", + &["infos", "discovery", "UnknownType", "1.2.3.4"], + ); +} + +#[test] +fn test_history_hashrate() { + perform_cmd_test( + "history_hashrate", + &["infos", "history-hashrate", "100", "200"], + ); +} + +#[test] +fn test_history_hashrate_no_params() { + perform_cmd_test("history_hashrate_no_params", &["infos", "history-hashrate"]); +} + +#[test] +fn test_history_hashrate_bad_param() { + perform_cmd_test( + "history_hashrate_bad_param", + &["infos", "history-hashrate", "foo"], + ); +} + +#[test] +fn test_current_hashrate() { + perform_cmd_test("current_hashrate", &["infos", "current-hashrate", "100"]); +} + +#[test] +fn test_current_hashrate_no_params() { + perform_cmd_test("current_hashrate_no_params", &["infos", "current-hashrate"]); +} + +#[test] +fn test_current_hashrate_bad_param() { + perform_cmd_test( + "current_hashrate_bad_param", + &["infos", "current-hashrate", "foo"], + ); +} + +#[test] +fn test_current_difficulty() { + perform_cmd_test("current_difficulty", &["infos", "current-difficulty"]); +} diff --git a/tests/main.rs b/tests/main.rs new file mode 100644 index 0000000..644e366 --- /dev/null +++ b/tests/main.rs @@ -0,0 +1,21 @@ +mod utils; + +use crate::utils::perform_cmd_test; + +#[test] +fn test_help() { + perform_cmd_test("help", &["--help"]); +} + +#[test] +fn test_bad_command() { + perform_cmd_test("bad_command", &["invalid-command"]); +} + +#[test] +fn test_bad_url() { + perform_cmd_test( + "bad_url", + &["--url", "http://invalid-url", "infos", "version"], + ); +} diff --git a/tests/snapshots/infos/chain_params.snap b/tests/snapshots/infos/chain_params.snap new file mode 100644 index 0000000..61e0ede --- /dev/null +++ b/tests/snapshots/infos/chain_params.snap @@ -0,0 +1,20 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - chain-params +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "groupNumPerBroker": 4, + "groups": 4, + "networkId": 4, + "numZerosAtLeastInHash": 0 +} + +----- stderr ----- diff --git a/tests/snapshots/infos/current_difficulty.snap b/tests/snapshots/infos/current_difficulty.snap new file mode 100644 index 0000000..cdd8121 --- /dev/null +++ b/tests/snapshots/infos/current_difficulty.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - current-difficulty +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "difficulty": "1" +} + +----- stderr ----- diff --git a/tests/snapshots/infos/current_hashrate.snap b/tests/snapshots/infos/current_hashrate.snap new file mode 100644 index 0000000..1de6a39 --- /dev/null +++ b/tests/snapshots/infos/current_hashrate.snap @@ -0,0 +1,18 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - current-hashrate + - "100" +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "hashrate": "0 MH/s" +} + +----- stderr ----- diff --git a/tests/snapshots/infos/current_hashrate_bad_param.snap b/tests/snapshots/infos/current_hashrate_bad_param.snap new file mode 100644 index 0000000..7484cf3 --- /dev/null +++ b/tests/snapshots/infos/current_hashrate_bad_param.snap @@ -0,0 +1,18 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - current-hashrate + - foo +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: invalid value 'foo' for '[TIMESPAN]': invalid digit found in string + +For more information, try '--help'. diff --git a/tests/snapshots/infos/current_hashrate_no_params.snap b/tests/snapshots/infos/current_hashrate_no_params.snap new file mode 100644 index 0000000..48b1e31 --- /dev/null +++ b/tests/snapshots/infos/current_hashrate_no_params.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - current-hashrate +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "hashrate": "0 MH/s" +} + +----- stderr ----- diff --git a/tests/snapshots/infos/discovered_neighbors.snap b/tests/snapshots/infos/discovered_neighbors.snap new file mode 100644 index 0000000..d977ec4 --- /dev/null +++ b/tests/snapshots/infos/discovered_neighbors.snap @@ -0,0 +1,15 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - discovered-neighbors +--- +success: true +exit_code: 0 +----- stdout ----- +[] + +----- stderr ----- diff --git a/tests/snapshots/infos/discovery.snap b/tests/snapshots/infos/discovery.snap new file mode 100644 index 0000000..3e6fd34 --- /dev/null +++ b/tests/snapshots/infos/discovery.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - discovery + - Unreachable + - 1.2.3.4 +--- +success: true +exit_code: 0 +----- stdout ----- +Success! + +----- stderr ----- diff --git a/tests/snapshots/infos/discovery_bad_param.snap b/tests/snapshots/infos/discovery_bad_param.snap new file mode 100644 index 0000000..b271ebc --- /dev/null +++ b/tests/snapshots/infos/discovery_bad_param.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - discovery + - UnknownType + - 1.2.3.4 +--- +success: false +exit_code: 1 +----- stdout ----- + +----- stderr ----- +Error: Invalid value for: body (invalid tag for tagged object: UnknownType at index 28: decoding failure) diff --git a/tests/snapshots/infos/discovery_no_params.snap b/tests/snapshots/infos/discovery_no_params.snap new file mode 100644 index 0000000..d029079 --- /dev/null +++ b/tests/snapshots/infos/discovery_no_params.snap @@ -0,0 +1,20 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - discovery +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: the following required arguments were not provided: + + +Usage: kermit infos discovery [PEERS]... + +For more information, try '--help'. diff --git a/tests/snapshots/infos/history_hashrate.snap b/tests/snapshots/infos/history_hashrate.snap new file mode 100644 index 0000000..5d943cf --- /dev/null +++ b/tests/snapshots/infos/history_hashrate.snap @@ -0,0 +1,19 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - history-hashrate + - "100" + - "200" +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "hashrate": "0 MH/s" +} + +----- stderr ----- diff --git a/tests/snapshots/infos/history_hashrate_bad_param.snap b/tests/snapshots/infos/history_hashrate_bad_param.snap new file mode 100644 index 0000000..5bb9afd --- /dev/null +++ b/tests/snapshots/infos/history_hashrate_bad_param.snap @@ -0,0 +1,18 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - history-hashrate + - foo +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: invalid value 'foo' for '': invalid digit found in string + +For more information, try '--help'. diff --git a/tests/snapshots/infos/history_hashrate_no_params.snap b/tests/snapshots/infos/history_hashrate_no_params.snap new file mode 100644 index 0000000..654ad2a --- /dev/null +++ b/tests/snapshots/infos/history_hashrate_no_params.snap @@ -0,0 +1,20 @@ +--- +source: tests/utils.rs +assertion_line: 18 +info: + program: kermit + args: + - infos + - history-hashrate +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: the following required arguments were not provided: + + +Usage: kermit infos history-hashrate [TO_TS] + +For more information, try '--help'. diff --git a/tests/snapshots/infos/inter_clique_peer_info.snap b/tests/snapshots/infos/inter_clique_peer_info.snap new file mode 100644 index 0000000..59cd0ed --- /dev/null +++ b/tests/snapshots/infos/inter_clique_peer_info.snap @@ -0,0 +1,15 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - inter-clique-peer-info +--- +success: true +exit_code: 0 +----- stdout ----- +[] + +----- stderr ----- diff --git a/tests/snapshots/infos/misbehaviors.snap b/tests/snapshots/infos/misbehaviors.snap new file mode 100644 index 0000000..4d04976 --- /dev/null +++ b/tests/snapshots/infos/misbehaviors.snap @@ -0,0 +1,15 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - misbehaviors +--- +success: true +exit_code: 0 +----- stdout ----- +[] + +----- stderr ----- diff --git a/tests/snapshots/infos/misbehaviors_ban_unban.snap b/tests/snapshots/infos/misbehaviors_ban_unban.snap new file mode 100644 index 0000000..bdd4e36 --- /dev/null +++ b/tests/snapshots/infos/misbehaviors_ban_unban.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - misbehaviors-ban-unban + - Unban + - 1.2.3.4 +--- +success: true +exit_code: 0 +----- stdout ----- +Success! + +----- stderr ----- diff --git a/tests/snapshots/infos/misbehaviors_ban_unban_bad_param.snap b/tests/snapshots/infos/misbehaviors_ban_unban_bad_param.snap new file mode 100644 index 0000000..9e8487b --- /dev/null +++ b/tests/snapshots/infos/misbehaviors_ban_unban_bad_param.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - misbehaviors-ban-unban + - UnknownType + - 1.2.3.4 +--- +success: false +exit_code: 1 +----- stdout ----- + +----- stderr ----- +Error: Invalid value for: body (invalid tag for tagged object: UnknownType at index 28: decoding failure) diff --git a/tests/snapshots/infos/misbehaviors_ban_unban_no_params.snap b/tests/snapshots/infos/misbehaviors_ban_unban_no_params.snap new file mode 100644 index 0000000..7e1ecc9 --- /dev/null +++ b/tests/snapshots/infos/misbehaviors_ban_unban_no_params.snap @@ -0,0 +1,20 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - misbehaviors-ban-unban +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: the following required arguments were not provided: + + +Usage: kermit infos misbehaviors-ban-unban [PEERS]... + +For more information, try '--help'. diff --git a/tests/snapshots/infos/node.snap b/tests/snapshots/infos/node.snap new file mode 100644 index 0000000..0c9b7ca --- /dev/null +++ b/tests/snapshots/infos/node.snap @@ -0,0 +1,22 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - node +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "buildInfo": { + "commit": "c5f05274997464fdef3dc3bdc9a81d67a6225927", + "releaseVersion": "4.2.4" + }, + "externalAddress": null, + "upnp": true +} + +----- stderr ----- diff --git a/tests/snapshots/infos/self_clique.snap b/tests/snapshots/infos/self_clique.snap new file mode 100644 index 0000000..f8973dc --- /dev/null +++ b/tests/snapshots/infos/self_clique.snap @@ -0,0 +1,27 @@ +--- +source: tests/utils.rs +assertion_line: 14 +info: + program: kermit + args: + - infos + - self-clique +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "cliqueId": "", + "nodes": [ + { + "address": "127.0.0.1", + "minerApiPort": 20973, + "restPort": 22973, + "wsPort": 21973 + } + ], + "selfReady": true, + "synced": true +} + +----- stderr ----- diff --git a/tests/snapshots/infos/unreachable_brokers.snap b/tests/snapshots/infos/unreachable_brokers.snap new file mode 100644 index 0000000..22937e2 --- /dev/null +++ b/tests/snapshots/infos/unreachable_brokers.snap @@ -0,0 +1,15 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - unreachable-brokers +--- +success: true +exit_code: 0 +----- stdout ----- +[] + +----- stderr ----- diff --git a/tests/snapshots/infos/version.snap b/tests/snapshots/infos/version.snap new file mode 100644 index 0000000..84b3c6a --- /dev/null +++ b/tests/snapshots/infos/version.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - infos + - version +--- +success: true +exit_code: 0 +----- stdout ----- +{ + "version": "v4.2.4" +} + +----- stderr ----- diff --git a/tests/snapshots/main/bad_command.snap b/tests/snapshots/main/bad_command.snap new file mode 100644 index 0000000..4f8432f --- /dev/null +++ b/tests/snapshots/main/bad_command.snap @@ -0,0 +1,18 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - invalid-command +--- +success: false +exit_code: 2 +----- stdout ----- + +----- stderr ----- +error: unrecognized subcommand 'invalid-command' + +Usage: kermit [OPTIONS] + +For more information, try '--help'. diff --git a/tests/snapshots/main/bad_url.snap b/tests/snapshots/main/bad_url.snap new file mode 100644 index 0000000..e791524 --- /dev/null +++ b/tests/snapshots/main/bad_url.snap @@ -0,0 +1,17 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - "--url" + - "http://invalid-url" + - infos + - version +--- +success: false +exit_code: 1 +----- stdout ----- + +----- stderr ----- +Error: error sending request for url (http://invalid-url/infos/version) diff --git a/tests/snapshots/main/help.snap b/tests/snapshots/main/help.snap new file mode 100644 index 0000000..875362a --- /dev/null +++ b/tests/snapshots/main/help.snap @@ -0,0 +1,28 @@ +--- +source: tests/utils.rs +assertion_line: 13 +info: + program: kermit + args: + - "--help" +--- +success: true +exit_code: 0 +----- stdout ----- +Usage: kermit [OPTIONS] + +Commands: + events Event for contract, block and hash [aliases: e] + infos Infos about node and hashrate [aliases: i] + transactions Transactions management utilities [aliases: tx] + wallets Wallet management utilities [aliases: w] + address Address management utilities [aliases: a] + contracts Contract management utilities [aliases: c] + help Print this message or the help of the given subcommand(s) + +Options: + -u, --url [env: URL=] [default: http://localhost:22973] + -h, --help Print help + -V, --version Print version + +----- stderr ----- diff --git a/tests/utils.rs b/tests/utils.rs new file mode 100644 index 0000000..49d79b5 --- /dev/null +++ b/tests/utils.rs @@ -0,0 +1,20 @@ +use std::process::Command; + +use insta::with_settings; +use insta_cmd::{assert_cmd_snapshot, get_cargo_bin}; + +const BIN_NAME: &str = "kermit"; +const FILTERS: [(&str, &str); 1] = [( + r#""cliqueId":\s*"[0-9a-f]+""#, + r#""cliqueId": """#, +)]; + +pub fn perform_cmd_test(name: &str, args: &[&str]) { + with_settings!({ + prepend_module_to_snapshot => false, + snapshot_path => format!("snapshots/{}", module_path!().split("::").next().unwrap()), + filters => FILTERS, + }, { + assert_cmd_snapshot!(name, Command::new(get_cargo_bin(BIN_NAME)).args(args)); + }); +}