From c08d9107d21bc776c65da20fa83713233440dbda Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 16:47:31 +0200 Subject: [PATCH 01/14] refactor: remove deprecated `ws_send` method --- src/ic-websocket-cdk/src/lib.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/ic-websocket-cdk/src/lib.rs b/src/ic-websocket-cdk/src/lib.rs index 73f3d67..86488be 100644 --- a/src/ic-websocket-cdk/src/lib.rs +++ b/src/ic-websocket-cdk/src/lib.rs @@ -263,13 +263,6 @@ pub fn send(client_principal: ClientPrincipal, msg_bytes: Vec) -> CanisterSe _ws_send(&client_key, msg_bytes, false) } -#[deprecated(since = "0.3.2", note = "use `ic_websocket_cdk::send` instead")] -#[allow(deprecated)] -/// Deprecated: use [send] instead. -pub fn ws_send(client_principal: ClientPrincipal, msg_bytes: Vec) -> CanisterWsSendResult { - send(client_principal, msg_bytes) -} - /// Closes the connection with the client. /// /// This function **must not** be called in the `on_close` callback. From f42835babea326a46796d5bc82d93f51796c51a2 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 17:00:29 +0200 Subject: [PATCH 02/14] chore: update dependencies closes #8 --- Cargo.lock | 1279 ++++++++++------- Cargo.toml | 12 +- src/ic-websocket-cdk/Cargo.toml | 21 +- src/ic-websocket-cdk/src/state.rs | 2 +- .../src/tests/unit_tests/mod.rs | 2 +- 5 files changed, 791 insertions(+), 525 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c6e36e8..178c566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -31,24 +31,24 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayvec" @@ -56,22 +56,39 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backoff" @@ -86,9 +103,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -117,6 +134,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -163,15 +186,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[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.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -207,9 +224,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -219,9 +236,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cached" @@ -230,7 +247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7c8c50262271cdf5abc979a5f76515c234e764fa025d1ba4862c0f0bcda0e95" dependencies = [ "ahash", - "hashbrown 0.14.2", + "hashbrown", "instant", "once_cell", "thiserror", @@ -245,7 +262,7 @@ dependencies = [ "ahash", "cached_proc_macro", "cached_proc_macro_types", - "hashbrown 0.14.2", + "hashbrown", "instant", "once_cell", "thiserror", @@ -271,9 +288,9 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "candid" -version = "0.10.3" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182543fbc03b4ad0bfc384e6b68346e0b0aad0b11d075b71b4fcaa5d07f8862c" +checksum = "7df77a80c72fcd356cf37ff59c812f37ff06dc9a81232b3aff0a308cb5996904" dependencies = [ "anyhow", "binread", @@ -294,24 +311,21 @@ dependencies = [ [[package]] name = "candid_derive" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970c220da8aa2fa6f7ef5dbbf3ea5b620a59eb3ac107cfb95ae8c6eebdfb7a08" +checksum = "3de398570c386726e7a59d9887b68763c481477f9a043fb998a2e09d428df1a9" dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" [[package]] name = "cfg-if" @@ -319,17 +333,26 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -337,52 +360,48 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -450,15 +469,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -467,9 +486,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -503,9 +522,9 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -532,15 +551,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -557,29 +576,47 @@ dependencies = [ ] [[package]] -name = "encoding_rs" -version = "0.8.33" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -609,18 +646,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -633,9 +670,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -643,15 +680,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -660,38 +697,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -718,9 +755,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -729,9 +766,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "group" @@ -757,15 +794,15 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", "indexmap", "slab", @@ -776,37 +813,28 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", ] -[[package]] -name = "hermit-abi" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hmac" @@ -819,9 +847,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -830,71 +858,99 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", - "pin-project-lite", ] [[package]] -name = "httparse" -version = "1.8.0" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] [[package]] -name = "httpdate" -version = "1.0.3" +name = "httparse" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "hyper" -version = "0.14.27" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http", "hyper", + "hyper-util", "rustls", + "rustls-native-certs", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] name = "ic-agent" -version = "0.33.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32c4711ca94eee9b7966116698b69ca99e7e24cba68c1f3dd86f2ed70218a7e" +checksum = "ba85280257d8663adef20bf5c043b287b3a283d4f916073eb3ca9166a4a59d4b" dependencies = [ + "async-lock", "backoff", "cached 0.46.1", "candid", @@ -914,8 +970,8 @@ dependencies = [ "rand", "rangemap", "reqwest", - "ring 0.16.20", - "rustls-webpki", + "ring", + "rustls-webpki 0.101.7", "sec1", "serde", "serde_bytes", @@ -931,9 +987,9 @@ dependencies = [ [[package]] name = "ic-cbor" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1e30f631a2a5987d843721dd83b49908d0c0cdb21fbcbbb51c1548ff01d99c" +checksum = "07bc917070b8fc4bd88e3199746372e44d507f54c93a9b191787e1caefca1eba" dependencies = [ "candid", "ic-certification", @@ -944,40 +1000,67 @@ dependencies = [ [[package]] name = "ic-cdk" -version = "0.12.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ec8231f413b8a4d74b99d7df26d6e917d6528a6245abde27f251210dcf9b72" +checksum = "f8859bc2b863a77750acf199e1fb7e3fc403e1b475855ba13f59cb4e4036d238" dependencies = [ "candid", - "ic-cdk-macros", - "ic0", + "ic-cdk-macros 0.13.2", + "ic0 0.21.1", + "serde", + "serde_bytes", +] + +[[package]] +name = "ic-cdk" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c44983d6e97135d86132111bae5b86c34c498d96b4f182638bebcc7ac07e03c" +dependencies = [ + "candid", + "ic-cdk-macros 0.15.0", + "ic0 0.23.0", "serde", "serde_bytes", ] [[package]] name = "ic-cdk-macros" -version = "0.8.4" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a618e4020cea88e933d8d2f8c7f86d570ec06213506a80d4f2c520a9bba512" +checksum = "a45800053d80a6df839a71aaea5797e723188c0b992618208ca3b941350c7355" dependencies = [ "candid", "proc-macro2", "quote", "serde", - "serde_tokenstream", + "serde_tokenstream 0.1.7", "syn 1.0.109", ] +[[package]] +name = "ic-cdk-macros" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af44fb4ec3a4b18831c9d3303ca8fa2ace846c4022d50cb8df4122635d3782e" +dependencies = [ + "candid", + "proc-macro2", + "quote", + "serde", + "serde_tokenstream 0.2.1", + "syn 2.0.71", +] + [[package]] name = "ic-cdk-timers" -version = "0.6.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c43b9706fef3ad10c4192a14801d16bd9539068239f0f06f257857441364329" +checksum = "61fdca8e1d9ffb65ae68019b342c182009de9dc206fd849db0b0e90ee19f6fa4" dependencies = [ "futures", - "ic-cdk", - "ic0", + "ic-cdk 0.15.0", + "ic0 0.23.0", "serde", "serde_bytes", "slotmap", @@ -1004,9 +1087,9 @@ dependencies = [ [[package]] name = "ic-certification" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480b6a64a6602ed8c4eac150ef72f2206dc2910069d0cf524b5c6f90d8bc03fc" +checksum = "20052ce9255fbe2de7041a4f6996fddd095ba1f31ae83b6c0ccdee5be6e7bbcf" dependencies = [ "hex", "serde", @@ -1014,22 +1097,11 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "ic-certified-map" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197524aecec47db0b6c0c9f8821aad47272c2bd762c7a0ffe9715eaca0364061" -dependencies = [ - "serde", - "serde_bytes", - "sha2 0.10.8", -] - [[package]] name = "ic-transport-types" -version = "0.33.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d595b9f72e5952bcb22e5cda37ae1c8d6579a24aaa224b63b8d245f386bdcbb2" +checksum = "ce14c068bd053c0f5ab525326f3f358f265cdfcae279fbf6461fb529e9682acd" dependencies = [ "candid", "hex", @@ -1058,20 +1130,19 @@ dependencies = [ name = "ic-websocket-cdk" version = "0.3.4" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "candid", "ic-agent", - "ic-cdk", - "ic-cdk-macros", + "ic-cdk 0.13.2", + "ic-cdk-macros 0.15.0", "ic-cdk-timers", "ic-certificate-verification", "ic-certification", - "ic-certified-map", "lazy_static", "pocket-ic", "proptest", "rand", - "ring 0.16.20", + "ring", "serde", "serde_bytes", "serde_cbor", @@ -1084,6 +1155,12 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" +[[package]] +name = "ic0" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" + [[package]] name = "ic_principal" version = "0.1.1" @@ -1105,9 +1182,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1115,19 +1192,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1140,24 +1217,24 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -1169,9 +1246,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -1181,9 +1258,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -1193,15 +1270,15 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1209,9 +1286,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -1224,9 +1301,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1234,16 +1311,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1252,22 +1319,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1298,66 +1365,66 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.1" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "overload" @@ -1386,11 +1453,17 @@ dependencies = [ "group 0.12.1", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1398,22 +1471,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem" @@ -1436,15 +1509,35 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1464,15 +1557,15 @@ dependencies = [ [[package]] name = "pocket-ic" -version = "2.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c030c06d9d1b3fb0055f41b4b12ecaa5c8e1c60818d2541c3d3e64a9f55ea3" +checksum = "f9765eeff77b8750cf6258eaeea237b96607cd770aa3d4003f021924192b7e4e" dependencies = [ "async-trait", "base64 0.13.1", "candid", "hex", - "ic-cdk", + "ic-cdk 0.13.2", "reqwest", "schemars", "serde", @@ -1508,37 +1601,37 @@ dependencies = [ [[package]] name = "primeorder" -version = "0.13.3" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7dbe9ed3b56368bd99483eb32fe9c17fdd3730aebadc906918ce78d54c7eeb4" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.1", + "bitflags", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -1559,11 +1652,58 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1609,29 +1749,29 @@ dependencies = [ [[package]] name = "rangemap" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795915a3930a5d6bafd9053d37602fea3e61be2e5d4d788983a8ba9654c1c6f2" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1645,13 +1785,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -1662,42 +1802,47 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", - "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", + "hyper-util", "ipnet", "js-sys", "log", "mime", - "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", + "rustls-native-certs", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "system-configuration", + "sync_wrapper", "tokio", "tokio-rustls", + "tokio-socks", "tokio-util", "tower-service", "url", @@ -1721,88 +1866,113 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] -name = "ring" -version = "0.17.5" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ - "log", - "ring 0.17.5", - "rustls-webpki", - "sct", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-fork" @@ -1818,15 +1988,24 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] [[package]] name = "schemars" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "schemars_derive", @@ -1836,14 +2015,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -1852,16 +2031,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", -] - [[package]] name = "sec1" version = "0.7.3" @@ -1876,20 +2045,43 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" -version = "1.0.190" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -1906,31 +2098,31 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -1939,13 +2131,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] @@ -1959,6 +2151,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "serde_tokenstream" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8790a7c3fe883e443eaa2af6f705952bc5d6e8671a220b9335c8cae92c037e74" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.71", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2006,9 +2210,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -2037,45 +2241,29 @@ dependencies = [ [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -2084,9 +2272,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -2113,9 +2301,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" @@ -2136,9 +2324,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -2146,37 +2334,21 @@ dependencies = [ ] [[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2184,8 +2356,8 @@ name = "test_canister" version = "0.1.0" dependencies = [ "candid", - "ic-cdk", - "ic-cdk-macros", + "ic-cdk 0.13.2", + "ic-cdk-macros 0.15.0", "ic-websocket-cdk", "serde", "serde_cbor", @@ -2193,29 +2365,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2223,12 +2395,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2243,18 +2416,19 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2267,44 +2441,76 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.5", - "windows-sys", + "socket2", + "windows-sys 0.48.0", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +dependencies = [ + "either", + "futures-util", + "thiserror", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[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" @@ -2342,7 +2548,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] @@ -2399,9 +2605,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-arena" @@ -2421,20 +2627,11 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2444,24 +2641,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "untrusted" @@ -2471,9 +2662,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2518,9 +2709,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2528,24 +2719,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2555,9 +2746,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2565,28 +2756,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -2597,9 +2788,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2607,9 +2798,12 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "winapi" @@ -2639,7 +2833,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2648,13 +2851,29 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "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]] @@ -2663,74 +2882,122 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[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_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[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_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winreg" -version = "0.50.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.71", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index ef368c5..6d1cf37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,18 +5,18 @@ resolver = "2" [workspace.package] edition = "2021" repository = "https://github.com/omnia-network/ic-websocket-cdk-rs" -rust-version = "1.75.0" +rust-version = "1.79" description = "IC Websocket CDK Rust workspace" license = "MIT" [workspace.dependencies] ic-websocket-cdk = { path = "src/ic-websocket-cdk" } -candid = "0.10.3" -ic-cdk = "0.12.0" -ic-cdk-macros = "0.8.4" -serde = "1.0.176" -serde_cbor = "0.11.2" +candid = "0.10" +ic-cdk = "0.13" +ic-cdk-macros = "0.15" +serde = "1.0" +serde_cbor = "0.11" [profile.canister-release] inherits = "release" diff --git a/src/ic-websocket-cdk/Cargo.toml b/src/ic-websocket-cdk/Cargo.toml index b500598..5046146 100644 --- a/src/ic-websocket-cdk/Cargo.toml +++ b/src/ic-websocket-cdk/Cargo.toml @@ -15,23 +15,22 @@ exclude = ["**/*.did"] candid = { workspace = true } ic-cdk = { workspace = true } ic-cdk-macros = { workspace = true } -ic-cdk-timers = "0.6.0" +ic-cdk-timers = "0.9" serde = { workspace = true } serde_cbor = { workspace = true } -ic-certified-map = "0.4.0" -base64 = "0.21.7" -sha2 = "0.10.8" -serde_bytes = "0.11.12" +ic-certification = "2.5" +base64 = "0.22" +sha2 = "0.10" +serde_bytes = "0.11" [dev-dependencies] -ic-agent = "0.33" -proptest = "1.4" +ic-agent = "0.36" +proptest = "1.5" rand = "0.8" -ring = "0.16" -lazy_static = "1.4" -pocket-ic = "2.2" +ring = "0.17" +lazy_static = "1.5" +pocket-ic = "3.1" ic-certificate-verification = "2.4" -ic-certification = "2.4" [package.metadata.docs.rs] default-target = "wasm32-unknown-unknown" diff --git a/src/ic-websocket-cdk/src/state.rs b/src/ic-websocket-cdk/src/state.rs index 1af4f75..4c905dd 100644 --- a/src/ic-websocket-cdk/src/state.rs +++ b/src/ic-websocket-cdk/src/state.rs @@ -8,7 +8,7 @@ use std::{ use candid::{encode_one, Principal}; #[allow(unused_imports)] use ic_cdk::api::{data_certificate, set_certified_data}; -use ic_certified_map::{labeled, labeled_hash, AsHashTree, Hash as ICHash, RbTree}; +use ic_certification::{labeled, labeled_hash, AsHashTree, Hash as ICHash, RbTree}; use serde::Serialize; use serde_cbor::Serializer; use sha2::{Digest, Sha256}; diff --git a/src/ic-websocket-cdk/src/tests/unit_tests/mod.rs b/src/ic-websocket-cdk/src/tests/unit_tests/mod.rs index de4a9b7..e676961 100644 --- a/src/ic-websocket-cdk/src/tests/unit_tests/mod.rs +++ b/src/ic-websocket-cdk/src/tests/unit_tests/mod.rs @@ -4,7 +4,7 @@ use super::common; use crate::utils::get_current_time; use crate::*; use candid::decode_one; -use ic_certified_map::RbTree; +use ic_certification::RbTree; use proptest::prelude::*; mod utils; From 669a1bd1bac4d69e1be726d11f11b911e073f196 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 18:52:32 +0200 Subject: [PATCH 03/14] chore: update `ic-cdk` to v0.15 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 178c566..24ff9f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,7 +1133,7 @@ dependencies = [ "base64 0.22.1", "candid", "ic-agent", - "ic-cdk 0.13.2", + "ic-cdk 0.15.0", "ic-cdk-macros 0.15.0", "ic-cdk-timers", "ic-certificate-verification", @@ -2356,7 +2356,7 @@ name = "test_canister" version = "0.1.0" dependencies = [ "candid", - "ic-cdk 0.13.2", + "ic-cdk 0.15.0", "ic-cdk-macros 0.15.0", "ic-websocket-cdk", "serde", diff --git a/Cargo.toml b/Cargo.toml index 6d1cf37..9974569 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT" ic-websocket-cdk = { path = "src/ic-websocket-cdk" } candid = "0.10" -ic-cdk = "0.13" +ic-cdk = "0.15" ic-cdk-macros = "0.15" serde = "1.0" serde_cbor = "0.11" From 973f90ccbd4e9cbf2e269458c5fcc5ef33b87a53 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 19:00:40 +0200 Subject: [PATCH 04/14] test: improve logs --- .../tests/integration_tests/c_ws_get_messages.rs | 10 +++++++++- .../g_messages_acknowledgement.rs | 11 ++++++----- .../src/tests/integration_tests/utils/actor.rs | 10 +++++----- .../src/tests/integration_tests/utils/mod.rs | 1 - .../src/tests/integration_tests/utils/test_env.rs | 2 +- src/test_canister/src/canister.rs | 15 ++++++++++++--- 6 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs index 52eef8b..8865f00 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs @@ -274,8 +274,10 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // check that gateway can receive the messages helpers::assert_gateway_has_messages(send_messages_count); + println!("1: send_messages_count: {}", send_messages_count); + // wait for the ack interval to fire - get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); + get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS + 1000); // disconnect the client and check that gateway can still receive the messages call_ws_close_with_panic( @@ -288,6 +290,8 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // check that gateway can still receive the messages, even after the ack interval has fired helpers::assert_gateway_has_messages(expected_messages_len); + println!("2: send_messages_count: {}", send_messages_count); + // wait for the keep alive timeout to expire get_test_env().advance_canister_time_ms(CLIENT_KEEP_ALIVE_TIMEOUT_MS); @@ -295,6 +299,8 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // less than an ack interval ago helpers::assert_gateway_has_messages(expected_messages_len); + println!("3: send_messages_count: {}", send_messages_count); + // wait for next ack interval to expire get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); @@ -302,6 +308,8 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // are removed only in the keep alive timeout callback helpers::assert_gateway_has_messages(expected_messages_len); + println!("4: send_messages_count: {}", send_messages_count); + // wait for the keep alive timeout to expire get_test_env().advance_canister_time_ms(CLIENT_KEEP_ALIVE_TIMEOUT_MS); diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs index cb8ce9e..7eb2d98 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs @@ -101,7 +101,7 @@ fn test_3_client_is_not_removed_if_it_sends_a_keep_alive_before_timeout() { call_ws_open_for_client_key_with_panic(client_1_key); // advance the canister time to make sure the ack timer expires and an ack is sent get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); - // get messages to check if the ack message has been set + // get messages to check if the ack message has been sent let res = call_ws_get_messages_with_panic(GATEWAY_1.deref(), CanisterWsGetMessagesArguments::new(1)); helpers::check_ack_message_result(&res, client_1_key, 0, 2); @@ -223,10 +223,11 @@ mod helpers { websocket_message.sequence_num, expected_websocket_message_sequence_number ); - assert_eq!( - websocket_message.timestamp, - get_test_env().get_canister_time() - ); + // since PocketIC [v4.0.0](https://github.com/dfinity/pocketic/releases/tag/4.0.0), every round advances the subnet time by 1ns, + // making it difficult to compare the timestamps of the messages + // so we can expect the timestamp to be less or equal to the current canister time minus 9ns, + // which corresponds to the number of `tick`s manually advanced in the `advance_canister_time_ms` method + assert!(websocket_message.timestamp <= (get_test_env().get_canister_time() - 9)); assert_eq!( decode_websocket_service_message_content(&websocket_message.content), WebsocketServiceMessageContent::AckMessage(CanisterAckMessageContent { diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/actor.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/actor.rs index 47512d6..f5c9ed9 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/actor.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/actor.rs @@ -32,7 +32,7 @@ pub mod ws_open { fn call_ws_open_with_panic(caller: &Principal, args: CanisterWsOpenArguments) { match call_ws_open(caller, args) { CanisterWsOpenResult::Ok(_) => {}, - CanisterWsOpenResult::Err(err) => panic!("failed ws_open: {:?}", err), + CanisterWsOpenResult::Err(err) => panic!("failed ws_open: {err}"), } } @@ -95,7 +95,7 @@ pub mod ws_message { pub fn call_ws_message_with_panic(caller: &Principal, args: CanisterWsMessageArguments) { match call_ws_message(caller, args) { CanisterWsMessageResult::Ok(_) => {}, - CanisterWsMessageResult::Err(err) => panic!("failed ws_message: {:?}", err), + CanisterWsMessageResult::Err(err) => panic!("failed ws_message: {err}"), } } } @@ -130,7 +130,7 @@ pub mod ws_close { pub fn call_ws_close_with_panic(caller: &Principal, args: CanisterWsCloseArguments) { match call_ws_close(caller, args) { CanisterWsCloseResult::Ok(_) => {}, - CanisterWsCloseResult::Err(err) => panic!("failed ws_close: {:?}", err), + CanisterWsCloseResult::Err(err) => panic!("failed ws_close: {err}"), } } } @@ -176,7 +176,7 @@ pub mod ws_get_messages { ) -> CanisterOutputCertifiedMessages { match call_ws_get_messages(caller, args) { CanisterWsGetMessagesResult::Ok(res) => res, - CanisterWsGetMessagesResult::Err(err) => panic!("failed ws_get_messages: {:?}", err), + CanisterWsGetMessagesResult::Err(err) => panic!("failed ws_get_messages: {err}"), } } } @@ -224,7 +224,7 @@ pub mod send { ) { match call_send(send_to_principal, messages) { CanisterSendResult::Ok(_) => {}, - CanisterSendResult::Err(err) => panic!("failed send: {:?}", err), + CanisterSendResult::Err(err) => panic!("failed send: {err}"), } } } diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/mod.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/mod.rs index 460c958..332b498 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/mod.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/mod.rs @@ -8,7 +8,6 @@ pub mod test_env; pub mod wasm; pub fn bin_folder_path() -> PathBuf { - println!("manifest dir: {:?}", std::env::var("CARGO_MANIFEST_DIR")); let mut file_path = PathBuf::from( std::env::var("CARGO_MANIFEST_DIR") .expect("Failed to read CARGO_MANIFEST_DIR env variable"), diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs index 4191078..c1414fa 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs @@ -97,7 +97,7 @@ impl TestEnv { self.pic.advance_time(Duration::from_millis(ms)); // produce and advance by some blocks to fire eventual timers // see https://forum.dfinity.org/t/pocketic-multi-subnet-canister-testing/24901/4 - for _ in 0..100 { + for _ in 0..10 { self.pic.tick(); } } diff --git a/src/test_canister/src/canister.rs b/src/test_canister/src/canister.rs index 6c1a903..d84ffa3 100644 --- a/src/test_canister/src/canister.rs +++ b/src/test_canister/src/canister.rs @@ -10,13 +10,22 @@ pub struct AppMessage { } pub fn on_open(args: OnOpenCallbackArgs) { - print(format!("Opened websocket: {:?}", args.client_principal)); + print(format!( + "Opened websocket: {}", + args.client_principal.to_text() + )); } pub fn on_message(args: OnMessageCallbackArgs) { - print(format!("Received message: {:?}", args.client_principal)); + print(format!( + "Received message: {}", + args.client_principal.to_text() + )); } pub fn on_close(args: OnCloseCallbackArgs) { - print(format!("Client {:?} disconnected", args.client_principal)); + print(format!( + "Client {} disconnected", + args.client_principal.to_text() + )); } From 088935173a875ac138c1942ff1a161ce80342e7e Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 19:02:22 +0200 Subject: [PATCH 05/14] refactor: improve error logs in timers --- src/ic-websocket-cdk/src/timers.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ic-websocket-cdk/src/timers.rs b/src/ic-websocket-cdk/src/timers.rs index e13f7aa..464ebbf 100644 --- a/src/ic-websocket-cdk/src/timers.rs +++ b/src/ic-websocket-cdk/src/timers.rs @@ -88,9 +88,7 @@ fn send_ack_to_clients_timer_callback() { // TODO: decide what to do when sending the message fails custom_print!( - "[ack-to-clients-timer-cb]: Error sending ack message to client {}: {:?}", - client_key, - e + "[ack-to-clients-timer-cb]: Error sending ack message to client {client_key}: {e}" ); } else { add_client_to_wait_for_keep_alive(client_key); @@ -99,10 +97,8 @@ fn send_ack_to_clients_timer_callback() { Err(e) => { // TODO: decide what to do when getting the expected incoming sequence number fails (shouldn't happen) custom_print!( - "[ack-to-clients-timer-cb]: Error getting expected incoming sequence number for client {}: {:?}", - client_key, - e, - ); + "[ack-to-clients-timer-cb]: Error getting expected incoming sequence number for client {client_key}: {e}" + ); }, } } From 945b820ef9d1842a1123f25f00074d6920f9549c Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 19:11:28 +0200 Subject: [PATCH 06/14] test: revert debug print statements --- .../src/tests/integration_tests/c_ws_get_messages.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs index 8865f00..52eef8b 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs @@ -274,10 +274,8 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // check that gateway can receive the messages helpers::assert_gateway_has_messages(send_messages_count); - println!("1: send_messages_count: {}", send_messages_count); - // wait for the ack interval to fire - get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS + 1000); + get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); // disconnect the client and check that gateway can still receive the messages call_ws_close_with_panic( @@ -290,8 +288,6 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // check that gateway can still receive the messages, even after the ack interval has fired helpers::assert_gateway_has_messages(expected_messages_len); - println!("2: send_messages_count: {}", send_messages_count); - // wait for the keep alive timeout to expire get_test_env().advance_canister_time_ms(CLIENT_KEEP_ALIVE_TIMEOUT_MS); @@ -299,8 +295,6 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // less than an ack interval ago helpers::assert_gateway_has_messages(expected_messages_len); - println!("3: send_messages_count: {}", send_messages_count); - // wait for next ack interval to expire get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); @@ -308,8 +302,6 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ // are removed only in the keep alive timeout callback helpers::assert_gateway_has_messages(expected_messages_len); - println!("4: send_messages_count: {}", send_messages_count); - // wait for the keep alive timeout to expire get_test_env().advance_canister_time_ms(CLIENT_KEEP_ALIVE_TIMEOUT_MS); From 82fa1a1c0f0449540ae56464875550e4e32ae71c Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 20:08:43 +0200 Subject: [PATCH 07/14] test: fix acknowledgement tests, adapting to the latest pocketic logic --- .../g_messages_acknowledgement.rs | 20 +++++++++++-------- .../tests/integration_tests/utils/test_env.rs | 12 +++++++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs index 7eb2d98..8d13814 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs @@ -8,7 +8,7 @@ use crate::{ types::CloseMessageReason, CanisterOutputCertifiedMessages, CanisterWsCloseArguments, CanisterWsCloseResult, CanisterWsGetMessagesArguments, CanisterWsMessageArguments, ClientKeepAliveMessageContent, - WebsocketServiceMessageContent, CLIENT_KEEP_ALIVE_TIMEOUT_MS, + WebsocketServiceMessageContent, CLIENT_KEEP_ALIVE_TIMEOUT_MS, CLIENT_KEEP_ALIVE_TIMEOUT_NS, }; use super::utils::{ @@ -106,6 +106,8 @@ fn test_3_client_is_not_removed_if_it_sends_a_keep_alive_before_timeout() { call_ws_get_messages_with_panic(GATEWAY_1.deref(), CanisterWsGetMessagesArguments::new(1)); helpers::check_ack_message_result(&res, client_1_key, 0, 2); + let current_time = get_test_env().get_canister_time(); + // send keep alive message call_ws_message_with_panic( &client_1_key.client_principal, @@ -120,8 +122,11 @@ fn test_3_client_is_not_removed_if_it_sends_a_keep_alive_before_timeout() { true, )), ); - // advance the canister time to make sure the keep alive timeout expires and the canister checks the keep alive - get_test_env().advance_canister_time_ms(CLIENT_KEEP_ALIVE_TIMEOUT_MS); + + // advance the canister time to make sure the keep alive timeout expires and the canister checks the keep alive, + // keeping into account the time elapsed in the previous rounds + let elapsed_time = get_test_env().get_canister_time() - current_time; + get_test_env().advance_canister_time_ns(CLIENT_KEEP_ALIVE_TIMEOUT_NS - elapsed_time); // send a message to the canister to see the sequence number increasing in the ack message // and be sure that the client has not been removed call_ws_message_with_panic( @@ -223,11 +228,10 @@ mod helpers { websocket_message.sequence_num, expected_websocket_message_sequence_number ); - // since PocketIC [v4.0.0](https://github.com/dfinity/pocketic/releases/tag/4.0.0), every round advances the subnet time by 1ns, - // making it difficult to compare the timestamps of the messages - // so we can expect the timestamp to be less or equal to the current canister time minus 9ns, - // which corresponds to the number of `tick`s manually advanced in the `advance_canister_time_ms` method - assert!(websocket_message.timestamp <= (get_test_env().get_canister_time() - 9)); + assert_eq!( + websocket_message.timestamp, + get_test_env().get_canister_time() + ); assert_eq!( decode_websocket_service_message_content(&websocket_message.content), WebsocketServiceMessageContent::AckMessage(CanisterAckMessageContent { diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs index c1414fa..20aef0d 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs @@ -10,6 +10,8 @@ use pocket_ic::{PocketIc, PocketIcBuilder}; use super::wasm::{load_canister_wasm_from_bin, load_canister_wasm_from_path}; +const NS_IN_MS: u64 = 1_000_000; + /// The maximum number of messages returned by the **ws_get_messages** method. pub const DEFAULT_TEST_MAX_NUMBER_OF_RETURNED_MESSAGES: u64 = 50; @@ -94,11 +96,13 @@ impl TestEnv { } pub fn advance_canister_time_ms(&self, ms: u64) { - self.pic.advance_time(Duration::from_millis(ms)); + self.advance_canister_time_ns(ms * NS_IN_MS); + } + + pub fn advance_canister_time_ns(&self, ns: u64) { + self.pic.advance_time(Duration::from_nanos(ns)); // produce and advance by some blocks to fire eventual timers // see https://forum.dfinity.org/t/pocketic-multi-subnet-canister-testing/24901/4 - for _ in 0..10 { - self.pic.tick(); - } + self.pic.tick(); } } From bcc76dc765e1d3dd8f361d86b28e4599249337a9 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 20:30:00 +0200 Subject: [PATCH 08/14] test: fix tests accounting for the changes in how pocketic handles time --- .../tests/integration_tests/c_ws_get_messages.rs | 13 ++++++++----- .../src/tests/integration_tests/utils/test_env.rs | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs index 52eef8b..5505bfb 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs @@ -16,7 +16,7 @@ use super::utils::{ messages::{get_next_polling_nonce_from_messages, verify_messages, AppMessage}, test_env::{ get_test_env, DEFAULT_TEST_MAX_NUMBER_OF_RETURNED_MESSAGES, - DEFAULT_TEST_SEND_ACK_INTERVAL_MS, + DEFAULT_TEST_SEND_ACK_INTERVAL_MS, DEFAULT_TEST_SEND_ACK_INTERVAL_NS, }, }; @@ -260,6 +260,7 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ let send_messages_count = 10; // first, reset the canister call_wipe(None); + let current_time = get_test_env().get_canister_time(); // second, register client 1 let client_1_key = CLIENT_1_KEY.deref(); call_ws_open_for_client_key_with_panic(client_1_key); @@ -269,13 +270,14 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ text: format!("test{}", i), }) .collect(); - call_send_with_panic(&client_1_key.client_principal, messages_to_send.clone()); + call_send_with_panic(&client_1_key.client_principal, messages_to_send); // check that gateway can receive the messages helpers::assert_gateway_has_messages(send_messages_count); - // wait for the ack interval to fire - get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); + // wait for the ack interval to fire, accounting for the time elapsed in the previous rounds + let elapsed_time = get_test_env().get_canister_time() - current_time; + get_test_env().advance_canister_time_ns(DEFAULT_TEST_SEND_ACK_INTERVAL_NS - elapsed_time); // disconnect the client and check that gateway can still receive the messages call_ws_close_with_panic( @@ -296,7 +298,8 @@ fn test_7_empty_gateway_can_get_messages_until_next_keep_alive_check_if_removed_ helpers::assert_gateway_has_messages(expected_messages_len); // wait for next ack interval to expire - get_test_env().advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS); + get_test_env() + .advance_canister_time_ms(DEFAULT_TEST_SEND_ACK_INTERVAL_MS - CLIENT_KEEP_ALIVE_TIMEOUT_MS); // the gateway can still receive the messages, because empty expired gateways // are removed only in the keep alive timeout callback diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs index 20aef0d..e26c285 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs @@ -20,6 +20,8 @@ pub const DEFAULT_TEST_MAX_NUMBER_OF_RETURNED_MESSAGES: u64 = 50; /// /// Value: `300_000` = 5 minutes pub const DEFAULT_TEST_SEND_ACK_INTERVAL_MS: u64 = 300_000; +/// Same as [DEFAULT_TEST_SEND_ACK_INTERVAL_MS], but in nanoseconds. +pub const DEFAULT_TEST_SEND_ACK_INTERVAL_NS: u64 = DEFAULT_TEST_SEND_ACK_INTERVAL_MS * NS_IN_MS; /// (`max_number_or_returned_messages`, `send_ack_interval_ms`) pub type CanisterInitArgs = (u64, u64); From 8fb4c725b647aa902e37530eff15c52688847992 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sat, 20 Jul 2024 20:31:45 +0200 Subject: [PATCH 09/14] chore: bump to version v0.4.0 --- Cargo.lock | 2 +- src/ic-websocket-cdk/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24ff9f7..944d419 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,7 +1128,7 @@ dependencies = [ [[package]] name = "ic-websocket-cdk" -version = "0.3.4" +version = "0.4.0" dependencies = [ "base64 0.22.1", "candid", diff --git a/src/ic-websocket-cdk/Cargo.toml b/src/ic-websocket-cdk/Cargo.toml index 5046146..6f12dff 100644 --- a/src/ic-websocket-cdk/Cargo.toml +++ b/src/ic-websocket-cdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ic-websocket-cdk" -version = "0.3.4" +version = "0.4.0" edition.workspace = true rust-version.workspace = true repository.workspace = true From 030c208c41cad741ccc8c225f07286dd3834fe6c Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sun, 21 Jul 2024 19:31:18 +0200 Subject: [PATCH 10/14] ci: publish npm package only when release is created --- .github/workflows/release.yml | 43 ++++------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df0378b..ab9240d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,13 @@ -name: Release ic-websocket-cdk-rs +name: Publish ic-websocket-cdk-rs -# only run when the tests complete +# only run when a release is published on: - workflow_run: - workflows: [ic-websocket-cdk-rs tests] - types: - - completed - branches: - - main - workflow_dispatch: + release: + types: [published] jobs: publish: runs-on: ubuntu-latest - # only run if the tests were successful or the workflow was dispatched manually - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} - outputs: - version: ${{ steps.cargo-publish.outputs.version }} steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -33,29 +24,3 @@ jobs: echo "version=$(cargo pkgid -p ic-websocket-cdk | cut -d# -f2 | cut -d: -f2)" >> "$GITHUB_OUTPUT" env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - tag: - needs: publish - runs-on: ubuntu-latest - outputs: - version: ${{ steps.tag_version.outputs.new_tag }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ needs.publish.outputs.version }} - - release: - needs: tag - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ needs.tag.outputs.version }} From ddb63c98b8ecfbb2dabb6ebc8598a7ecea7b4503 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sun, 21 Jul 2024 19:32:16 +0200 Subject: [PATCH 11/14] ci: remove action job output --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab9240d..bbaa62a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,5 @@ jobs: run: | rustup target add wasm32-unknown-unknown cargo publish -p ic-websocket-cdk - echo "version=$(cargo pkgid -p ic-websocket-cdk | cut -d# -f2 | cut -d: -f2)" >> "$GITHUB_OUTPUT" env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 1017e701e5867851fb236a3c2f4f96b394e5c186 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sun, 21 Jul 2024 20:33:41 +0200 Subject: [PATCH 12/14] fix: typo --- .../src/tests/integration_tests/utils/messages.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/messages.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/messages.rs index 526ce61..8e0da2e 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/messages.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/messages.rs @@ -136,7 +136,7 @@ fn verify_message( } // check the certification - assert!(is_valid_certificate(&get_test_env(), cert, tree,)); + assert!(is_valid_certificate(&get_test_env(), cert, tree)); assert!(is_message_body_valid(&message.key, &message.content, tree)); } From 6e3a75f2d90eceaaa65eb86bf09ac67e3becd7d6 Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sun, 21 Jul 2024 20:44:44 +0200 Subject: [PATCH 13/14] test: reduce number of test cases to speed up tests --- .../src/tests/integration_tests/c_ws_get_messages.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs index 5505bfb..1181961 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/c_ws_get_messages.rs @@ -21,7 +21,7 @@ use super::utils::{ }; proptest! { - #![proptest_config(ProptestConfig::with_cases(50))] + #![proptest_config(ProptestConfig::with_cases(10))] #[test] fn test_1_non_registered_gateway_should_receive_empty_messages(ref test_gateway_principal in any::().prop_map(|_| common::generate_random_principal())) { From 9c9bc0189229c8752f8d8d521607f0b1a8d39cae Mon Sep 17 00:00:00 2001 From: ilbertt Date: Sun, 21 Jul 2024 20:45:54 +0200 Subject: [PATCH 14/14] test: fix advance time to account for ticks --- .../g_messages_acknowledgement.rs | 7 +++---- .../src/tests/integration_tests/utils/test_env.rs | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs index 8d13814..086400a 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/g_messages_acknowledgement.rs @@ -228,10 +228,9 @@ mod helpers { websocket_message.sequence_num, expected_websocket_message_sequence_number ); - assert_eq!( - websocket_message.timestamp, - get_test_env().get_canister_time() - ); + // testing the timestamp is difficult, since pocketic advances the time + // at every round (at every update call) + assert!(websocket_message.timestamp <= get_test_env().get_canister_time()); assert_eq!( decode_websocket_service_message_content(&websocket_message.content), WebsocketServiceMessageContent::AckMessage(CanisterAckMessageContent { diff --git a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs index e26c285..54e283d 100644 --- a/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs +++ b/src/ic-websocket-cdk/src/tests/integration_tests/utils/test_env.rs @@ -101,10 +101,21 @@ impl TestEnv { self.advance_canister_time_ns(ms * NS_IN_MS); } + /// # Panics + /// If time is advanced for less than 100ns, due to an internal logic + /// that accounts for the time advanced in `tick`s. pub fn advance_canister_time_ns(&self, ns: u64) { - self.pic.advance_time(Duration::from_nanos(ns)); + // when calling `tick`, the time on pic advances by 1ns, + // so we have to account for that difference here + let ticks = 0..100; + let advance_diff = ticks.len() as u64; + assert!(ns > advance_diff, "Cannot advance for less than 99ns"); + self.pic + .advance_time(Duration::from_nanos(ns - advance_diff)); // produce and advance by some blocks to fire eventual timers // see https://forum.dfinity.org/t/pocketic-multi-subnet-canister-testing/24901/4 - self.pic.tick(); + for _ in ticks { + self.pic.tick(); + } } }