From 60abbd4a082cb47765b899903d1e18c74a56361e Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Thu, 27 Feb 2025 15:18:48 +0100 Subject: [PATCH 1/3] chore(ci): bump PocketIC to v7.0.0 (library) and v8.0.0 (server) --- Cargo.lock | 238 ++++++++++-------- Cargo.toml | 2 +- scripts/run-integration-tests.sh | 2 +- tests/integration/src/control_panel_tests.rs | 13 +- tests/integration/src/cycles_monitor_tests.rs | 13 +- .../src/external_canister_tests.rs | 2 +- tests/integration/src/http.rs | 16 +- tests/integration/src/notification.rs | 33 +-- .../src/station_test_data/asset.rs | 6 +- .../src/station_test_data/named_rule.rs | 6 +- .../src/station_test_data/request_policy.rs | 6 +- tests/integration/src/utils.rs | 28 +-- 12 files changed, 186 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 581f4ed67..696857783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,7 +268,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -557,7 +557,7 @@ dependencies = [ "hashbrown", "instant", "once_cell", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -570,7 +570,7 @@ dependencies = [ "hashbrown", "instant", "once_cell", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -634,7 +634,7 @@ dependencies = [ "serde", "serde_bytes", "stacker", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -646,7 +646,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -665,7 +665,7 @@ dependencies = [ "logos", "num-bigint 0.4.6", "pretty", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -684,7 +684,7 @@ dependencies = [ "num-bigint 0.4.6", "serde", "serde_bytes", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -822,7 +822,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -897,7 +897,7 @@ dependencies = [ "serde_cbor", "serde_json", "station-api", - "thiserror", + "thiserror 1.0.63", "tokio", "uuid", ] @@ -1183,7 +1183,7 @@ dependencies = [ "slog", "tar", "tempfile", - "thiserror", + "thiserror 1.0.63", "time", "tiny-bip39", "url", @@ -1218,7 +1218,7 @@ dependencies = [ "slog-term", "station-api", "tabled", - "thiserror", + "thiserror 1.0.63", "tokio", ] @@ -1231,7 +1231,7 @@ dependencies = [ "console", "shell-words", "tempfile", - "thiserror", + "thiserror 1.0.63", "zeroize", ] @@ -1295,7 +1295,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -1353,7 +1353,7 @@ dependencies = [ "rand_core", "serde", "sha2 0.9.9", - "thiserror", + "thiserror 1.0.63", "zeroize", ] @@ -1678,7 +1678,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -1842,7 +1842,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2102,7 +2102,7 @@ dependencies = [ "serde_repr", "sha2 0.10.8", "simple_asn1", - "thiserror", + "thiserror 1.0.63", "time", "tokio", "tower-service", @@ -2135,7 +2135,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "slog", - "thiserror", + "thiserror 1.0.63", "tokio", "walkdir", ] @@ -2150,7 +2150,7 @@ dependencies = [ "ic-certification 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "leb128", "nom", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2244,7 +2244,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.2", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -2258,7 +2258,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.2", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -2291,7 +2291,7 @@ dependencies = [ "nom", "parking_lot 0.12.3", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2317,6 +2317,18 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "ic-certification" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb40d73f9f8273dc6569a68859003bbd467c9dc6d53c6fd7d174742f857209d" +dependencies = [ + "hex", + "serde", + "serde_bytes", + "sha2 0.10.8", +] + [[package]] name = "ic-certified-assets" version = "0.2.5" @@ -2349,7 +2361,7 @@ dependencies = [ "ic-certification 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ic-representation-independent-hash 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", - "thiserror", + "thiserror 1.0.63", "urlencoding", ] @@ -2363,7 +2375,7 @@ dependencies = [ "ic-certification 2.6.0 (git+https://github.com/dfinity/response-verification?rev=da70db93832f88ecc556ae082612aedec47d3816)", "ic-representation-independent-hash 2.6.0 (git+https://github.com/dfinity/response-verification?rev=da70db93832f88ecc556ae082612aedec47d3816)", "serde", - "thiserror", + "thiserror 1.0.63", "urlencoding", ] @@ -2378,7 +2390,7 @@ dependencies = [ "pkcs11", "sha2 0.10.8", "simple_asn1", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2435,7 +2447,7 @@ dependencies = [ "log", "nom", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", "urlencoding", ] @@ -2450,9 +2462,9 @@ dependencies = [ [[package]] name = "ic-transport-types" -version = "0.37.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875dc4704780383112e8e8b5063a1b98de114321d0c7d3e7f635dcf360a57fba" +checksum = "894b183f280e87b29aac98e7de0972cf632435e1f0a462969d9f5e0ccacc4d25" dependencies = [ "candid", "hex", @@ -2460,27 +2472,28 @@ dependencies = [ "leb128", "serde", "serde_bytes", + "serde_cbor", "serde_repr", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", ] [[package]] name = "ic-transport-types" -version = "0.38.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894b183f280e87b29aac98e7de0972cf632435e1f0a462969d9f5e0ccacc4d25" +checksum = "979ee7bee5a67150a4c090fb012c93c294a528b4a867bad9a15cc6d01cb4227f" dependencies = [ "candid", "hex", - "ic-certification 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ic-certification 3.0.3", "leb128", "serde", "serde_bytes", "serde_cbor", "serde_repr", "sha2 0.10.8", - "thiserror", + "thiserror 2.0.11", ] [[package]] @@ -2500,7 +2513,7 @@ dependencies = [ "sha2 0.10.8", "strum", "strum_macros", - "thiserror", + "thiserror 1.0.63", "time", "tokio", ] @@ -2556,7 +2569,7 @@ dependencies = [ "data-encoding", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2694,7 +2707,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -2992,9 +3005,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libloading" @@ -3077,7 +3090,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -3201,7 +3214,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -3395,7 +3408,7 @@ dependencies = [ "serde_cbor", "serde_json", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", "time", "tokio", "uuid", @@ -3407,7 +3420,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -3580,7 +3593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.63", "ucd-trie", ] @@ -3604,7 +3617,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -3660,7 +3673,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -3707,15 +3720,17 @@ dependencies = [ [[package]] name = "pocket-ic" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "124a2380ca6f557adf8b02517cbfd2f564113230e14cda6f6aadd3dfe156293c" +checksum = "ccd672d6b262731dccae40cb561e4c578709ea9987fbf649377d51077bf16db3" dependencies = [ + "backoff", "base64 0.13.1", "candid", + "flate2", "hex", - "ic-certification 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ic-transport-types 0.37.1", + "ic-certification 3.0.3", + "ic-transport-types 0.39.3", "reqwest", "schemars", "serde", @@ -3726,7 +3741,7 @@ dependencies = [ "slog", "strum", "strum_macros", - "thiserror", + "thiserror 2.0.11", "tokio", "tracing", "tracing-appender", @@ -3874,9 +3889,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -3893,7 +3908,7 @@ dependencies = [ "memchr", "parking_lot 0.12.3", "protobuf", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -3924,7 +3939,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -3941,7 +3956,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "slab", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tracing", ] @@ -4030,7 +4045,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4217,7 +4232,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.76", + "syn 2.0.98", "unicode-ident", ] @@ -4395,7 +4410,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4492,9 +4507,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] @@ -4520,13 +4535,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4537,7 +4552,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4560,7 +4575,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4583,7 +4598,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4690,7 +4705,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -4864,7 +4879,7 @@ dependencies = [ "sha2 0.10.8", "station-api", "strum", - "thiserror", + "thiserror 1.0.63", "tokio", "upgrader-api", "uuid", @@ -4926,7 +4941,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -4954,9 +4969,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -4980,7 +4995,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -5081,7 +5096,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -5092,7 +5116,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -5149,7 +5184,7 @@ dependencies = [ "rand", "rustc-hash 1.1.0", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.63", "unicode-normalization", "wasm-bindgen", "zeroize", @@ -5191,9 +5226,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -5209,13 +5244,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -5237,7 +5272,7 @@ checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" dependencies = [ "either", "futures-util", - "thiserror", + "thiserror 1.0.63", "tokio", ] @@ -5309,9 +5344,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -5325,27 +5360,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.63", "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -5364,9 +5399,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -5374,9 +5409,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -5387,6 +5422,7 @@ dependencies = [ "sharded-slab", "smallvec", "thread_local", + "time", "tracing", "tracing-core", "tracing-log", @@ -5502,7 +5538,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "station-api", - "thiserror", + "thiserror 1.0.63", "tokio", "upgrader-api", "uuid", @@ -5637,7 +5673,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", "wasm-bindgen-shared", ] @@ -5671,7 +5707,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6031,7 +6067,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", "synstructure", ] @@ -6088,7 +6124,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -6108,7 +6144,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", "synstructure", ] @@ -6129,7 +6165,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] @@ -6151,7 +6187,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.98", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f3f993a07..6c05c2e76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ itertools = "0.13.0" lazy_static = "1.4.0" mockall = "0.12.1" num-bigint = "0.4" -pocket-ic = "6.0.0" +pocket-ic = "7.0.0" proc-macro2 = "1.0" prometheus = "0.13.3" quote = "1.0" diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 9a5533914..fb328cac7 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -30,7 +30,7 @@ fi cd tests/integration echo "PocketIC download starting" -curl -sLO https://github.com/dfinity/pocketic/releases/download/7.0.0/pocket-ic-x86_64-$PLATFORM.gz || exit 1 +curl -sLO https://github.com/dfinity/pocketic/releases/download/8.0.0/pocket-ic-x86_64-$PLATFORM.gz || exit 1 gzip -df pocket-ic-x86_64-$PLATFORM.gz mv pocket-ic-x86_64-$PLATFORM pocket-ic export POCKET_IC_BIN="$(pwd)/pocket-ic" diff --git a/tests/integration/src/control_panel_tests.rs b/tests/integration/src/control_panel_tests.rs index 9f33f5f49..638fdd1f4 100644 --- a/tests/integration/src/control_panel_tests.rs +++ b/tests/integration/src/control_panel_tests.rs @@ -18,7 +18,7 @@ use control_panel_api::{ListUserStationsResponse, UploadCanisterModulesInput}; use orbit_essentials::api::ApiResult; use orbit_essentials::cmc::{SubnetFilter, SubnetSelection}; use pocket_ic::management_canister::CanisterInstallMode; -use pocket_ic::{update_candid_as, CallError, PocketIc}; +use pocket_ic::{update_candid_as, PocketIc}; use sha2::{Digest, Sha256}; use station_api::{ AdminInitInput, HealthStatus, SystemInfoResponse, SystemInit as SystemInitArg, @@ -847,13 +847,10 @@ fn deploy_station_with_insufficient_cycles() { station_init_args.clone(), ) .unwrap_err(); - match err { - CallError::Reject(msg) => panic!("Unexpected reject: {}", msg), - CallError::UserError(err) => assert!(err.description.contains(&format!( - "insufficient for transferring {} cycles when deploying the upgrader", - upgrader_initial_cycles - ))), - }; + assert!(err.reject_message.contains(&format!( + "insufficient for transferring {} cycles when deploying the upgrader", + upgrader_initial_cycles + ))); let cycles_after_failed_install = env.cycle_balance(station); assert!(cycles_before_install <= cycles_after_failed_install + 50_000_000_000); diff --git a/tests/integration/src/cycles_monitor_tests.rs b/tests/integration/src/cycles_monitor_tests.rs index a5d8623a9..56db6fbc4 100644 --- a/tests/integration/src/cycles_monitor_tests.rs +++ b/tests/integration/src/cycles_monitor_tests.rs @@ -16,7 +16,7 @@ use control_panel_api::{ use ic_ledger_types::AccountIdentifier; use orbit_essentials::api::ApiResult; -use pocket_ic::{update_candid_as, CallError}; +use pocket_ic::update_candid_as; use sha2::{Digest, Sha256}; use station_api::{HealthStatus, SystemInfoResponse}; use std::time::Duration; @@ -148,18 +148,15 @@ fn successful_monitors_stations_and_tops_up() { assert_eq!(health_status, HealthStatus::Healthy); // WALLET_ADMIN_USER is not admin of the newly created station and thus the following call should trap - let res: Result<(ApiResult,), CallError> = update_candid_as( + let user_error = update_candid_as::<_, (ApiResult,)>( &env, newly_created_user_station, WALLET_ADMIN_USER, "system_info", (), - ); - let user_error = match res.unwrap_err() { - CallError::UserError(user_error) => user_error, - CallError::Reject(message) => panic!("Unexpected reject: {}", message), - }; - assert!(user_error.description.contains( + ) + .unwrap_err(); + assert!(user_error.reject_message.contains( "Canister called `ic0.trap` with message: Unauthorized access to resources: System(SystemInfo)" )); diff --git a/tests/integration/src/external_canister_tests.rs b/tests/integration/src/external_canister_tests.rs index 99767d775..5060b4ed1 100644 --- a/tests/integration/src/external_canister_tests.rs +++ b/tests/integration/src/external_canister_tests.rs @@ -1115,7 +1115,7 @@ fn create_external_canister_with_too_many_cycles() { ) .unwrap_err(); assert!(err - .description + .reject_message .contains("The method `try_execute_request` can only be called by the station canister.")); // wait for the requests to be executed diff --git a/tests/integration/src/http.rs b/tests/integration/src/http.rs index c451aa649..ed69d1be2 100644 --- a/tests/integration/src/http.rs +++ b/tests/integration/src/http.rs @@ -2,7 +2,7 @@ use crate::setup::setup_new_env; use crate::TestEnv; use candid::{Decode, Encode, Principal}; use orbit_essentials::api::{HttpRequest, HttpResponse}; -use pocket_ic::{PocketIc, WasmResult}; +use pocket_ic::PocketIc; fn test_candid_decoding_quota(env: &PocketIc, canister_id: Principal) { // The anonymous end-user sends a small HTTP request. This should succeed. @@ -13,18 +13,15 @@ fn test_candid_decoding_quota(env: &PocketIc, canister_id: Principal) { body: vec![42; 1_000], }; let http_request_bytes = Encode!(&http_request).unwrap(); - let response = match env + let bytes = env .update_call( canister_id, Principal::anonymous(), "http_request", http_request_bytes, ) - .unwrap() - { - WasmResult::Reply(bytes) => Decode!(&bytes, HttpResponse).unwrap(), - WasmResult::Reject(reason) => panic!("Unexpected reject: {}", reason), - }; + .unwrap(); + let response = Decode!(&bytes, HttpResponse).unwrap(); assert_eq!(response.status_code, 200); // The anonymous end-user sends a large HTTP request. This should be rejected. @@ -39,8 +36,9 @@ fn test_candid_decoding_quota(env: &PocketIc, canister_id: Principal) { large_http_request_bytes, ) .unwrap_err(); - println!("desc: {}", err.description); - assert!(err.description.contains("Decoding cost exceeds the limit")); + assert!(err + .reject_message + .contains("Decoding cost exceeds the limit")); } #[test] diff --git a/tests/integration/src/notification.rs b/tests/integration/src/notification.rs index 7cb83f792..a8f2b3b74 100644 --- a/tests/integration/src/notification.rs +++ b/tests/integration/src/notification.rs @@ -5,7 +5,7 @@ use crate::utils::{ }; use crate::TestEnv; use orbit_essentials::api::ApiResult; -use pocket_ic::{update_candid_as, CallError}; +use pocket_ic::update_candid_as; use station_api::{ AddUserOperationInput, EditPermissionOperationInput, ListNotificationsInput, ListNotificationsResponse, MarkNotificationsReadInput, MeResponse, RequestApprovalStatusDTO, @@ -82,12 +82,9 @@ fn notification_authorization() { (list_notifications_input.clone(),), ) .unwrap_err(); - match err { - CallError::UserError(err) => assert!(err - .description - .contains("Unauthorized access to resources: Notification(List)")), - CallError::Reject(msg) => panic!("Unexpected reject: {}", msg), - }; + assert!(err + .reject_message + .contains("Unauthorized access to resources: Notification(List)")); // and cannot mark foreign notifications read let err = update_candid_as::<_, (ApiResult<()>,)>( &env, @@ -97,13 +94,10 @@ fn notification_authorization() { (mark_notifications_read_input.clone(),), ) .unwrap_err(); - match err { - CallError::UserError(err) => assert!(err.description.contains(&format!( - "Unauthorized access to resources: Notification(Update(Id({})))", - admin_notification.id - ))), - CallError::Reject(msg) => panic!("Unexpected reject: {}", msg), - }; + assert!(err.reject_message.contains(&format!( + "Unauthorized access to resources: Notification(Update(Id({})))", + admin_notification.id + ))); // register new non-admin user let add_user = AddUserOperationInput { @@ -203,11 +197,8 @@ fn notification_authorization() { (mark_notifications_read_input.clone(),), ) .unwrap_err(); - match err { - CallError::UserError(err) => assert!(err.description.contains(&format!( - "Unauthorized access to resources: Notification(Update(Id({})))", - admin_notification.id - ))), - CallError::Reject(msg) => panic!("Unexpected reject: {}", msg), - }; + assert!(err.reject_message.contains(&format!( + "Unauthorized access to resources: Notification(Update(Id({})))", + admin_notification.id + ))); } diff --git a/tests/integration/src/station_test_data/asset.rs b/tests/integration/src/station_test_data/asset.rs index 66f74d997..8b885aa67 100644 --- a/tests/integration/src/station_test_data/asset.rs +++ b/tests/integration/src/station_test_data/asset.rs @@ -2,7 +2,7 @@ use super::next_unique_id; use crate::utils::{submit_request, wait_for_request}; use candid::Principal; use orbit_essentials::api::ApiResult; -use pocket_ic::{query_candid_as, CallError, PocketIc}; +use pocket_ic::{query_candid_as, PocketIc, RejectResponse}; use station_api::{GetAssetInput, GetAssetResponse, ListAssetsInput, ListAssetsResponse}; pub fn add_asset_with_input( @@ -97,7 +97,7 @@ pub fn list_assets( env: &PocketIc, station_canister_id: Principal, requester: Principal, -) -> Result<(ApiResult,), CallError> { +) -> Result<(ApiResult,), RejectResponse> { query_candid_as::<(ListAssetsInput,), (ApiResult,)>( env, station_canister_id, @@ -112,7 +112,7 @@ pub fn get_asset( station_canister_id: Principal, requester: Principal, asset_id: station_api::UuidDTO, -) -> Result<(ApiResult,), CallError> { +) -> Result<(ApiResult,), RejectResponse> { query_candid_as::<(GetAssetInput,), (ApiResult,)>( env, station_canister_id, diff --git a/tests/integration/src/station_test_data/named_rule.rs b/tests/integration/src/station_test_data/named_rule.rs index 3d5529a89..3d864c0b3 100644 --- a/tests/integration/src/station_test_data/named_rule.rs +++ b/tests/integration/src/station_test_data/named_rule.rs @@ -2,7 +2,7 @@ use super::next_unique_id; use crate::utils::{submit_request, wait_for_request}; use candid::Principal; use orbit_essentials::api::ApiResult; -use pocket_ic::{query_candid_as, CallError, PocketIc}; +use pocket_ic::{query_candid_as, PocketIc, RejectResponse}; use station_api::{ GetNamedRuleInput, GetNamedRuleResponse, ListNamedRulesInput, ListNamedRulesResponse, RequestPolicyRuleDTO, @@ -109,7 +109,7 @@ pub fn list_named_rules( env: &PocketIc, station_canister_id: Principal, requester: Principal, -) -> Result<(ApiResult,), CallError> { +) -> Result<(ApiResult,), RejectResponse> { query_candid_as::<(ListNamedRulesInput,), (ApiResult,)>( env, station_canister_id, @@ -125,7 +125,7 @@ pub fn get_named_rule( station_canister_id: Principal, requester: Principal, named_rule_id: station_api::UuidDTO, -) -> Result<(ApiResult,), CallError> { +) -> Result<(ApiResult,), RejectResponse> { query_candid_as::<(GetNamedRuleInput,), (ApiResult,)>( env, station_canister_id, diff --git a/tests/integration/src/station_test_data/request_policy.rs b/tests/integration/src/station_test_data/request_policy.rs index 1c272634d..bef36f887 100644 --- a/tests/integration/src/station_test_data/request_policy.rs +++ b/tests/integration/src/station_test_data/request_policy.rs @@ -1,7 +1,7 @@ use crate::utils::{submit_request, wait_for_request}; use candid::Principal; use orbit_essentials::api::ApiResult; -use pocket_ic::{query_candid_as, CallError, PocketIc}; +use pocket_ic::{query_candid_as, PocketIc, RejectResponse}; use station_api::{ EditRequestPolicyOperationInput, ListRequestPoliciesInput, ListRequestPoliciesResponse, }; @@ -32,7 +32,7 @@ pub fn list_request_policies( env: &PocketIc, station_canister_id: Principal, requester: Principal, -) -> Result<(ApiResult,), CallError> { +) -> Result<(ApiResult,), RejectResponse> { query_candid_as::<(ListRequestPoliciesInput,), (ApiResult,)>( env, station_canister_id, @@ -50,7 +50,7 @@ pub fn edit_request_policy( station_canister_id: Principal, requester: Principal, input: EditRequestPolicyOperationInput, -) -> Result<(), CallError> { +) -> Result<(), RejectResponse> { let edit_request_policy_request = submit_request( env, requester, diff --git a/tests/integration/src/utils.rs b/tests/integration/src/utils.rs index 733352d54..6a7ae682a 100644 --- a/tests/integration/src/utils.rs +++ b/tests/integration/src/utils.rs @@ -14,7 +14,7 @@ use orbit_essentials::api::ApiResult; use orbit_essentials::cdk::api::management_canister::main::CanisterId; use orbit_essentials::types::WasmModuleExtraChunks; use pocket_ic::management_canister::CanisterStatusResult; -use pocket_ic::{query_candid_as, update_candid_as, CallError, PocketIc, UserError, WasmResult}; +use pocket_ic::{query_candid_as, update_candid_as, PocketIc, RejectResponse}; use sha2::Digest; use sha2::Sha256; use station_api::{ @@ -180,7 +180,7 @@ pub fn submit_request_raw( user_id: Principal, station_canister_id: CanisterId, request_operation_input: RequestOperationInput, -) -> Result<(Result,), CallError> { +) -> Result<(Result,), RejectResponse> { let create_request_input = CreateRequestInput { operation: request_operation_input, title: None, @@ -213,11 +213,9 @@ pub fn submit_request_with_expected_trap( station_canister_id: CanisterId, request_operation_input: RequestOperationInput, ) -> String { - let res = submit_request_raw(env, user_id, station_canister_id, request_operation_input); - match res.unwrap_err() { - CallError::UserError(error) => error.description, - CallError::Reject(message) => panic!("Unexpected reject: {}", message), - } + submit_request_raw(env, user_id, station_canister_id, request_operation_input) + .unwrap_err() + .reject_message } pub fn wait_for_request( @@ -458,12 +456,8 @@ pub fn update_raw( sender: Principal, method: &str, payload: Vec, -) -> Result, UserError> { +) -> Result, RejectResponse> { env.update_call(canister_id, sender, method, payload) - .map(|res| match res { - WasmResult::Reply(bytes) => bytes, - WasmResult::Reject(message) => panic!("Unexpected reject: {}", message), - }) } pub fn get_upgrader_disaster_recovery( @@ -1133,17 +1127,11 @@ pub(crate) fn deploy_test_canister(env: &PocketIc, controller: Principal) -> Pri test_canister } -pub fn expect_await_call_result(result: WasmResult) -> T +pub fn expect_await_call_result(result: Vec) -> T where T: for<'a> ArgumentDecoder<'a>, { - match result { - WasmResult::Reply(vec) => { - let result: T = decode_args(&vec).expect("Failed to decode result"); - result - } - WasmResult::Reject(error) => panic!("Unexpected reject: {error}"), - } + decode_args(&result).expect("Failed to decode result") } pub(crate) fn set_disaster_recovery_committee( From 9acad9e6e2eb93dacfa953d757b8890dc6ec4ed1 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Thu, 27 Feb 2025 15:21:15 +0100 Subject: [PATCH 2/3] locked --- scripts/benchmark-canister.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/benchmark-canister.sh b/scripts/benchmark-canister.sh index 5781fa05c..19067ef4a 100755 --- a/scripts/benchmark-canister.sh +++ b/scripts/benchmark-canister.sh @@ -25,7 +25,7 @@ print_message "Benchmarking canister at $CANISTER_PATH" # Install canbench if not already installed if ! cargo install --list | grep -q canbench; then print_message "Installing canbench..." - cargo install canbench --version 0.1.8 + cargo install canbench --version 0.1.8 --locked fi # Changes to the canister path From 41d600dd01270b666abbef20882f2fe2129bd869 Mon Sep 17 00:00:00 2001 From: Martin Raszyk Date: Thu, 27 Feb 2025 16:15:37 +0100 Subject: [PATCH 3/3] fix error message --- tests/integration/src/cycles_monitor_tests.rs | 2 +- tests/integration/src/external_canister_tests.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/src/cycles_monitor_tests.rs b/tests/integration/src/cycles_monitor_tests.rs index 56db6fbc4..5fdd359c1 100644 --- a/tests/integration/src/cycles_monitor_tests.rs +++ b/tests/integration/src/cycles_monitor_tests.rs @@ -157,7 +157,7 @@ fn successful_monitors_stations_and_tops_up() { ) .unwrap_err(); assert!(user_error.reject_message.contains( - "Canister called `ic0.trap` with message: Unauthorized access to resources: System(SystemInfo)" + "Canister called `ic0.trap` with message: 'Unauthorized access to resources: System(SystemInfo)'." )); let upgrader_id = get_system_info(&env, user_id, newly_created_user_station).upgrader_id; diff --git a/tests/integration/src/external_canister_tests.rs b/tests/integration/src/external_canister_tests.rs index 5060b4ed1..36f99aff1 100644 --- a/tests/integration/src/external_canister_tests.rs +++ b/tests/integration/src/external_canister_tests.rs @@ -612,7 +612,7 @@ fn call_external_canister_test() { call_canister_operation.clone(), ); assert!(trap_message.contains( - "Canister called `ic0.trap` with message: Unauthorized access to resources: ExternalCanister(Call" + "Canister called `ic0.trap` with message: 'Unauthorized access to resources: ExternalCanister(Call(CallExternalCanister(" )); // nothing should have changed so far @@ -801,7 +801,7 @@ fn call_external_canister_test() { illegal_call_canister_operation.clone(), ); assert!(trap_message.contains( - "Canister called `ic0.trap` with message: Unauthorized access to resources: ExternalCanister(Call" + "Canister called `ic0.trap` with message: 'Unauthorized access to resources: ExternalCanister(Call(CallExternalCanister(" )); bump_time_to_avoid_ratelimit(&env); @@ -821,7 +821,7 @@ fn call_external_canister_test() { illegal_call_canister_operation.clone(), ); assert!(trap_message.contains( - "Canister called `ic0.trap` with message: Unauthorized access to resources: ExternalCanister(Call" + "Canister called `ic0.trap` with message: 'Unauthorized access to resources: ExternalCanister(Call(CallExternalCanister(" )); // submit a request labeling the validation method as the execution method which is illegal given the permissions set so far @@ -839,7 +839,7 @@ fn call_external_canister_test() { illegal_call_canister_operation.clone(), ); assert!(trap_message.contains( - "Canister called `ic0.trap` with message: Unauthorized access to resources: ExternalCanister(Call" + "Canister called `ic0.trap` with message: 'Unauthorized access to resources: ExternalCanister(Call(CallExternalCanister(" )); // nothing should have changed