diff --git a/.gitignore b/.gitignore index fdfcdf663b..2b9932e4b8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ wasms/ **/*.env_v1 **/*.pem **/*.rs.bk -ic-test-state-machine* +pocket-ic* msg.json notes.md notification.did diff --git a/Cargo.lock b/Cargo.lock index b03efef23d..c376f6c9b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -138,24 +138,23 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" @@ -177,9 +176,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -236,7 +235,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.27", + "time", ] [[package]] @@ -310,7 +309,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -342,7 +341,7 @@ dependencies = [ "http", "hyper", "ring", - "time 0.3.27", + "time", "tokio", "tower", "tracing", @@ -491,7 +490,7 @@ dependencies = [ "percent-encoding", "regex", "sha2 0.10.7", - "time 0.3.27", + "time", "tracing", ] @@ -636,7 +635,7 @@ dependencies = [ "num-integer", "ryu", "serde", - "time 0.3.27", + "time", ] [[package]] @@ -710,9 +709,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64-simd" @@ -903,9 +902,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-unit" @@ -919,9 +918,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" @@ -931,9 +930,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytes-utils" @@ -947,9 +946,9 @@ dependencies = [ [[package]] name = "candid" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f6eec0ae850e006ef0fe306f362884d370624094ec55a6a26de18b251774be" +checksum = "f391a0d11d997af68e1a06b5e2ab354079cecb82b6eefb26addb38adf66d351d" dependencies = [ "anyhow", "arbitrary", @@ -966,11 +965,11 @@ dependencies = [ "lalrpop-util", "leb128", "logos", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "num_enum", "paste", - "pretty 0.12.1", + "pretty 0.12.3", "rand", "serde", "serde_bytes", @@ -989,7 +988,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -997,7 +996,7 @@ name = "candid_gen" version = "0.1.0" dependencies = [ "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1022,7 +1021,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.0", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1117,7 +1116,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1193,44 +1192,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", -] - -[[package]] -name = "ciborium" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" - -[[package]] -name = "ciborium-ll" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" -dependencies = [ - "ciborium-io", - "half", + "windows-targets 0.48.5", ] [[package]] @@ -1244,20 +1215,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.24" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.24" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", @@ -1267,21 +1237,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "cmake" @@ -1294,13 +1264,13 @@ dependencies = [ [[package]] name = "coarsetime" -version = "0.1.23" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +checksum = "99280f81a35511dda7d44f7c943491b41d3ac6fd0b54aea92498bec8612a2423" dependencies = [ "libc", "once_cell", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1424,9 +1394,9 @@ checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "convert_case" @@ -1500,9 +1470,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array", "rand_core", @@ -1599,12 +1569,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.12.3", + "hashbrown 0.14.0", "lock_api", "once_cell", "parking_lot_core", @@ -1632,7 +1602,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "pem-rfc7468 0.6.0", "zeroize", ] @@ -1643,7 +1613,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "const-oid 0.9.4", + "const-oid 0.9.5", "pem-rfc7468 0.7.0", "zeroize", ] @@ -1657,7 +1627,7 @@ dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "rusticata-macros", ] @@ -1799,7 +1769,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid 0.9.4", + "const-oid 0.9.5", "crypto-common", "subtle", ] @@ -1864,7 +1834,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1881,9 +1851,9 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "dynamodb_index_store" @@ -1984,7 +1954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array", @@ -2024,9 +1994,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -2060,9 +2030,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -2335,7 +2305,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -2400,7 +2370,7 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -2666,9 +2636,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2718,9 +2688,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2845,9 +2815,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "human_readable" @@ -2864,7 +2834,7 @@ name = "human_readable_derive" version = "0.1.0" dependencies = [ "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -2989,7 +2959,7 @@ dependencies = [ "sha2 0.10.7", "simple_asn1", "thiserror", - "time 0.3.27", + "time", "tokio", "url", ] @@ -3083,18 +3053,6 @@ dependencies = [ "candid", ] -[[package]] -name = "ic-test-state-machine-client" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cadf6ac4a193a8a45287da67c6c385f118d9266f46d6d98e40fbbd469d3822e" -dependencies = [ - "candid", - "ciborium", - "serde", - "serde_bytes", -] - [[package]] name = "ic-utils" version = "0.27.0" @@ -3111,7 +3069,7 @@ dependencies = [ "strum", "strum_macros", "thiserror", - "time 0.3.27", + "time", ] [[package]] @@ -3128,9 +3086,9 @@ dependencies = [ [[package]] name = "ic0" -version = "0.18.11" +version = "0.18.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576c539151d4769fb4d1a0c25c4108dd18facd04c5695b02cf2d226ab4e43aa5" +checksum = "16efdbe5d9b0ea368da50aedbf7640a054139569236f1a5249deb5fd9af5a5d5" [[package]] name = "icdex_canister" @@ -3360,7 +3318,6 @@ dependencies = [ "group_index_canister", "ic-cdk", "ic-ledger-types", - "ic-test-state-machine-client", "icrc1_ledger_canister", "itertools 0.11.0", "lazy_static", @@ -3369,6 +3326,7 @@ dependencies = [ "notifications_canister", "notifications_index_canister", "online_users_canister", + "pocket-ic", "proposals_bot_canister", "rand", "registry_canister", @@ -3408,7 +3366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.8", + "rustix 0.38.14", "windows-sys 0.48.0", ] @@ -3456,9 +3414,9 @@ dependencies = [ [[package]] name = "jwt-simple" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733741e7bcd1532b56c9ba6c698c069f274f3782ad956f0d2c7f31650cedaa1b" +checksum = "1283ac1b6399e76359084aede6e5edda7d8d3dac6725a9623c7c4f0e04bbd4df" dependencies = [ "anyhow", "binstring", @@ -3544,7 +3502,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", "string_cache", "term", "tiny-keccak", @@ -3593,9 +3551,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -3631,9 +3589,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "local_group_index_canister" @@ -3772,9 +3730,9 @@ dependencies = [ [[package]] name = "lodepng" -version = "3.7.2" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ad39f75bbaa4b10bb6f2316543632a8046a5bcf9c785488d79720b21f044f8" +checksum = "73c81862c9e16a943631de5160969379758f13fb3c788110db4ab49430b4feab" dependencies = [ "crc32fast", "fallible_collections", @@ -3809,7 +3767,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -3876,9 +3834,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -3917,7 +3875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -4027,7 +3985,7 @@ version = "0.1.0" dependencies = [ "async-channel", "async-trait", - "base64 0.21.2", + "base64 0.21.4", "futures", "ic-agent", "index_store", @@ -4187,7 +4145,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-complex", "num-integer", "num-iter", @@ -4208,9 +4166,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -4272,7 +4230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-integer", "num-traits", ] @@ -4315,14 +4273,14 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "object" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -4394,11 +4352,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -4415,7 +4373,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4426,18 +4384,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.27.0+1.1.1v" +version = "300.1.5+3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e8f197c82d7511c5b014030c9b1efeda40d7d5f99d23b4ceed3524a5e63f02" +checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -4523,7 +4481,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4578,7 +4536,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b13fe415cdf3c8e44518e18a7c95a13431d9bdf6d15367d82b23c377fdd441a" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "serde", ] @@ -4659,7 +4617,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4715,14 +4673,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -4778,6 +4736,23 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "pocket-ic" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ec0d4fbef9949836203390b819d2ad944f405030f93c724f78d20184d59f85" +dependencies = [ + "async-trait", + "base64 0.13.1", + "candid", + "hex", + "ic-cdk", + "reqwest", + "serde", + "serde_bytes", + "serde_json", +] + [[package]] name = "polling" version = "2.8.0" @@ -4832,13 +4807,13 @@ dependencies = [ [[package]] name = "pretty" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563c9d701c3a31dfffaaf9ce23507ba09cbe0b9125ba176d15e629b0235e9acc" +checksum = "b55c4d17d994b637e2f4daf6e5dc5d660d209d5642377d675d7a1c3ab69fa579" dependencies = [ "arrayvec", "typed-arena", - "unicode-segmentation", + "unicode-width", ] [[package]] @@ -4895,9 +4870,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -5077,25 +5052,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -5112,9 +5087,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "registry_canister" @@ -5185,11 +5160,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -5370,22 +5345,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.7", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -5411,14 +5386,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -5645,18 +5620,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -5682,13 +5657,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5717,9 +5692,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -5734,7 +5709,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5757,7 +5732,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5794,7 +5769,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5896,10 +5871,10 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "thiserror", - "time 0.3.27", + "time", ] [[package]] @@ -5910,9 +5885,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -5934,9 +5909,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "sns1_airdrop" @@ -6055,9 +6030,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -6303,9 +6278,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -6344,7 +6319,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.8", + "rustix 0.38.14", "windows-sys 0.48.0", ] @@ -6361,66 +6336,66 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "test-case" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1d6e7bde536b0412f20765b76e921028059adfd1b90d8974d33fd3c91b25df" +checksum = "c8f1e820b7f1d95a0cdbf97a5df9de10e1be731983ab943e56703ac1b8e9d425" dependencies = [ "test-case-macros", ] [[package]] name = "test-case-core" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10394d5d1e27794f772b6fc854c7e91a2dc26e2cbf807ad523370c2a59c0cee" +checksum = "54c25e2cb8f5fcd7318157634e8838aa6f7e4715c96637f969fabaccd1ef5462" dependencies = [ "cfg-if", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.37", ] [[package]] name = "test-case-macros" -version = "3.1.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb9a44b1c6a54c1ba58b152797739dba2a83ca74e18168a68c980eb142f9404" +checksum = "37cfd7bbc88a0104e304229fba519bdc45501a30b760fb72240342f1289ad257" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.37", "test-case-core", ] [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6435,20 +6410,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -6459,15 +6423,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -6529,7 +6493,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -6542,7 +6506,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6578,9 +6542,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -6607,9 +6571,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "toml_datetime", @@ -6665,7 +6629,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6730,9 +6694,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types" @@ -6763,9 +6727,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -6784,9 +6748,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -6818,9 +6782,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -7003,7 +6967,7 @@ dependencies = [ "sns_governance_canister_c2c_client", "storage_index_canister", "storage_index_canister_c2c_client", - "time 0.3.27", + "time", "tracing", "types", "user_canister", @@ -7090,12 +7054,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -7123,7 +7081,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -7157,7 +7115,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7170,9 +7128,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -7213,24 +7171,11 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ecc0cd7cac091bf682ec5efa18b1cff79d617b84181f38b3951dbe135f607f" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "winapi" @@ -7250,9 +7195,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -7269,7 +7214,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -7287,7 +7232,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -7307,17 +7252,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -7328,9 +7273,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -7340,9 +7285,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -7352,9 +7297,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -7364,9 +7309,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -7376,9 +7321,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -7388,9 +7333,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -7400,26 +7345,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -7436,7 +7382,7 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.27", + "time", ] [[package]] @@ -7506,7 +7452,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fda744dec7..59f893b8bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -147,7 +147,7 @@ ic-cdk-macros = "0.7.0" ic-cdk-timers = "0.4.0" ic-ledger-types = "0.7.0" ic-stable-structures = "0.5.6" -ic-test-state-machine-client = "3.0.0" +pocket-ic = "1.0" ic-utils = "0.27.0" ic0 = "0.18.11" itertools = "0.11.0" diff --git a/backend/integration_tests/Cargo.toml b/backend/integration_tests/Cargo.toml index 28615857b2..3ed0f1b35a 100644 --- a/backend/integration_tests/Cargo.toml +++ b/backend/integration_tests/Cargo.toml @@ -13,7 +13,7 @@ group_canister = { path = "../canisters/group/api" } group_index_canister = { path = "../canisters/group_index/api" } ic-cdk = { workspace = true } ic-ledger-types = { workspace = true } -ic-test-state-machine-client = { workspace = true } +pocket-ic = { workspace = true } icrc1_ledger_canister = { path = "../external_canisters/icrc1_ledger/api" } itertools = { workspace = true } lazy_static = { workspace = true } diff --git a/backend/integration_tests/src/change_group_role_tests.rs b/backend/integration_tests/src/change_group_role_tests.rs index 81ac9e5b85..a9cd75e82f 100644 --- a/backend/integration_tests/src/change_group_role_tests.rs +++ b/backend/integration_tests/src/change_group_role_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChatId, GroupRole}; @@ -29,7 +29,7 @@ fn owner_can_promote_to_and_demote_from_owner() { assert!(matches!(summary1.role, GroupRole::Admin)); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/client/community.rs b/backend/integration_tests/src/client/community.rs index 48b03333e8..5132fb9ddb 100644 --- a/backend/integration_tests/src/client/community.rs +++ b/backend/integration_tests/src/client/community.rs @@ -38,7 +38,7 @@ pub mod happy_path { use crate::rng::random_message_id; use crate::User; use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{ ChannelId, CommunityCanisterChannelSummary, CommunityCanisterCommunitySummary, CommunityCanisterCommunitySummaryUpdates, CommunityId, EventIndex, EventsResponse, MessageContentInitial, MessageId, @@ -46,7 +46,7 @@ pub mod happy_path { }; pub fn create_channel( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, community_id: CommunityId, is_public: bool, @@ -76,7 +76,7 @@ pub mod happy_path { } } - pub fn leave_channel(env: &mut StateMachine, sender: Principal, community_id: CommunityId, channel_id: ChannelId) { + pub fn leave_channel(env: &mut PocketIc, sender: Principal, community_id: CommunityId, channel_id: ChannelId) { let response = super::leave_channel( env, sender, @@ -90,7 +90,7 @@ pub mod happy_path { } pub fn send_text_message( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, community_id: CommunityId, channel_id: ChannelId, @@ -124,7 +124,7 @@ pub mod happy_path { } pub fn update_community( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, community_id: CommunityId, args: &community_canister::update_community::Args, @@ -138,7 +138,7 @@ pub mod happy_path { } pub fn update_channel( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, community_id: CommunityId, args: &community_canister::update_channel::Args, @@ -152,7 +152,7 @@ pub mod happy_path { } pub fn create_user_group( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, community_id: CommunityId, name: String, @@ -172,7 +172,7 @@ pub mod happy_path { } pub fn events_by_index( - env: &StateMachine, + env: &PocketIc, sender: &User, community_id: CommunityId, channel_id: ChannelId, @@ -196,7 +196,7 @@ pub mod happy_path { } } - pub fn summary(env: &StateMachine, sender: &User, community_id: CommunityId) -> CommunityCanisterCommunitySummary { + pub fn summary(env: &PocketIc, sender: &User, community_id: CommunityId) -> CommunityCanisterCommunitySummary { let response = super::summary( env, sender.principal, @@ -211,7 +211,7 @@ pub mod happy_path { } pub fn summary_updates( - env: &StateMachine, + env: &PocketIc, sender: &User, community_id: CommunityId, updates_since: TimestampMillis, @@ -232,7 +232,7 @@ pub mod happy_path { } pub fn selected_initial( - env: &StateMachine, + env: &PocketIc, sender: &User, community_id: CommunityId, ) -> community_canister::selected_initial::SuccessResult { @@ -250,7 +250,7 @@ pub mod happy_path { } pub fn channel_summary( - env: &StateMachine, + env: &PocketIc, sender: &User, community_id: CommunityId, channel_id: ChannelId, @@ -272,7 +272,7 @@ pub mod happy_path { } pub fn selected_channel_initial( - env: &StateMachine, + env: &PocketIc, sender: &User, community_id: CommunityId, channel_id: ChannelId, diff --git a/backend/integration_tests/src/client/group.rs b/backend/integration_tests/src/client/group.rs index 7ebdbc511e..0197044610 100644 --- a/backend/integration_tests/src/client/group.rs +++ b/backend/integration_tests/src/client/group.rs @@ -33,14 +33,14 @@ pub mod happy_path { use crate::rng::random_message_id; use crate::User; use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{ ChatId, EventIndex, EventsResponse, GroupCanisterGroupChatSummary, GroupCanisterGroupChatSummaryUpdates, GroupRole, MessageContentInitial, MessageId, MessageIndex, PollVotes, TextContent, TimestampMillis, UserId, VoteOperation, }; pub fn send_text_message( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, group_chat_id: ChatId, thread_root_message_index: Option, @@ -72,7 +72,7 @@ pub mod happy_path { } pub fn update_group( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, group_chat_id: ChatId, args: &group_canister::update_group_v2::Args, @@ -85,7 +85,7 @@ pub mod happy_path { } } - pub fn change_role(env: &mut StateMachine, sender: Principal, group_chat_id: ChatId, user_id: UserId, new_role: GroupRole) { + pub fn change_role(env: &mut PocketIc, sender: Principal, group_chat_id: ChatId, user_id: UserId, new_role: GroupRole) { let response = super::change_role( env, sender, @@ -104,7 +104,7 @@ pub mod happy_path { } pub fn register_poll_vote( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, group_chat_id: ChatId, message_index: MessageIndex, @@ -129,12 +129,7 @@ pub mod happy_path { } } - pub fn events_by_index( - env: &StateMachine, - sender: &User, - group_chat_id: ChatId, - events: Vec, - ) -> EventsResponse { + pub fn events_by_index(env: &PocketIc, sender: &User, group_chat_id: ChatId, events: Vec) -> EventsResponse { let response = super::events_by_index( env, sender.principal, @@ -153,7 +148,7 @@ pub mod happy_path { } pub fn selected_initial( - env: &StateMachine, + env: &PocketIc, sender: &User, group_chat_id: ChatId, ) -> group_canister::selected_initial::SuccessResult { @@ -170,7 +165,7 @@ pub mod happy_path { } } - pub fn summary(env: &StateMachine, sender: &User, group_chat_id: ChatId) -> GroupCanisterGroupChatSummary { + pub fn summary(env: &PocketIc, sender: &User, group_chat_id: ChatId) -> GroupCanisterGroupChatSummary { let response = super::summary(env, sender.principal, group_chat_id.into(), &group_canister::summary::Args {}); match response { @@ -180,7 +175,7 @@ pub mod happy_path { } pub fn summary_updates( - env: &StateMachine, + env: &PocketIc, sender: &User, group_chat_id: ChatId, updates_since: TimestampMillis, diff --git a/backend/integration_tests/src/client/group_index.rs b/backend/integration_tests/src/client/group_index.rs index fae4c74dc5..f5f4409cd2 100644 --- a/backend/integration_tests/src/client/group_index.rs +++ b/backend/integration_tests/src/client/group_index.rs @@ -14,10 +14,10 @@ generate_update_call!(unfreeze_group); pub mod happy_path { use crate::User; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{CanisterId, CommunityMatch, GroupMatch}; - pub fn explore_communities(env: &StateMachine, sender: &User, group_index_canister_id: CanisterId) -> Vec { + pub fn explore_communities(env: &PocketIc, sender: &User, group_index_canister_id: CanisterId) -> Vec { let response = super::explore_communities( env, sender.principal, @@ -38,7 +38,7 @@ pub mod happy_path { } } - pub fn explore_groups(env: &StateMachine, sender: &User, group_index_canister_id: CanisterId) -> Vec { + pub fn explore_groups(env: &PocketIc, sender: &User, group_index_canister_id: CanisterId) -> Vec { let response = super::explore_groups( env, sender.principal, diff --git a/backend/integration_tests/src/client/icrc1.rs b/backend/integration_tests/src/client/icrc1.rs index 5e687226ed..851acef9bb 100644 --- a/backend/integration_tests/src/client/icrc1.rs +++ b/backend/integration_tests/src/client/icrc1.rs @@ -26,11 +26,11 @@ pub mod happy_path { use super::*; use candid::Principal; use ic_ledger_types::BlockIndex; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::CanisterId; pub fn transfer( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, icp_ledger_canister_id: CanisterId, recipient: Principal, @@ -55,7 +55,7 @@ pub mod happy_path { .unwrap() } - pub fn balance_of(env: &StateMachine, icp_ledger_canister_id: CanisterId, principal: Principal) -> u64 { + pub fn balance_of(env: &PocketIc, icp_ledger_canister_id: CanisterId, principal: Principal) -> u64 { icrc1_balance_of( env, Principal::anonymous(), diff --git a/backend/integration_tests/src/client/local_user_index.rs b/backend/integration_tests/src/client/local_user_index.rs index 7762e23ede..1c170a77c5 100644 --- a/backend/integration_tests/src/client/local_user_index.rs +++ b/backend/integration_tests/src/client/local_user_index.rs @@ -18,14 +18,14 @@ pub mod happy_path { use crate::utils::principal_to_username; use crate::User; use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{CanisterId, ChannelId, ChatId, CommunityId, UserId}; - pub fn register_user(env: &mut StateMachine, canister_id: CanisterId) -> User { + pub fn register_user(env: &mut PocketIc, canister_id: CanisterId) -> User { register_user_with_referrer(env, canister_id, None) } - pub fn register_user_with_referrer(env: &mut StateMachine, canister_id: CanisterId, referral_code: Option) -> User { + pub fn register_user_with_referrer(env: &mut PocketIc, canister_id: CanisterId, referral_code: Option) -> User { let (principal, public_key) = random_user_principal(); let response = super::register_user( @@ -52,7 +52,7 @@ pub mod happy_path { } pub fn invite_users_to_group( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, group_id: ChatId, @@ -75,7 +75,7 @@ pub mod happy_path { } } - pub fn join_group(env: &mut StateMachine, sender: Principal, local_user_index_canister_id: CanisterId, chat_id: ChatId) { + pub fn join_group(env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, chat_id: ChatId) { let response = super::join_group( env, sender, @@ -94,7 +94,7 @@ pub mod happy_path { } pub fn add_users_to_group( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, group_id: ChatId, @@ -116,7 +116,7 @@ pub mod happy_path { } pub fn invite_users_to_community( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, community_id: CommunityId, @@ -136,7 +136,7 @@ pub mod happy_path { } pub fn invite_users_to_channel( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, community_id: CommunityId, @@ -161,7 +161,7 @@ pub mod happy_path { } pub fn join_community( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, community_id: CommunityId, @@ -183,7 +183,7 @@ pub mod happy_path { } pub fn join_channel( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, community_id: CommunityId, @@ -208,7 +208,7 @@ pub mod happy_path { } pub fn add_users_to_community( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, local_user_index_canister_id: CanisterId, community_id: CommunityId, diff --git a/backend/integration_tests/src/client/macros.rs b/backend/integration_tests/src/client/macros.rs index 974ad19c03..c538df41e6 100644 --- a/backend/integration_tests/src/client/macros.rs +++ b/backend/integration_tests/src/client/macros.rs @@ -3,7 +3,7 @@ macro_rules! generate_query_call { ($method_name:ident) => { #[allow(dead_code)] pub fn $method_name( - env: &ic_test_state_machine_client::StateMachine, + env: &pocket_ic::PocketIc, sender: candid::Principal, canister_id: candid::Principal, args: &$method_name::Args, @@ -20,7 +20,7 @@ macro_rules! generate_update_call { ($method_name:ident) => { #[allow(dead_code)] pub fn $method_name( - env: &mut ic_test_state_machine_client::StateMachine, + env: &mut pocket_ic::PocketIc, sender: candid::Principal, canister_id: candid::Principal, args: &$method_name::Args, diff --git a/backend/integration_tests/src/client/mod.rs b/backend/integration_tests/src/client/mod.rs index 94e291baf2..9b26e70a98 100644 --- a/backend/integration_tests/src/client/mod.rs +++ b/backend/integration_tests/src/client/mod.rs @@ -3,7 +3,7 @@ use crate::utils::tick_many; use crate::{CanisterIds, User, T}; use candid::{CandidType, Principal}; use ic_cdk::api::management_canister::main::{CanisterInstallMode, InstallCodeArgument}; -use ic_test_state_machine_client::{StateMachine, UserError, WasmResult}; +use pocket_ic::{PocketIc, UserError, WasmResult}; use serde::de::DeserializeOwned; use types::{CanisterId, CanisterWasm, DiamondMembershipPlanDuration}; @@ -26,13 +26,13 @@ pub mod user_index; const INIT_CYCLES_BALANCE: u128 = 1_000 * T; -pub fn create_canister(env: &mut StateMachine, controller: Principal) -> CanisterId { +pub fn create_canister(env: &mut PocketIc, controller: Principal) -> CanisterId { let canister_id = env.create_canister_with_settings(None, Some(controller)); env.add_cycles(canister_id, INIT_CYCLES_BALANCE); canister_id } -pub fn start_canister(env: &mut StateMachine, sender: Principal, canister_id: CanisterId) { +pub fn start_canister(env: &mut PocketIc, sender: Principal, canister_id: CanisterId) { env.update_call( Principal::management_canister(), sender, @@ -42,7 +42,7 @@ pub fn start_canister(env: &mut StateMachine, sender: Principal, canister_id: Ca .unwrap(); } -pub fn stop_canister(env: &mut StateMachine, sender: Principal, canister_id: CanisterId) { +pub fn stop_canister(env: &mut PocketIc, sender: Principal, canister_id: CanisterId) { env.update_call( Principal::management_canister(), sender, @@ -53,7 +53,7 @@ pub fn stop_canister(env: &mut StateMachine, sender: Principal, canister_id: Can } pub fn install_canister( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, canister_id: CanisterId, wasm: CanisterWasm, @@ -74,7 +74,7 @@ pub fn install_canister( } pub fn execute_query( - env: &StateMachine, + env: &PocketIc, sender: Principal, canister_id: CanisterId, method_name: &str, @@ -84,7 +84,7 @@ pub fn execute_query( } pub fn execute_update( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, canister_id: CanisterId, method_name: &str, @@ -94,7 +94,7 @@ pub fn execute_update( } pub fn execute_update_no_response( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, canister_id: CanisterId, method_name: &str, @@ -104,7 +104,7 @@ pub fn execute_update_no_response( .unwrap(); } -pub fn register_diamond_user(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> User { +pub fn register_diamond_user(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> User { let user = local_user_index::happy_path::register_user(env, canister_ids.local_user_index); icrc1::happy_path::transfer( @@ -128,7 +128,7 @@ pub fn register_diamond_user(env: &mut StateMachine, canister_ids: &CanisterIds, user } -pub fn upgrade_user(user: &User, env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) { +pub fn upgrade_user(user: &User, env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) { icrc1::happy_path::transfer( env, controller, diff --git a/backend/integration_tests/src/client/storage_bucket.rs b/backend/integration_tests/src/client/storage_bucket.rs index b2c1500e27..40d3e9642a 100644 --- a/backend/integration_tests/src/client/storage_bucket.rs +++ b/backend/integration_tests/src/client/storage_bucket.rs @@ -14,7 +14,7 @@ generate_update_call!(upload_chunk_v2); pub mod happy_path { use crate::utils::tick_many; use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use serde_bytes::ByteBuf; use types::{CanisterId, FileId, TimestampMillis}; use utils::hasher::hash_bytes; @@ -22,7 +22,7 @@ pub mod happy_path { const DEFAULT_MIME_TYPE: &str = "test_mime_type"; pub fn upload_file( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, canister_id: CanisterId, file_id: FileId, @@ -62,7 +62,7 @@ pub mod happy_path { } pub fn file_info( - env: &StateMachine, + env: &PocketIc, sender: Principal, canister_id: CanisterId, file_id: FileId, @@ -81,7 +81,7 @@ pub mod happy_path { } } - pub fn file_exists(env: &StateMachine, sender: Principal, canister_id: CanisterId, file_id: FileId) -> bool { + pub fn file_exists(env: &PocketIc, sender: Principal, canister_id: CanisterId, file_id: FileId) -> bool { let response = super::file_info( env, sender, diff --git a/backend/integration_tests/src/client/storage_index.rs b/backend/integration_tests/src/client/storage_index.rs index 8f29309a52..cf1442f142 100644 --- a/backend/integration_tests/src/client/storage_index.rs +++ b/backend/integration_tests/src/client/storage_index.rs @@ -16,13 +16,13 @@ generate_update_call!(upgrade_bucket_canister_wasm); pub mod happy_path { use crate::utils::tick_many; use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use storage_index_canister::add_or_update_users::UserConfig; use storage_index_canister::user::UserRecord; use types::CanisterId; use utils::hasher::hash_bytes; - pub fn add_or_update_users(env: &mut StateMachine, sender: Principal, canister_id: CanisterId, users: Vec) { + pub fn add_or_update_users(env: &mut PocketIc, sender: Principal, canister_id: CanisterId, users: Vec) { let response = super::add_or_update_users( env, sender, @@ -40,7 +40,7 @@ pub mod happy_path { } pub fn allocated_bucket( - env: &StateMachine, + env: &PocketIc, sender: Principal, canister_id: CanisterId, file: &[u8], @@ -66,7 +66,7 @@ pub mod happy_path { } } - pub fn user(env: &StateMachine, sender: Principal, canister_id: CanisterId) -> UserRecord { + pub fn user(env: &PocketIc, sender: Principal, canister_id: CanisterId) -> UserRecord { let response = super::user(env, sender, canister_id, &storage_index_canister::user::Args {}); if let storage_index_canister::user::Response::Success(result) = response { diff --git a/backend/integration_tests/src/client/user.rs b/backend/integration_tests/src/client/user.rs index 42b3a30e93..d018e063ed 100644 --- a/backend/integration_tests/src/client/user.rs +++ b/backend/integration_tests/src/client/user.rs @@ -35,14 +35,14 @@ generate_update_call!(undelete_messages); pub mod happy_path { use crate::rng::random_message_id; use crate::User; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{ CanisterId, Chat, ChatId, CommunityId, Cryptocurrency, EventIndex, EventsResponse, MessageContentInitial, MessageId, Reaction, Rules, TextContent, TimestampMillis, UserId, }; pub fn send_text_message( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, recipient: UserId, text: impl ToString, @@ -70,7 +70,7 @@ pub mod happy_path { } pub fn create_group( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, name: &str, is_public: bool, @@ -100,7 +100,7 @@ pub mod happy_path { } pub fn create_community( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, name: &str, is_public: bool, @@ -132,13 +132,7 @@ pub mod happy_path { } } - pub fn add_reaction( - env: &mut StateMachine, - sender: &User, - user_id: UserId, - reaction: impl ToString, - message_id: MessageId, - ) { + pub fn add_reaction(env: &mut PocketIc, sender: &User, user_id: UserId, reaction: impl ToString, message_id: MessageId) { let response = super::add_reaction( env, sender.principal, @@ -154,7 +148,7 @@ pub mod happy_path { assert!(matches!(response, user_canister::add_reaction::Response::Success)); } - pub fn initial_state(env: &StateMachine, sender: &User) -> user_canister::initial_state::SuccessResult { + pub fn initial_state(env: &PocketIc, sender: &User) -> user_canister::initial_state::SuccessResult { let response = super::initial_state( env, sender.principal, @@ -167,7 +161,7 @@ pub mod happy_path { } pub fn events( - env: &StateMachine, + env: &PocketIc, sender: &User, user_id: UserId, start_index: EventIndex, @@ -196,7 +190,7 @@ pub mod happy_path { } } - pub fn events_by_index(env: &StateMachine, sender: &User, user_id: UserId, events: Vec) -> EventsResponse { + pub fn events_by_index(env: &PocketIc, sender: &User, user_id: UserId, events: Vec) -> EventsResponse { let response = super::events_by_index( env, sender.principal, @@ -215,7 +209,7 @@ pub mod happy_path { } } - pub fn leave_group(env: &mut StateMachine, user: &User, group_id: ChatId) { + pub fn leave_group(env: &mut PocketIc, user: &User, group_id: ChatId) { let response = super::leave_group( env, user.principal, @@ -230,7 +224,7 @@ pub mod happy_path { } pub fn updates( - env: &StateMachine, + env: &PocketIc, user: &User, updates_since: TimestampMillis, ) -> Option { @@ -249,7 +243,7 @@ pub mod happy_path { #[allow(clippy::too_many_arguments)] pub fn tip_message( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, recipient: UserId, chat: Chat, diff --git a/backend/integration_tests/src/client/user_index.rs b/backend/integration_tests/src/client/user_index.rs index 0c1358377a..b9998a2cd7 100644 --- a/backend/integration_tests/src/client/user_index.rs +++ b/backend/integration_tests/src/client/user_index.rs @@ -25,12 +25,12 @@ generate_update_call!(upgrade_user_canister_wasm); pub mod happy_path { use candid::Principal; - use ic_test_state_machine_client::StateMachine; + use pocket_ic::PocketIc; use types::{CanisterId, Cryptocurrency, DiamondMembershipDetails, DiamondMembershipPlanDuration, UserId, UserSummary}; use user_index_canister::users_v2::UserGroup; pub fn current_user( - env: &StateMachine, + env: &PocketIc, sender: Principal, canister_id: CanisterId, ) -> user_index_canister::current_user::SuccessResult { @@ -42,7 +42,7 @@ pub mod happy_path { } } - pub fn set_username(env: &mut StateMachine, sender: Principal, canister_id: CanisterId, username: String) { + pub fn set_username(env: &mut PocketIc, sender: Principal, canister_id: CanisterId, username: String) { let response = super::set_username( env, sender, @@ -55,7 +55,7 @@ pub mod happy_path { } } - pub fn set_display_name(env: &mut StateMachine, sender: Principal, canister_id: CanisterId, display_name: Option) { + pub fn set_display_name(env: &mut PocketIc, sender: Principal, canister_id: CanisterId, display_name: Option) { let response = super::set_display_name( env, sender, @@ -69,7 +69,7 @@ pub mod happy_path { } pub fn pay_for_diamond_membership( - env: &mut StateMachine, + env: &mut PocketIc, sender: Principal, canister_id: CanisterId, duration: DiamondMembershipPlanDuration, @@ -93,7 +93,7 @@ pub mod happy_path { } } - pub fn users(env: &StateMachine, sender: Principal, canister_id: CanisterId, users: Vec) -> Vec { + pub fn users(env: &PocketIc, sender: Principal, canister_id: CanisterId, users: Vec) -> Vec { let user_index_canister::users_v2::Response::Success(result) = super::users_v2( env, sender, diff --git a/backend/integration_tests/src/communities/convert_group_into_community_tests.rs b/backend/integration_tests/src/communities/convert_group_into_community_tests.rs index cf5e6763eb..f4a653ee7b 100644 --- a/backend/integration_tests/src/communities/convert_group_into_community_tests.rs +++ b/backend/integration_tests/src/communities/convert_group_into_community_tests.rs @@ -3,8 +3,8 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; use itertools::Itertools; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChatId, Rules}; @@ -99,7 +99,7 @@ fn not_group_owner_returns_unauthorized() { )); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/create_channel_tests.rs b/backend/integration_tests/src/communities/create_channel_tests.rs index 455d355611..4e5b67f4c3 100644 --- a/backend/integration_tests/src/communities/create_channel_tests.rs +++ b/backend/integration_tests/src/communities/create_channel_tests.rs @@ -2,8 +2,8 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; use itertools::Itertools; +use pocket_ic::PocketIc; use std::ops::Deref; use test_case::test_case; use types::CommunityId; @@ -73,7 +73,7 @@ fn create_channel_succeeds(is_public: bool) { } fn init_test_data( - env: &mut StateMachine, + env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool, diff --git a/backend/integration_tests/src/communities/import_group_tests.rs b/backend/integration_tests/src/communities/import_group_tests.rs index 0580722eba..c677ceb2f1 100644 --- a/backend/integration_tests/src/communities/import_group_tests.rs +++ b/backend/integration_tests/src/communities/import_group_tests.rs @@ -3,8 +3,8 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; use itertools::Itertools; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChatId, CommunityId}; use user_canister::mark_read::ChatMessagesRead; @@ -145,7 +145,7 @@ fn read_up_to_data_maintained_after_import() { assert_eq!(channel.read_by_me_up_to, Some(4.into())); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); let user3 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/join_channel_tests.rs b/backend/integration_tests/src/communities/join_channel_tests.rs index f9c0a6cab1..74da79252c 100644 --- a/backend/integration_tests/src/communities/join_channel_tests.rs +++ b/backend/integration_tests/src/communities/join_channel_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChannelId, CommunityId, MessageContent}; @@ -320,7 +320,7 @@ fn channel_marked_as_read_after_joining() { assert_eq!(user3_channel.read_by_me_up_to, Some(2.into())); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/join_community_tests.rs b/backend/integration_tests/src/communities/join_community_tests.rs index ec01bb4b4c..c57e185864 100644 --- a/backend/integration_tests/src/communities/join_community_tests.rs +++ b/backend/integration_tests/src/communities/join_community_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{CommunityId, Empty, MessageContent}; @@ -249,7 +249,7 @@ fn default_channels_marked_as_read_after_joining() { assert_eq!(channel3.read_by_me_up_to, Some(2.into())); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/remove_member_from_channel_tests.rs b/backend/integration_tests/src/communities/remove_member_from_channel_tests.rs index eb9949d3db..53207cc7cc 100644 --- a/backend/integration_tests/src/communities/remove_member_from_channel_tests.rs +++ b/backend/integration_tests/src/communities/remove_member_from_channel_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::CommunityId; @@ -68,7 +68,7 @@ fn remove_member_from_channel_succeeds() { assert!(user1_summary.channels.iter().any(|c| c.channel_id == channel_id)); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/remove_member_tests.rs b/backend/integration_tests/src/communities/remove_member_tests.rs index ddd7e41e88..18b5bca468 100644 --- a/backend/integration_tests/src/communities/remove_member_tests.rs +++ b/backend/integration_tests/src/communities/remove_member_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{CommunityId, MessageContent}; @@ -151,7 +151,7 @@ fn remove_user_succeeds() { })); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/search_channel_tests.rs b/backend/integration_tests/src/communities/search_channel_tests.rs index 973d0d5c55..11e1dbe299 100644 --- a/backend/integration_tests/src/communities/search_channel_tests.rs +++ b/backend/integration_tests/src/communities/search_channel_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChannelId, CommunityId, MessageIndex}; @@ -44,7 +44,7 @@ fn search_channel_returns_expected_message() { assert_eq!(matches[0].message_index, MessageIndex::from(1)); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); let community_id = diff --git a/backend/integration_tests/src/communities/send_message_tests.rs b/backend/integration_tests/src/communities/send_message_tests.rs index f257000465..b9dc243e46 100644 --- a/backend/integration_tests/src/communities/send_message_tests.rs +++ b/backend/integration_tests/src/communities/send_message_tests.rs @@ -5,8 +5,8 @@ use crate::utils::{now_millis, now_nanos, tick_many}; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; use ic_ledger_types::Tokens; -use ic_test_state_machine_client::StateMachine; use ledger_utils::create_pending_transaction; +use pocket_ic::PocketIc; use std::ops::Deref; use std::time::Duration; use types::{ @@ -598,7 +598,7 @@ fn send_message_with_rules_leads_to_expected_summary_and_selected_states() { ); } -fn get_community_rules(env: &mut StateMachine, user: &User, community_id: CommunityId) -> ChatRules { +fn get_community_rules(env: &mut PocketIc, user: &User, community_id: CommunityId) -> ChatRules { let summary = client::community::happy_path::summary(env, user, community_id); let selected = client::community::happy_path::selected_initial(env, user, community_id); @@ -610,7 +610,7 @@ fn get_community_rules(env: &mut StateMachine, user: &User, community_id: Commun } } -fn get_channel_rules(env: &mut StateMachine, user: &User, community_id: CommunityId, channel_id: ChannelId) -> ChatRules { +fn get_channel_rules(env: &mut PocketIc, user: &User, community_id: CommunityId, channel_id: ChannelId) -> ChatRules { let summary = client::community::happy_path::channel_summary(env, user, community_id, channel_id); let selected = client::community::happy_path::selected_channel_initial(env, user, community_id, channel_id); @@ -631,7 +631,7 @@ struct ChatRules { } fn send_dummy_message_with_rules( - env: &mut StateMachine, + env: &mut PocketIc, sender: &User, community_id: CommunityId, channel_id: ChannelId, @@ -658,7 +658,7 @@ fn send_dummy_message_with_rules( ) } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); let community_id = @@ -678,7 +678,7 @@ fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller } } -fn set_community_rules(env: &mut StateMachine, sender: Principal, community_id: CommunityId, text: String) { +fn set_community_rules(env: &mut PocketIc, sender: Principal, community_id: CommunityId, text: String) { let args = community_canister::update_community::Args { name: None, description: None, @@ -698,13 +698,7 @@ fn set_community_rules(env: &mut StateMachine, sender: Principal, community_id: client::community::happy_path::update_community(env, sender, community_id, &args); } -fn set_channel_rules( - env: &mut StateMachine, - sender: Principal, - community_id: CommunityId, - channel_id: ChannelId, - text: String, -) { +fn set_channel_rules(env: &mut PocketIc, sender: Principal, community_id: CommunityId, channel_id: ChannelId, text: String) { let args = community_canister::update_channel::Args { name: None, description: None, diff --git a/backend/integration_tests/src/communities/update_communities_tests.rs b/backend/integration_tests/src/communities/update_communities_tests.rs index d66d137463..4f10773e38 100644 --- a/backend/integration_tests/src/communities/update_communities_tests.rs +++ b/backend/integration_tests/src/communities/update_communities_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use std::time::Duration; use types::{CommunityId, CommunityPermissionRole, OptionUpdate, OptionalCommunityPermissions}; @@ -202,7 +202,7 @@ fn make_private_community_public_succeeds() { ); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, community_name: &str) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, community_name: &str) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/communities/user_group_tests.rs b/backend/integration_tests/src/communities/user_group_tests.rs index 27814aa056..17696f5c3d 100644 --- a/backend/integration_tests/src/communities/user_group_tests.rs +++ b/backend/integration_tests/src/communities/user_group_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::now_millis; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use std::time::Duration; use types::{ChannelId, CommunityId}; @@ -237,7 +237,7 @@ fn send_message_mentioning_user_group() { ); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); let user3 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/delete_group_tests.rs b/backend/integration_tests/src/delete_group_tests.rs index 880e6333d6..6c09cd84ab 100644 --- a/backend/integration_tests/src/delete_group_tests.rs +++ b/backend/integration_tests/src/delete_group_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, TestEnv, User}; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use std::time::Duration; use types::{CanisterId, ChatId}; @@ -92,7 +92,7 @@ fn user_canister_notified_of_group_deleted() { assert!(initial_state3.group_chats.summaries.iter().any(|c| c.chat_id == group_id)); } -fn init_test_data(env: &mut StateMachine, local_user_index: CanisterId) -> TestData { +fn init_test_data(env: &mut PocketIc, local_user_index: CanisterId) -> TestData { let user1 = client::local_user_index::happy_path::register_user(env, local_user_index); let user2 = client::local_user_index::happy_path::register_user(env, local_user_index); let user3 = client::local_user_index::happy_path::register_user(env, local_user_index); diff --git a/backend/integration_tests/src/freeze_group_tests.rs b/backend/integration_tests/src/freeze_group_tests.rs index 7debe68186..4989bee726 100644 --- a/backend/integration_tests/src/freeze_group_tests.rs +++ b/backend/integration_tests/src/freeze_group_tests.rs @@ -4,7 +4,7 @@ use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; use group_index_canister::freeze_group::SuspensionDetails; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::ChatId; @@ -231,7 +231,7 @@ fn delete_frozen_group() { assert!(!env.canister_exists(Principal::from(group_id).as_slice().try_into().unwrap())); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::register_diamond_user(env, canister_ids, controller); diff --git a/backend/integration_tests/src/join_group_tests.rs b/backend/integration_tests/src/join_group_tests.rs index c2b5988880..d4f8b6276f 100644 --- a/backend/integration_tests/src/join_group_tests.rs +++ b/backend/integration_tests/src/join_group_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::ChatId; @@ -111,7 +111,7 @@ fn join_private_group_using_invite_code_succeeds() { assert!(initial_state.group_chats.summaries.iter().any(|c| c.chat_id == group_id)); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/lib.rs b/backend/integration_tests/src/lib.rs index 45cfd50c8c..0a47eeb0e4 100644 --- a/backend/integration_tests/src/lib.rs +++ b/backend/integration_tests/src/lib.rs @@ -2,7 +2,7 @@ use crate::utils::principal_to_username; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use types::{CanisterId, Cycles, UserId}; mod change_group_role_tests; @@ -40,7 +40,7 @@ mod utils; mod wasms; pub struct TestEnv { - pub env: StateMachine, + pub env: PocketIc, pub canister_ids: CanisterIds, pub controller: Principal, } diff --git a/backend/integration_tests/src/notification_tests.rs b/backend/integration_tests/src/notification_tests.rs index 63a4f3e475..0574b4bd06 100644 --- a/backend/integration_tests/src/notification_tests.rs +++ b/backend/integration_tests/src/notification_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::random_string; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{SubscriptionInfo, SubscriptionKeys}; @@ -156,7 +156,7 @@ fn group_message_notification_muted() { assert!(notifications_response.notifications.is_empty()); } -fn latest_notification_index(env: &StateMachine, notifications_canister_id: Principal, controller: Principal) -> u64 { +fn latest_notification_index(env: &PocketIc, notifications_canister_id: Principal, controller: Principal) -> u64 { let notifications_canister::latest_notification_index::Response::Success(latest_notification_index) = client::notifications::latest_notification_index( env, @@ -168,7 +168,7 @@ fn latest_notification_index(env: &StateMachine, notifications_canister_id: Prin latest_notification_index } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds) -> TestData { let user1 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/platform_moderator_tests.rs b/backend/integration_tests/src/platform_moderator_tests.rs index a4fc0559a7..d9aee99496 100644 --- a/backend/integration_tests/src/platform_moderator_tests.rs +++ b/backend/integration_tests/src/platform_moderator_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{Chat, ChatEvent, ChatId, MessageContent, MultiUserChat}; @@ -109,7 +109,7 @@ fn report_message_succeeds() { } } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::register_diamond_user(env, canister_ids, controller); diff --git a/backend/integration_tests/src/poll_tests.rs b/backend/integration_tests/src/poll_tests.rs index 72eb579135..525f87a51f 100644 --- a/backend/integration_tests/src/poll_tests.rs +++ b/backend/integration_tests/src/poll_tests.rs @@ -1,8 +1,8 @@ use crate::env::ENV; use crate::rng::random_message_id; use crate::{client, TestEnv, User}; -use ic_test_state_machine_client::StateMachine; use itertools::Itertools; +use pocket_ic::PocketIc; use std::collections::HashMap; use std::ops::Deref; use std::time::{Duration, SystemTime}; @@ -75,7 +75,7 @@ fn polls_ended_correctly() { let mut wrapper = ENV.deref().get(); let TestEnv { env, canister_ids, .. } = wrapper.env(); - let current_time = env.time().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis() as u64; + let current_time = env.get_time().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis() as u64; let poll_config1 = PollConfig { text: None, @@ -214,7 +214,7 @@ fn polls_ended_correctly() { } } -fn init_test_data(env: &mut StateMachine, local_user_index: CanisterId, poll_config: PollConfig) -> TestData { +fn init_test_data(env: &mut PocketIc, local_user_index: CanisterId, poll_config: PollConfig) -> TestData { let user1 = client::local_user_index::happy_path::register_user(env, local_user_index); let user2 = client::local_user_index::happy_path::register_user(env, local_user_index); diff --git a/backend/integration_tests/src/remove_from_group_tests.rs b/backend/integration_tests/src/remove_from_group_tests.rs index 2f455b3b23..ca2c39d2db 100644 --- a/backend/integration_tests/src/remove_from_group_tests.rs +++ b/backend/integration_tests/src/remove_from_group_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::ChatId; @@ -86,7 +86,7 @@ fn block_user_who_is_no_longer_group_member_succeeds() { )); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, public: bool) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/setup.rs b/backend/integration_tests/src/setup.rs index f7add6f298..9ecbb3de2b 100644 --- a/backend/integration_tests/src/setup.rs +++ b/backend/integration_tests/src/setup.rs @@ -1,20 +1,44 @@ use crate::client::{create_canister, install_canister}; use crate::rng::random_principal; -use crate::utils::{local_bin, tick_many}; +use crate::utils::tick_many; use crate::{client, wasms, CanisterIds, TestEnv, NNS_INTERNET_IDENTITY_CANISTER_ID, T}; use candid::{CandidType, Principal}; use ic_ledger_types::{AccountIdentifier, BlockIndex, Tokens, DEFAULT_SUBACCOUNT}; -use ic_test_state_machine_client::StateMachine; use icrc1_ledger_canister::MetadataValue; +use pocket_ic::PocketIc; use std::collections::{HashMap, HashSet}; +use std::env; +use std::path::Path; use storage_index_canister::init::CyclesDispenserConfig; use types::icrc1::Account; use types::{BuildVersion, CanisterId}; +pub static POCKET_IC_BIN: &str = "./local-bin/pocket-ic"; + pub fn setup_new_env() -> TestEnv { - let mut file_path = local_bin(); - file_path.push("ic-test-state-machine"); - let mut env = StateMachine::new(file_path.to_str().unwrap(), false); + let path = match env::var_os("POCKET_IC_BIN") { + None => { + env::set_var("POCKET_IC_BIN", POCKET_IC_BIN); + POCKET_IC_BIN.to_string() + } + Some(path) => path + .clone() + .into_string() + .unwrap_or_else(|_| panic!("Invalid string path for {path:?}")), + }; + + if !Path::new(&path).exists() { + println!(" + Could not find the PocketIC binary to run canister integration tests. + + I looked for it at {:?}. You can specify another path with the environment variable POCKET_IC_BIN (note that I run from {:?}). + + Running the testing script will automatically place the PocketIC binary at the right place to be run without setting the POCKET_IC_BIN environment variable: + ./scripts/run-integration-tests.sh + ", &path, &env::current_dir().map(|x| x.display().to_string()).unwrap_or_else(|_| "an unknown directory".to_string())); + } + + let mut env = PocketIc::new(); let controller = random_principal(); let canister_ids = install_canisters(&mut env, controller); @@ -25,7 +49,7 @@ pub fn setup_new_env() -> TestEnv { } } -fn install_canisters(env: &mut StateMachine, controller: Principal) -> CanisterIds { +fn install_canisters(env: &mut PocketIc, controller: Principal) -> CanisterIds { let nns_canister_ids: Vec<_> = (0..12).map(|_| create_canister(env, controller)).collect(); let nns_governance_canister_id = nns_canister_ids[1]; let nns_ledger_canister_id = nns_canister_ids[2]; @@ -338,7 +362,7 @@ fn install_canisters(env: &mut StateMachine, controller: Principal) -> CanisterI } pub fn install_icrc1_ledger( - env: &mut StateMachine, + env: &mut PocketIc, controller: Principal, token_name: String, token_symbol: String, diff --git a/backend/integration_tests/src/tip_message_tests.rs b/backend/integration_tests/src/tip_message_tests.rs index a427c04ac0..d39143a98c 100644 --- a/backend/integration_tests/src/tip_message_tests.rs +++ b/backend/integration_tests/src/tip_message_tests.rs @@ -2,7 +2,7 @@ use crate::env::ENV; use crate::rng::{random_message_id, random_string}; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use std::time::Duration; use types::{Chat, ChatEvent, Cryptocurrency}; @@ -323,7 +323,7 @@ fn tip_channel_message_retries_if_c2c_call_fails() { ); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/update_group_tests.rs b/backend/integration_tests/src/update_group_tests.rs index 2b67bc7bf0..a6fb675ec4 100644 --- a/backend/integration_tests/src/update_group_tests.rs +++ b/backend/integration_tests/src/update_group_tests.rs @@ -3,7 +3,7 @@ use crate::rng::random_string; use crate::utils::tick_many; use crate::{client, CanisterIds, TestEnv, User}; use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::ops::Deref; use types::{ChatId, OptionUpdate::*}; @@ -184,7 +184,7 @@ fn make_private_group_public_succeeds() { assert_eq!(group_summary.min_visible_message_index, 5.into()); } -fn init_test_data(env: &mut StateMachine, canister_ids: &CanisterIds, controller: Principal, group_name: &str) -> TestData { +fn init_test_data(env: &mut PocketIc, canister_ids: &CanisterIds, controller: Principal, group_name: &str) -> TestData { let user1 = client::register_diamond_user(env, canister_ids, controller); let user2 = client::local_user_index::happy_path::register_user(env, canister_ids.local_user_index); diff --git a/backend/integration_tests/src/utils.rs b/backend/integration_tests/src/utils.rs index 407a933799..601419f36d 100644 --- a/backend/integration_tests/src/utils.rs +++ b/backend/integration_tests/src/utils.rs @@ -1,5 +1,5 @@ use candid::Principal; -use ic_test_state_machine_client::StateMachine; +use pocket_ic::PocketIc; use std::path::PathBuf; use std::time::SystemTime; use types::TimestampMillis; @@ -8,18 +8,18 @@ pub fn principal_to_username(principal: Principal) -> String { principal.to_string()[0..5].to_string() } -pub fn tick_many(env: &mut StateMachine, count: usize) { +pub fn tick_many(env: &mut PocketIc, count: usize) { for _ in 0..count { env.tick(); } } -pub fn now_millis(env: &StateMachine) -> TimestampMillis { +pub fn now_millis(env: &PocketIc) -> TimestampMillis { now_nanos(env) / 1_000_000 } -pub fn now_nanos(env: &StateMachine) -> TimestampMillis { - env.time().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_nanos() as u64 +pub fn now_nanos(env: &PocketIc) -> TimestampMillis { + env.get_time().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_nanos() as u64 } pub fn local_bin() -> PathBuf { diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 29dbc0a861..8039ef04fc 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -25,11 +25,11 @@ then fi cd backend/integration_tests/local-bin -echo "Test state machine download starting" -curl -sO https://download.dfinity.systems/ic/ea66978aa1932b30e015f2da739d84f5f3ae731e/binaries/x86_64-$PLATFORM/ic-test-state-machine.gz -gzip -df ic-test-state-machine.gz -chmod +x ic-test-state-machine -echo "Test state machine download completed" +echo "Test PocketIC download starting" +curl -sO https://download.dfinity.systems/ic/307d5847c1d2fe1f5e19181c7d0fcec23f4658b3/binaries/x86_64-$PLATFORM/pocket-ic.gz +gzip -df pocket-ic.gz +chmod +x pocket-ic +echo "Test PocketIC download completed" cd ../../.. ./scripts/download-nns-canister-wasm.sh icp_ledger ledger-canister_notify-method