From 9f3580847e1a7088b0ecdf9478204e71eaae1cb8 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:06:09 +0200 Subject: [PATCH 01/14] XC-420: Fix LICENSE and NOTICE --- LICENSE | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- NOTICE | 14 ++++- 2 files changed, 189 insertions(+), 2 deletions(-) mode change 120000 => 100644 LICENSE mode change 120000 => 100644 NOTICE diff --git a/LICENSE b/LICENSE deleted file mode 120000 index ea5b606..0000000 --- a/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d9a10c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/NOTICE b/NOTICE deleted file mode 120000 index 7e1b82f..0000000 --- a/NOTICE +++ /dev/null @@ -1 +0,0 @@ -../NOTICE \ No newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..22888a3 --- /dev/null +++ b/NOTICE @@ -0,0 +1,13 @@ + Copyright 2023 DFINITY Stiftung + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From a351ecc9b2ec9d5f2fb1f0da072af36434214288 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:15:45 +0200 Subject: [PATCH 02/14] XC-420: Move code to canhttp/ --- CHANGELOG.md => canhttp/CHANGELOG.md | 0 Cargo.toml => canhttp/Cargo.toml | 0 {src => canhttp/src}/client/mod.rs | 0 {src => canhttp/src}/client/tests.rs | 0 {src => canhttp/src}/convert/error.rs | 0 {src => canhttp/src}/convert/mod.rs | 0 {src => canhttp/src}/convert/request.rs | 0 {src => canhttp/src}/convert/response.rs | 0 {src => canhttp/src}/cycles/mod.rs | 0 {src => canhttp/src}/cycles/tests.rs | 0 {src => canhttp/src}/http/json/id.rs | 0 {src => canhttp/src}/http/json/mod.rs | 0 {src => canhttp/src}/http/json/request.rs | 0 {src => canhttp/src}/http/json/response.rs | 0 {src => canhttp/src}/http/json/tests.rs | 0 {src => canhttp/src}/http/json/version.rs | 0 {src => canhttp/src}/http/mod.rs | 0 {src => canhttp/src}/http/request.rs | 0 {src => canhttp/src}/http/response.rs | 0 {src => canhttp/src}/http/tests.rs | 0 {src => canhttp/src}/lib.rs | 0 {src => canhttp/src}/multi/cache.rs | 0 {src => canhttp/src}/multi/mod.rs | 0 {src => canhttp/src}/multi/reduce.rs | 0 {src => canhttp/src}/multi/tests.rs | 0 {src => canhttp/src}/observability/mod.rs | 0 {src => canhttp/src}/retry/mod.rs | 0 {src => canhttp/src}/retry/tests.rs | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename CHANGELOG.md => canhttp/CHANGELOG.md (100%) rename Cargo.toml => canhttp/Cargo.toml (100%) rename {src => canhttp/src}/client/mod.rs (100%) rename {src => canhttp/src}/client/tests.rs (100%) rename {src => canhttp/src}/convert/error.rs (100%) rename {src => canhttp/src}/convert/mod.rs (100%) rename {src => canhttp/src}/convert/request.rs (100%) rename {src => canhttp/src}/convert/response.rs (100%) rename {src => canhttp/src}/cycles/mod.rs (100%) rename {src => canhttp/src}/cycles/tests.rs (100%) rename {src => canhttp/src}/http/json/id.rs (100%) rename {src => canhttp/src}/http/json/mod.rs (100%) rename {src => canhttp/src}/http/json/request.rs (100%) rename {src => canhttp/src}/http/json/response.rs (100%) rename {src => canhttp/src}/http/json/tests.rs (100%) rename {src => canhttp/src}/http/json/version.rs (100%) rename {src => canhttp/src}/http/mod.rs (100%) rename {src => canhttp/src}/http/request.rs (100%) rename {src => canhttp/src}/http/response.rs (100%) rename {src => canhttp/src}/http/tests.rs (100%) rename {src => canhttp/src}/lib.rs (100%) rename {src => canhttp/src}/multi/cache.rs (100%) rename {src => canhttp/src}/multi/mod.rs (100%) rename {src => canhttp/src}/multi/reduce.rs (100%) rename {src => canhttp/src}/multi/tests.rs (100%) rename {src => canhttp/src}/observability/mod.rs (100%) rename {src => canhttp/src}/retry/mod.rs (100%) rename {src => canhttp/src}/retry/tests.rs (100%) diff --git a/CHANGELOG.md b/canhttp/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to canhttp/CHANGELOG.md diff --git a/Cargo.toml b/canhttp/Cargo.toml similarity index 100% rename from Cargo.toml rename to canhttp/Cargo.toml diff --git a/src/client/mod.rs b/canhttp/src/client/mod.rs similarity index 100% rename from src/client/mod.rs rename to canhttp/src/client/mod.rs diff --git a/src/client/tests.rs b/canhttp/src/client/tests.rs similarity index 100% rename from src/client/tests.rs rename to canhttp/src/client/tests.rs diff --git a/src/convert/error.rs b/canhttp/src/convert/error.rs similarity index 100% rename from src/convert/error.rs rename to canhttp/src/convert/error.rs diff --git a/src/convert/mod.rs b/canhttp/src/convert/mod.rs similarity index 100% rename from src/convert/mod.rs rename to canhttp/src/convert/mod.rs diff --git a/src/convert/request.rs b/canhttp/src/convert/request.rs similarity index 100% rename from src/convert/request.rs rename to canhttp/src/convert/request.rs diff --git a/src/convert/response.rs b/canhttp/src/convert/response.rs similarity index 100% rename from src/convert/response.rs rename to canhttp/src/convert/response.rs diff --git a/src/cycles/mod.rs b/canhttp/src/cycles/mod.rs similarity index 100% rename from src/cycles/mod.rs rename to canhttp/src/cycles/mod.rs diff --git a/src/cycles/tests.rs b/canhttp/src/cycles/tests.rs similarity index 100% rename from src/cycles/tests.rs rename to canhttp/src/cycles/tests.rs diff --git a/src/http/json/id.rs b/canhttp/src/http/json/id.rs similarity index 100% rename from src/http/json/id.rs rename to canhttp/src/http/json/id.rs diff --git a/src/http/json/mod.rs b/canhttp/src/http/json/mod.rs similarity index 100% rename from src/http/json/mod.rs rename to canhttp/src/http/json/mod.rs diff --git a/src/http/json/request.rs b/canhttp/src/http/json/request.rs similarity index 100% rename from src/http/json/request.rs rename to canhttp/src/http/json/request.rs diff --git a/src/http/json/response.rs b/canhttp/src/http/json/response.rs similarity index 100% rename from src/http/json/response.rs rename to canhttp/src/http/json/response.rs diff --git a/src/http/json/tests.rs b/canhttp/src/http/json/tests.rs similarity index 100% rename from src/http/json/tests.rs rename to canhttp/src/http/json/tests.rs diff --git a/src/http/json/version.rs b/canhttp/src/http/json/version.rs similarity index 100% rename from src/http/json/version.rs rename to canhttp/src/http/json/version.rs diff --git a/src/http/mod.rs b/canhttp/src/http/mod.rs similarity index 100% rename from src/http/mod.rs rename to canhttp/src/http/mod.rs diff --git a/src/http/request.rs b/canhttp/src/http/request.rs similarity index 100% rename from src/http/request.rs rename to canhttp/src/http/request.rs diff --git a/src/http/response.rs b/canhttp/src/http/response.rs similarity index 100% rename from src/http/response.rs rename to canhttp/src/http/response.rs diff --git a/src/http/tests.rs b/canhttp/src/http/tests.rs similarity index 100% rename from src/http/tests.rs rename to canhttp/src/http/tests.rs diff --git a/src/lib.rs b/canhttp/src/lib.rs similarity index 100% rename from src/lib.rs rename to canhttp/src/lib.rs diff --git a/src/multi/cache.rs b/canhttp/src/multi/cache.rs similarity index 100% rename from src/multi/cache.rs rename to canhttp/src/multi/cache.rs diff --git a/src/multi/mod.rs b/canhttp/src/multi/mod.rs similarity index 100% rename from src/multi/mod.rs rename to canhttp/src/multi/mod.rs diff --git a/src/multi/reduce.rs b/canhttp/src/multi/reduce.rs similarity index 100% rename from src/multi/reduce.rs rename to canhttp/src/multi/reduce.rs diff --git a/src/multi/tests.rs b/canhttp/src/multi/tests.rs similarity index 100% rename from src/multi/tests.rs rename to canhttp/src/multi/tests.rs diff --git a/src/observability/mod.rs b/canhttp/src/observability/mod.rs similarity index 100% rename from src/observability/mod.rs rename to canhttp/src/observability/mod.rs diff --git a/src/retry/mod.rs b/canhttp/src/retry/mod.rs similarity index 100% rename from src/retry/mod.rs rename to canhttp/src/retry/mod.rs diff --git a/src/retry/tests.rs b/canhttp/src/retry/tests.rs similarity index 100% rename from src/retry/tests.rs rename to canhttp/src/retry/tests.rs From bc16e94c4e27622d36716f58bda124b84ebd90aa Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:16:59 +0200 Subject: [PATCH 03/14] XC-420: added back links to LICENSE and NOTICE --- canhttp/LICENSE | 1 + canhttp/NOTICE | 1 + 2 files changed, 2 insertions(+) create mode 120000 canhttp/LICENSE create mode 120000 canhttp/NOTICE diff --git a/canhttp/LICENSE b/canhttp/LICENSE new file mode 120000 index 0000000..ea5b606 --- /dev/null +++ b/canhttp/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/canhttp/NOTICE b/canhttp/NOTICE new file mode 120000 index 0000000..7e1b82f --- /dev/null +++ b/canhttp/NOTICE @@ -0,0 +1 @@ +../NOTICE \ No newline at end of file From 5c4402286aa8a1a7c6fe0ae1ff111e0255fd4778 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:25:27 +0200 Subject: [PATCH 04/14] XC-420: Add .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..005bc26 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ From c8639fa857b96f74bf7bb6d9166d6bfab89d7272 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:25:57 +0200 Subject: [PATCH 05/14] XC-420: Turn into Cargo workspace --- Cargo.lock | 1394 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 55 +++ 2 files changed, 1449 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..b97b159 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1394 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "binread" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16598dfc8e6578e9b597d9910ba2e73618385dc9f4b1d43dd92c349d6be6418f" +dependencies = [ + "binread_derive", + "lazy_static", + "rustversion", +] + +[[package]] +name = "binread_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9672209df1714ee804b1f4d4f68c8eb2a90b1f7a07acf472f88ce198ef1fed" +dependencies = [ + "either", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "candid" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d90f5a1426d0489283a0bd5da9ed406fb3e69597e0d823dcb88a1965bb58d2" +dependencies = [ + "anyhow", + "binread", + "byteorder", + "candid_derive", + "hex", + "ic_principal", + "leb128", + "num-bigint", + "num-traits", + "paste", + "pretty", + "serde", + "serde_bytes", + "stacker", + "thiserror 1.0.69", +] + +[[package]] +name = "candid_derive" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3de398570c386726e7a59d9887b68763c481477f9a043fb998a2e09d428df1a9" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "canhttp" +version = "0.2.0" +dependencies = [ + "assert_matches", + "candid", + "ciborium", + "futures-channel", + "futures-util", + "http", + "ic-cdk", + "ic-error-types", + "itertools", + "maplit", + "num-traits", + "pin-project", + "proptest", + "serde", + "serde_json", + "sha2", + "strum 0.27.1", + "thiserror 2.0.12", + "tokio", + "tower", + "tower-layer", +] + +[[package]] +name = "cc" +version = "1.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "ic-cdk" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a7344f41493cbf591f13ae9f90181076f808a83af799815c3074b19c693d2e" +dependencies = [ + "candid", + "ic-cdk-executor", + "ic-cdk-macros", + "ic0", + "serde", + "serde_bytes", +] + +[[package]] +name = "ic-cdk-executor" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903057edd3d4ff4b3fe44a64eaee1ceb73f579ba29e3ded372b63d291d7c16c2" + +[[package]] +name = "ic-cdk-macros" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84cbaa50fa36d3e0616114becf81faa95a099e0d60948ed6978f30f1c77399fd" +dependencies = [ + "candid", + "proc-macro2", + "quote", + "serde", + "serde_tokenstream", + "syn 2.0.104", +] + +[[package]] +name = "ic-error-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbeeb3d91aa179d6496d7293becdacedfc413c825cac79fd54ea1906f003ee55" +dependencies = [ + "serde", + "strum 0.26.3", + "strum_macros 0.26.4", +] + +[[package]] +name = "ic0" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" + +[[package]] +name = "ic_principal" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1762deb6f7c8d8c2bdee4b6c5a47b60195b74e9b5280faa5ba29692f8e17429c" +dependencies = [ + "crc32fast", + "data-encoding", + "serde", + "sha2", + "thiserror 1.0.69", +] + +[[package]] +name = "io-uring" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "pretty" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac98773b7109bc75f475ab5a134c9b64b87e59d776d31098d8f346922396a477" +dependencies = [ + "arrayvec", + "typed-arena", + "unicode-width", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "psm" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-demangle" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_tokenstream" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64060d864397305347a78851c51588fd283767e7e7589829e8121d65512340f1" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.104", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "stacker" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.59.0", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.104", +] + +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.104", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tokio" +version = "1.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +dependencies = [ + "backtrace", + "bytes", + "io-uring", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "slab", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..97db358 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,55 @@ +[workspace] +members = [ + "canhttp", +] +resolver = "2" + +[workspace.package] +authors = ["DFINITY Foundation"] +edition = "2021" +repository = "https://github.com/dfinity/canhttp" +homepage = "https://github.com/dfinity/canhttp#readme" +license = "Apache-2.0" +readme = "README.md" + +[workspace.dependencies] +assert_matches = "1.5.0" +candid = { version = "0.10.13" } +canlog = { version = "0.1.1", features = ["derive"] } +candid_parser = { version = "0.1.4" } +ciborium = "0.2.2" +derive_more = { version = "2.0.1", features = ["from", "into"] } +ethnum = { version = "1.5.0", features = ["serde"] } +futures = "0.3.31" +futures-channel = "0.3.31" +futures-util = "0.3.31" +getrandom = { version = "0.2", features = ["custom"] } +hex = "0.4.3" +http = "1.3.1" +ic-canister-log = "0.2.0" +ic-cdk = "0.17.2" +ic-cdk-bindgen = "0.1" +ic-cdk-macros = "0.17.2" +ic-certified-map = "0.4" +ic-error-types = "0.2" +ic-management-canister-types = "0.3" +ic-metrics-encoder = "1.1" +ic-stable-structures = "0.6.8" +itertools = "0.14.0" +maplit = "1.0.2" +minicbor = { version = "1.0.0", features = ["alloc", "derive"] } +num-bigint = "0.4.6" +num-traits = "0.2.19" +pin-project = "1.1.10" +proptest = "1.6.0" +serde = "1.0" +serde_json = "1.0" +serde_bytes = "0.11.17" +sha2 = "0.10.8" +strum = { version = "0.27.1", features = ["derive"] } +tokio = "1.44.1" +tower = "0.5.2" +tower-layer = "0.3.3" +tower-http = "0.6.2" +thiserror = "2.0.12" +url = "2.5" From 86aa8b8ff788e3f2e08e40da5fff2bf78bb1a4b9 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:38:51 +0200 Subject: [PATCH 06/14] XC-420: clean-up dependencies --- Cargo.toml | 21 +-------------------- canhttp/Cargo.toml | 13 +++++++------ 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 97db358..ab937c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,48 +8,29 @@ resolver = "2" authors = ["DFINITY Foundation"] edition = "2021" repository = "https://github.com/dfinity/canhttp" -homepage = "https://github.com/dfinity/canhttp#readme" +homepage = "https://github.com/dfinity/canhttp" license = "Apache-2.0" readme = "README.md" [workspace.dependencies] assert_matches = "1.5.0" candid = { version = "0.10.13" } -canlog = { version = "0.1.1", features = ["derive"] } -candid_parser = { version = "0.1.4" } ciborium = "0.2.2" -derive_more = { version = "2.0.1", features = ["from", "into"] } -ethnum = { version = "1.5.0", features = ["serde"] } -futures = "0.3.31" futures-channel = "0.3.31" futures-util = "0.3.31" -getrandom = { version = "0.2", features = ["custom"] } -hex = "0.4.3" http = "1.3.1" -ic-canister-log = "0.2.0" ic-cdk = "0.17.2" -ic-cdk-bindgen = "0.1" -ic-cdk-macros = "0.17.2" -ic-certified-map = "0.4" ic-error-types = "0.2" -ic-management-canister-types = "0.3" -ic-metrics-encoder = "1.1" -ic-stable-structures = "0.6.8" itertools = "0.14.0" maplit = "1.0.2" -minicbor = { version = "1.0.0", features = ["alloc", "derive"] } -num-bigint = "0.4.6" num-traits = "0.2.19" pin-project = "1.1.10" proptest = "1.6.0" serde = "1.0" serde_json = "1.0" -serde_bytes = "0.11.17" sha2 = "0.10.8" strum = { version = "0.27.1", features = ["derive"] } tokio = "1.44.1" tower = "0.5.2" tower-layer = "0.3.3" -tower-http = "0.6.2" thiserror = "2.0.12" -url = "2.5" diff --git a/canhttp/Cargo.toml b/canhttp/Cargo.toml index c427123..d026120 100644 --- a/canhttp/Cargo.toml +++ b/canhttp/Cargo.toml @@ -2,12 +2,13 @@ name = "canhttp" version = "0.2.0" description = "Rust library to issue HTTPs outcalls from a canister on the Internet Computer" -license = "Apache-2.0" -readme = "README.md" -authors = ["DFINITY Foundation"] -edition = "2021" +license.workspace = true +readme.workspace = true +homepage.workspace = true +authors.workspace = true +edition.workspace = true include = ["src", "Cargo.toml", "CHANGELOG.md", "LICENSE", "README.md"] -repository = "https://github.com/dfinity/evm-rpc-canister" +repository.workspace = true documentation = "https://docs.rs/canhttp" [dependencies] @@ -39,4 +40,4 @@ tokio = { workspace = true, features = ["full"] } default = ["http"] http = ["dep:http", "dep:num-traits", "dep:tower-layer"] json = ["http", "dep:serde", "dep:serde_json"] -multi = ["dep:ciborium", "dep:sha2", "dep:futures-channel"] \ No newline at end of file +multi = ["dep:ciborium", "dep:sha2", "dep:futures-channel"] From 2a8dc50be1cbf06267aa4a739fc8ae47d5c77950 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:41:38 +0200 Subject: [PATCH 07/14] XC-420: add .idea to gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 005bc26..0a2786a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ # will have compiled files and executables debug/ target/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea From 093c79d3eabcca5dae022e65eb72186519b83b91 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:42:12 +0200 Subject: [PATCH 08/14] XC-420: Cargo sort --- Cargo.toml | 6 ++---- canhttp/Cargo.toml | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab937c3..8b75876 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,5 @@ [workspace] -members = [ - "canhttp", -] +members = ["canhttp"] resolver = "2" [workspace.package] @@ -30,7 +28,7 @@ serde = "1.0" serde_json = "1.0" sha2 = "0.10.8" strum = { version = "0.27.1", features = ["derive"] } +thiserror = "2.0.12" tokio = "1.44.1" tower = "0.5.2" tower-layer = "0.3.3" -thiserror = "2.0.12" diff --git a/canhttp/Cargo.toml b/canhttp/Cargo.toml index d026120..b5b2702 100644 --- a/canhttp/Cargo.toml +++ b/canhttp/Cargo.toml @@ -11,22 +11,28 @@ include = ["src", "Cargo.toml", "CHANGELOG.md", "LICENSE", "README.md"] repository.workspace = true documentation = "https://docs.rs/canhttp" +[features] +default = ["http"] +http = ["dep:http", "dep:num-traits", "dep:tower-layer"] +json = ["http", "dep:serde", "dep:serde_json"] +multi = ["dep:ciborium", "dep:sha2", "dep:futures-channel"] + [dependencies] assert_matches = { workspace = true } ciborium = { workspace = true, optional = true } -ic-cdk = { workspace = true } -ic-error-types = { workspace = true } -sha2 = { workspace = true, optional = true } futures-channel = { workspace = true, optional = true } futures-util = { workspace = true } http = { workspace = true, optional = true } +ic-cdk = { workspace = true } +ic-error-types = { workspace = true } num-traits = { workspace = true, optional = true } pin-project = { workspace = true } serde = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } +sha2 = { workspace = true, optional = true } +thiserror = { workspace = true } tower = { workspace = true, features = ["retry"] } tower-layer = { workspace = true, optional = true } -thiserror = { workspace = true } [dev-dependencies] candid = { workspace = true } @@ -35,9 +41,3 @@ maplit = { workspace = true } proptest = { workspace = true } strum = { workspace = true } tokio = { workspace = true, features = ["full"] } - -[features] -default = ["http"] -http = ["dep:http", "dep:num-traits", "dep:tower-layer"] -json = ["http", "dep:serde", "dep:serde_json"] -multi = ["dep:ciborium", "dep:sha2", "dep:futures-channel"] From 581d12d275f8844fb7cd497e7886ad42558a96ff Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 15:50:41 +0200 Subject: [PATCH 09/14] XC-420: copied .github from sol-rpc --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 8 + .github/workflows/ci.yml | 201 +++++++++++++++++++++ .github/workflows/conventional-commits.yml | 39 ++++ .github/workflows/publish.yml | 108 +++++++++++ .github/workflows/release.yml | 28 +++ 6 files changed, 385 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/conventional-commits.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8e4ed08 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @dfinity/cross-chain-team diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..edbdec1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: weekly + time: "01:17" + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6b906b5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,201 @@ +name: 'SOL RPC' + +on: + pull_request: + merge_group: + push: + branches: + - main + tags: + - v* + paths-ignore: + - "README.md" +env: + CARGO_TERM_COLOR: always + SOLANA_CLI_VERSION: "2.1.15" + RUSTFLAGS: "-Dwarnings" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Check code' + run: | + cargo fmt --all -- --check + cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all + cargo clippy --locked --verbose --target wasm32-unknown-unknown -p sol_rpc_canister -- -D clippy::all + + - name: 'Install cargo-sort' + run: cargo install cargo-sort + + - name: 'Check Cargo.toml' + run: cargo sort --workspace --check + + cargo-doc: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cargo doc + run: | + cargo doc --workspace --no-deps + env: + RUSTDOCFLAGS: "--deny warnings" + + reproducible-build: + runs-on: ubuntu-22.04 + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Docker build' + run: | + ./scripts/docker-build + + - name: 'Archive artifact' + uses: actions/upload-artifact@v4 + with: + name: sol_rpc_canister.wasm.gz + path: ./wasms/sol_rpc_canister.wasm.gz + if-no-files-found: error + compression-level: 0 + + - name: 'Add summary' + run: | + hash=`sha256sum ./wasms/sol_rpc_canister.wasm.gz` + echo "SHA-256 :hash: ${hash}" >> $GITHUB_STEP_SUMMARY + + unit-tests: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + - name: 'Run unit tests' + run: cargo test --locked --workspace --exclude basic_solana --exclude sol_rpc_int_tests --exclude sol_rpc_e2e_tests + + integration-tests: + needs: [ reproducible-build ] + runs-on: ubuntu-22.04 + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Download artifacts' + uses: actions/download-artifact@v4 + with: + name: sol_rpc_canister.wasm.gz + + - name: 'Set SOL_RPC_CANISTER_WASM_PATH for load_wasm' + run: | + echo "SOL_RPC_CANISTER_WASM_PATH=$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" >> "$GITHUB_ENV" + + - name: 'Install PocketIC server' + uses: dfinity/pocketic@main + with: + pocket-ic-server-version: "9.0.1" + + - name: 'Install Solana CLI' + run: | + sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_CLI_VERSION}/install)" + echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH + shell: bash + + - name: 'Start Solana test validator' + run: | + solana-test-validator & + + - name: 'Download wallet canister' + run: | + wget https://github.com/dfinity/sdk/raw/0a82e042adec6f24ba53665312713923bf276a34/src/distributed/wallet.wasm.gz + + - name: 'Set WALLET_WASM_PATH for load_wasm' + run: | + echo "WALLET_WASM_PATH=$GITHUB_WORKSPACE/wallet.wasm.gz" >> "$GITHUB_ENV" + + - name: 'Set BASIC_SOLANA_WASM_PATH for load_wasm' + run: | + echo "BASIC_SOLANA_WASM_PATH=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/canister-release/basic_solana.wasm" >> "$GITHUB_ENV" + + - name: 'Test basic_solana' + run: | + cargo build --manifest-path examples/basic_solana/Cargo.toml --target wasm32-unknown-unknown --no-default-features --profile canister-release + cargo test --locked --package basic_solana + + - name: 'Test sol_rpc_int_tests' + run: cargo test --locked --package sol_rpc_int_tests -- --test-threads 2 --nocapture + + end-to-end-tests: + needs: [ reproducible-build ] + runs-on: ubuntu-22.04 + concurrency: + group: ci_environment + cancel-in-progress: true + env: + sol_rpc_canister_id: zaylz-mqaaa-aaaar-qaqzq-cai + wallet_canister_id: zo2gr-xaaaa-aaaar-qaqyq-cai + # Needed to surpass dfx error to use the insecure plaintext identity + DFX_WARNING: -mainnet_plaintext_identity + steps: + - name: 'Checkout' + uses: actions/checkout@v4 + + - name: 'Download artifacts' + uses: actions/download-artifact@v4 + with: + name: sol_rpc_canister.wasm.gz + + - name: 'Install dfx' + uses: dfinity/setup-dfx@e50c04f104ee4285ec010f10609483cf41e4d365 + with: + dfx-version: "0.27.0" + + - name: 'Confirm dfx successful installation' + run: dfx --version + + - name: "Import dfx deploy key" + env: + DFX_DEPLOY_KEY: ${{ secrets.DFX_DEPLOY_KEY }} + run: | + key_pem=$(mktemp) + printenv "DFX_DEPLOY_KEY" > "$key_pem" + dfx identity import --storage-mode plaintext ci "$key_pem" + rm "$key_pem" + dfx identity use ci + dfx identity get-principal + dfx identity set-wallet --ic --force "${{ env.wallet_canister_id }}" + dfx wallet balance --ic + + - name: "Deploy basic_solana locally" + working-directory: examples/basic_solana/local + run: | + dfx start --clean --background + dfx deploy + out=$(dfx canister call basic_solana solana_account --output json) + echo "$out" + echo "$out" | grep -E "[1-9A-HJ-NP-Za-km-z]{32,44}" > /dev/null || { echo "❌ Call to 'solana_account' failed"; exit 1; } + out=$(dfx canister call basic_solana get_balance --output json) + echo "$out" + echo "$out" | grep -E "[0-9]+(?:_[0-9]+)*" > /dev/null || { echo "❌ Call to 'get_balance' failed"; exit 1; } + + - name: "Deploy SOL RPC Canister" + run: | + wallet="${{ env.wallet_canister_id }}" + dfx canister --network ic --wallet "$wallet" install --mode upgrade \ + --wasm "$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" \ + "${{ env.sol_rpc_canister_id }}" + + - name: "Run examples" + working-directory: canister/ci + run: ../scripts/examples.sh 2>&1 | tee e2e_examples.log + + - name: "Detect inconsistent results" + working-directory: canister/ci + run: cat e2e_examples.log | grep -q -e Inconsistent && exit 1 || exit 0 + + - name: "Run end-to-end tests" + env: + DFX_DEPLOY_KEY: ${{ secrets.DFX_DEPLOY_KEY }} + run: cargo test --locked --package sol_rpc_e2e_tests -- --test-threads 1 --nocapture diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 0000000..01255dd --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,39 @@ +name: PR title format +on: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + # When getting Rust dependencies, retry on network error: + CARGO_NET_RETRY: 10 + # Use the local .curlrc + CURL_HOME: . + TITLE: ${{ github.event.pull_request.title }} +jobs: + check: + name: conventional-pr-title:required + runs-on: ubuntu-latest + steps: + # Conventional commit patterns: + # verb: description + # verb!: description of breaking change + # verb(scope): Description of change to $scope + # verb(scope)!: Description of breaking change to $scope + # verb: feat, fix, ... + # scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)" + # !: Indicates that the PR contains a breaking change. + - run: | + if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then + echo pass + else + echo "PR title does not match conventions" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ad52bbf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,108 @@ +name: Publish + +on: + workflow_dispatch + +jobs: + # Release unpublished packages. + release-plz-release: + name: Publish artifacts + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + concurrency: + group: publish + cancel-in-progress: true + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Download build for Release Candidate" + # Adapted from [Internet Identity](https://github.com/dfinity/internet-identity/blob/c33e9f65a8045cbedde6f96cfb7f7cb677694fc9/.github/workflows/deploy-rc.yml#L22) + uses: actions/github-script@v7 + with: + script: | + // Find all artifacts for the production build, and filter for non-expired main artifacts + const allArtifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + name: "sol_rpc_canister.wasm.gz", + }); + const artifactsByBranch = {}; + const mainArtifacts = allArtifacts + .filter(artifact => !artifact.expired) + .filter(artifact => artifact.workflow_run.head_branch === "main"); + + // Grab the latest artifact + mainArtifacts.sort((a,b) => new Date(b.updated_at) - new Date(a.updated_at)); + const latestMainArtifact = mainArtifacts[0]; + if(!latestMainArtifact) { + const message = "Could not find an artifact to deploy from branch main, are artifacts expired?"; + console.error(message); + throw new Error(message); + } + console.log("found artifact for commit", latestMainArtifact.workflow_run.head_sha); + + // Download and unzip artifact + const { url } = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: latestMainArtifact.id, + archive_format: "zip", + }); + await exec.exec('curl', ['-sSL', url, '-o', "artifact.zip"]); + await exec.exec('unzip', ["artifact.zip" ]); + await exec.exec('rm', ["artifact.zip" ]); + + - name: "SHA256 of release asset" + run: | + set -e + SHA256=$(shasum -a 256 ./sol_rpc_canister.wasm.gz | cut -d ' ' -f1) + echo "SHA256 of sol_rpc_canister.wasm.gz: $SHA256" + echo "SOL_RPC_CANISTER_WASM_GZ_SHA256=$SHA256" >> "$GITHUB_ENV" + + - name: "Install parse-changelog" + uses: taiki-e/install-action@parse-changelog + + - name: "Run release-plz" + id: release-plz + uses: release-plz/action@bbd1afc9813d25602e002b29e96e0aacebab1160 # v0.5.105 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + - name: "Generate Github release body" + env: + RELEASES: ${{ steps.release-plz.outputs.releases }} + RELEASES_CREATED: ${{ steps.release-plz.outputs.releases_created }} + run: | + set -e + echo "releases: $RELEASES" # example: [{"package_name":"my-package","prs":[{"html_url":"https://github.com/user/proj/pull/1439","number":1439}],"tag":"v0.1.0","version":"0.1.0"}] + echo "releases_created: $RELEASES_CREATED" # example: true + + release_tag=$(echo "$RELEASES" | jq -r '.[] | select(.package_name == "sol_rpc_canister") | .tag') + echo "release_tag: $release_tag" + echo "RELEASE_TAG=$release_tag" >> "$GITHUB_ENV" + + release_version=$(echo "$RELEASES" | jq -r '.[] | select(.package_name == "sol_rpc_canister") | .version') + echo "release_version: $release_version" + echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" + + notes=$(parse-changelog canister/CHANGELOG.md "$release_version") + + CHANGELOG="$notes" envsubst < release_notes.md >> ${{ github.workspace }}-RELEASE.txt + + - name: "Create Github release" + uses: softprops/action-gh-release@v2 + with: + draft: true + tag_name: ${{ env.RELEASE_TAG}} + body_path: ${{ github.workspace }}-RELEASE.txt + files: | + sol_rpc_canister.wasm.gz + canister/sol_rpc_canister.did diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6da89b1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + workflow_dispatch + +jobs: + # Create a PR with the new versions and changelog, preparing the next release. + release-plz-pr: + name: Release-plz PR + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run release-plz + uses: release-plz/action@bbd1afc9813d25602e002b29e96e0aacebab1160 # v0.5.105 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 9b73f9bd3ec6fd4fe306cc67b79030280ae96277 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 16:07:07 +0200 Subject: [PATCH 10/14] XC-420: adapted CI job --- .github/workflows/ci.yml | 162 ++-------------------------------- .github/workflows/publish.yml | 108 ----------------------- .github/workflows/release.yml | 28 ------ 3 files changed, 7 insertions(+), 291 deletions(-) delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b906b5..0c774ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: 'SOL RPC' +name: 'CI' on: pull_request: @@ -12,7 +12,6 @@ on: - "README.md" env: CARGO_TERM_COLOR: always - SOLANA_CLI_VERSION: "2.1.15" RUSTFLAGS: "-Dwarnings" jobs: @@ -22,11 +21,11 @@ jobs: - name: 'Checkout' uses: actions/checkout@v4 - - name: 'Check code' - run: | - cargo fmt --all -- --check - cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all - cargo clippy --locked --verbose --target wasm32-unknown-unknown -p sol_rpc_canister -- -D clippy::all + - name: 'Run clippy' + run: cargo clippy --locked --all-targets --all-features -- -D clippy::all + + - name: 'Run rustfmt' + run: cargo fmt --all -- --check - name: 'Install cargo-sort' run: cargo install cargo-sort @@ -45,157 +44,10 @@ jobs: env: RUSTDOCFLAGS: "--deny warnings" - reproducible-build: - runs-on: ubuntu-22.04 - steps: - - name: 'Checkout' - uses: actions/checkout@v4 - - - name: 'Docker build' - run: | - ./scripts/docker-build - - - name: 'Archive artifact' - uses: actions/upload-artifact@v4 - with: - name: sol_rpc_canister.wasm.gz - path: ./wasms/sol_rpc_canister.wasm.gz - if-no-files-found: error - compression-level: 0 - - - name: 'Add summary' - run: | - hash=`sha256sum ./wasms/sol_rpc_canister.wasm.gz` - echo "SHA-256 :hash: ${hash}" >> $GITHUB_STEP_SUMMARY - unit-tests: runs-on: ubuntu-latest steps: - name: 'Checkout' uses: actions/checkout@v4 - name: 'Run unit tests' - run: cargo test --locked --workspace --exclude basic_solana --exclude sol_rpc_int_tests --exclude sol_rpc_e2e_tests - - integration-tests: - needs: [ reproducible-build ] - runs-on: ubuntu-22.04 - steps: - - name: 'Checkout' - uses: actions/checkout@v4 - - - name: 'Download artifacts' - uses: actions/download-artifact@v4 - with: - name: sol_rpc_canister.wasm.gz - - - name: 'Set SOL_RPC_CANISTER_WASM_PATH for load_wasm' - run: | - echo "SOL_RPC_CANISTER_WASM_PATH=$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" >> "$GITHUB_ENV" - - - name: 'Install PocketIC server' - uses: dfinity/pocketic@main - with: - pocket-ic-server-version: "9.0.1" - - - name: 'Install Solana CLI' - run: | - sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_CLI_VERSION}/install)" - echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH - shell: bash - - - name: 'Start Solana test validator' - run: | - solana-test-validator & - - - name: 'Download wallet canister' - run: | - wget https://github.com/dfinity/sdk/raw/0a82e042adec6f24ba53665312713923bf276a34/src/distributed/wallet.wasm.gz - - - name: 'Set WALLET_WASM_PATH for load_wasm' - run: | - echo "WALLET_WASM_PATH=$GITHUB_WORKSPACE/wallet.wasm.gz" >> "$GITHUB_ENV" - - - name: 'Set BASIC_SOLANA_WASM_PATH for load_wasm' - run: | - echo "BASIC_SOLANA_WASM_PATH=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/canister-release/basic_solana.wasm" >> "$GITHUB_ENV" - - - name: 'Test basic_solana' - run: | - cargo build --manifest-path examples/basic_solana/Cargo.toml --target wasm32-unknown-unknown --no-default-features --profile canister-release - cargo test --locked --package basic_solana - - - name: 'Test sol_rpc_int_tests' - run: cargo test --locked --package sol_rpc_int_tests -- --test-threads 2 --nocapture - - end-to-end-tests: - needs: [ reproducible-build ] - runs-on: ubuntu-22.04 - concurrency: - group: ci_environment - cancel-in-progress: true - env: - sol_rpc_canister_id: zaylz-mqaaa-aaaar-qaqzq-cai - wallet_canister_id: zo2gr-xaaaa-aaaar-qaqyq-cai - # Needed to surpass dfx error to use the insecure plaintext identity - DFX_WARNING: -mainnet_plaintext_identity - steps: - - name: 'Checkout' - uses: actions/checkout@v4 - - - name: 'Download artifacts' - uses: actions/download-artifact@v4 - with: - name: sol_rpc_canister.wasm.gz - - - name: 'Install dfx' - uses: dfinity/setup-dfx@e50c04f104ee4285ec010f10609483cf41e4d365 - with: - dfx-version: "0.27.0" - - - name: 'Confirm dfx successful installation' - run: dfx --version - - - name: "Import dfx deploy key" - env: - DFX_DEPLOY_KEY: ${{ secrets.DFX_DEPLOY_KEY }} - run: | - key_pem=$(mktemp) - printenv "DFX_DEPLOY_KEY" > "$key_pem" - dfx identity import --storage-mode plaintext ci "$key_pem" - rm "$key_pem" - dfx identity use ci - dfx identity get-principal - dfx identity set-wallet --ic --force "${{ env.wallet_canister_id }}" - dfx wallet balance --ic - - - name: "Deploy basic_solana locally" - working-directory: examples/basic_solana/local - run: | - dfx start --clean --background - dfx deploy - out=$(dfx canister call basic_solana solana_account --output json) - echo "$out" - echo "$out" | grep -E "[1-9A-HJ-NP-Za-km-z]{32,44}" > /dev/null || { echo "❌ Call to 'solana_account' failed"; exit 1; } - out=$(dfx canister call basic_solana get_balance --output json) - echo "$out" - echo "$out" | grep -E "[0-9]+(?:_[0-9]+)*" > /dev/null || { echo "❌ Call to 'get_balance' failed"; exit 1; } - - - name: "Deploy SOL RPC Canister" - run: | - wallet="${{ env.wallet_canister_id }}" - dfx canister --network ic --wallet "$wallet" install --mode upgrade \ - --wasm "$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" \ - "${{ env.sol_rpc_canister_id }}" - - - name: "Run examples" - working-directory: canister/ci - run: ../scripts/examples.sh 2>&1 | tee e2e_examples.log - - - name: "Detect inconsistent results" - working-directory: canister/ci - run: cat e2e_examples.log | grep -q -e Inconsistent && exit 1 || exit 0 - - - name: "Run end-to-end tests" - env: - DFX_DEPLOY_KEY: ${{ secrets.DFX_DEPLOY_KEY }} - run: cargo test --locked --package sol_rpc_e2e_tests -- --test-threads 1 --nocapture + run: cargo test --locked --workspace \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index ad52bbf..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Publish - -on: - workflow_dispatch - -jobs: - # Release unpublished packages. - release-plz-release: - name: Publish artifacts - runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: write - concurrency: - group: publish - cancel-in-progress: true - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: "Download build for Release Candidate" - # Adapted from [Internet Identity](https://github.com/dfinity/internet-identity/blob/c33e9f65a8045cbedde6f96cfb7f7cb677694fc9/.github/workflows/deploy-rc.yml#L22) - uses: actions/github-script@v7 - with: - script: | - // Find all artifacts for the production build, and filter for non-expired main artifacts - const allArtifacts = await github.paginate(github.rest.actions.listArtifactsForRepo, { - owner: context.repo.owner, - repo: context.repo.repo, - name: "sol_rpc_canister.wasm.gz", - }); - const artifactsByBranch = {}; - const mainArtifacts = allArtifacts - .filter(artifact => !artifact.expired) - .filter(artifact => artifact.workflow_run.head_branch === "main"); - - // Grab the latest artifact - mainArtifacts.sort((a,b) => new Date(b.updated_at) - new Date(a.updated_at)); - const latestMainArtifact = mainArtifacts[0]; - if(!latestMainArtifact) { - const message = "Could not find an artifact to deploy from branch main, are artifacts expired?"; - console.error(message); - throw new Error(message); - } - console.log("found artifact for commit", latestMainArtifact.workflow_run.head_sha); - - // Download and unzip artifact - const { url } = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: latestMainArtifact.id, - archive_format: "zip", - }); - await exec.exec('curl', ['-sSL', url, '-o', "artifact.zip"]); - await exec.exec('unzip', ["artifact.zip" ]); - await exec.exec('rm', ["artifact.zip" ]); - - - name: "SHA256 of release asset" - run: | - set -e - SHA256=$(shasum -a 256 ./sol_rpc_canister.wasm.gz | cut -d ' ' -f1) - echo "SHA256 of sol_rpc_canister.wasm.gz: $SHA256" - echo "SOL_RPC_CANISTER_WASM_GZ_SHA256=$SHA256" >> "$GITHUB_ENV" - - - name: "Install parse-changelog" - uses: taiki-e/install-action@parse-changelog - - - name: "Run release-plz" - id: release-plz - uses: release-plz/action@bbd1afc9813d25602e002b29e96e0aacebab1160 # v0.5.105 - with: - command: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: "Generate Github release body" - env: - RELEASES: ${{ steps.release-plz.outputs.releases }} - RELEASES_CREATED: ${{ steps.release-plz.outputs.releases_created }} - run: | - set -e - echo "releases: $RELEASES" # example: [{"package_name":"my-package","prs":[{"html_url":"https://github.com/user/proj/pull/1439","number":1439}],"tag":"v0.1.0","version":"0.1.0"}] - echo "releases_created: $RELEASES_CREATED" # example: true - - release_tag=$(echo "$RELEASES" | jq -r '.[] | select(.package_name == "sol_rpc_canister") | .tag') - echo "release_tag: $release_tag" - echo "RELEASE_TAG=$release_tag" >> "$GITHUB_ENV" - - release_version=$(echo "$RELEASES" | jq -r '.[] | select(.package_name == "sol_rpc_canister") | .version') - echo "release_version: $release_version" - echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" - - notes=$(parse-changelog canister/CHANGELOG.md "$release_version") - - CHANGELOG="$notes" envsubst < release_notes.md >> ${{ github.workspace }}-RELEASE.txt - - - name: "Create Github release" - uses: softprops/action-gh-release@v2 - with: - draft: true - tag_name: ${{ env.RELEASE_TAG}} - body_path: ${{ github.workspace }}-RELEASE.txt - files: | - sol_rpc_canister.wasm.gz - canister/sol_rpc_canister.did diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 6da89b1..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release - -on: - workflow_dispatch - -jobs: - # Create a PR with the new versions and changelog, preparing the next release. - release-plz-pr: - name: Release-plz PR - runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: write - concurrency: - group: release-plz-${{ github.ref }} - cancel-in-progress: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run release-plz - uses: release-plz/action@bbd1afc9813d25602e002b29e96e0aacebab1160 # v0.5.105 - with: - command: release-pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 971673ef607f607c39deaf3900160bc0c3768fbd Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 16:14:03 +0200 Subject: [PATCH 11/14] XC-420: clippy --- canhttp/src/multi/tests.rs | 8 ++++---- canhttp/src/retry/tests.rs | 18 +++--------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/canhttp/src/multi/tests.rs b/canhttp/src/multi/tests.rs index cab27b2..5083cbc 100644 --- a/canhttp/src/multi/tests.rs +++ b/canhttp/src/multi/tests.rs @@ -50,7 +50,7 @@ mod reduce_with_equality { for inconsistent_result in [Ok("different"), Err("offline")] { for index in 0..4 { let mut results = [Ok("same"), Ok("same"), Ok("same"), Ok("same")]; - results[index] = inconsistent_result.clone(); + results[index] = inconsistent_result; let [result_0, result_1, result_2, result_3] = results; @@ -132,7 +132,7 @@ mod reduce_with_threshold { for inconsistent_result in [Ok("different"), Err("offline")] { for index_inconsistent in 0..4_usize { let mut results = [Ok("same"), Ok("same"), Ok("same"), Ok("same")]; - results[index_inconsistent] = inconsistent_result.clone(); + results[index_inconsistent] = inconsistent_result; let [result_0, result_1, result_2, result_3] = results; check_consistent_result( @@ -178,8 +178,8 @@ mod reduce_with_threshold { { for indexes in (0..4_usize).permutations(2) { let mut results = [Ok("same"), Ok("same"), Ok("same"), Ok("same")]; - results[indexes[0]] = inconsistent_res_1.clone(); - results[indexes[1]] = inconsistent_res_2.clone(); + results[indexes[0]] = *inconsistent_res_1; + results[indexes[1]] = inconsistent_res_2; let [result_0, result_1, result_2, result_3] = results; check_inconsistent_result( diff --git a/canhttp/src/retry/tests.rs b/canhttp/src/retry/tests.rs index 5d6f9b0..620f70f 100644 --- a/canhttp/src/retry/tests.rs +++ b/canhttp/src/retry/tests.rs @@ -34,11 +34,7 @@ async fn should_retry_until_max() { .unwrap_err(); assert!(response.is_response_too_large()); - let mut all_requests = Vec::new(); - let mut iter = requests_rx.try_iter(); - while let Some(req) = iter.next() { - all_requests.push(req); - } + let all_requests: Vec<_> = requests_rx.try_iter().collect(); assert_eq!(all_requests.len(), 12); assert_eq!( @@ -87,11 +83,7 @@ async fn should_not_retry() { .unwrap_err(); assert!(response.is_response_too_large()); - let mut all_requests = Vec::new(); - let mut iter = requests_rx.try_iter(); - while let Some(req) = iter.next() { - all_requests.push(req); - } + let all_requests: Vec<_> = requests_rx.try_iter().collect(); assert_eq!(all_requests.len(), 1); } } @@ -117,11 +109,7 @@ async fn should_stop_retrying_when_ok() { let response = service.ready().await.unwrap().call(request).await; assert_matches!(response, Ok(_)); - let mut all_requests = Vec::new(); - let mut iter = requests_rx.try_iter(); - while let Some(req) = iter.next() { - all_requests.push(req); - } + let all_requests: Vec<_> = requests_rx.try_iter().collect(); assert_eq!(all_requests.len(), (num_errors + 1) as usize); assert_eq!( From a43292414cd0ddb04ecca8dcf9fc12bfe58098d4 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 16:14:50 +0200 Subject: [PATCH 12/14] XC-420: clippy --- canhttp/src/http/json/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canhttp/src/http/json/tests.rs b/canhttp/src/http/json/tests.rs index 13e2adf..1e03b95 100644 --- a/canhttp/src/http/json/tests.rs +++ b/canhttp/src/http/json/tests.rs @@ -78,7 +78,7 @@ mod json_rpc { #[test] fn should_serialize_version() { - assert_eq!(serde_json::to_value(&Version::V2).unwrap(), json!("2.0")); + assert_eq!(serde_json::to_value(Version::V2).unwrap(), json!("2.0")); } #[test] From faa704d3172961f048cefe7e8e0cd3e39c31f540 Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 16:14:59 +0200 Subject: [PATCH 13/14] XC-420: add rust-toolchain --- rust-toolchain.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..fa28895 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.87.0" +components = ["rustfmt", "clippy"] +targets = ["wasm32-unknown-unknown"] From 1efac29910da3aa8c7fcc42cfcbe0ff5cf28cbce Mon Sep 17 00:00:00 2001 From: gregorydemay Date: Wed, 9 Jul 2025 16:40:30 +0200 Subject: [PATCH 14/14] XC-420: monthly dependabot --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index edbdec1..660195b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,6 @@ updates: - package-ecosystem: cargo directory: "/" schedule: - interval: weekly + interval: monthly time: "01:17" open-pull-requests-limit: 10