From 752cc12bae5feaf82e97c1713e05c104d186bc53 Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Thu, 23 Nov 2023 13:35:04 +0100 Subject: [PATCH] chore: Upgrade candid to v0.10 This upgrades candid to the new libary version which has been split into smaller pieces, hence reducing the size of the dependencies for downstream projects. --- Cargo.lock | 119 +++++++++++++--------------------- Cargo.toml | 3 +- src/ic-cdk-bindgen/Cargo.toml | 3 +- 3 files changed, 49 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10f309979..e0bf169fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,9 +172,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "camino" @@ -187,31 +187,23 @@ dependencies = [ [[package]] name = "candid" -version = "0.9.6" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f6eec0ae850e006ef0fe306f362884d370624094ec55a6a26de18b251774be" +checksum = "a2525ab7a58543c132da8c780abe3aa1ba394ddcc1888a4ad2ba4f5100906ebe" dependencies = [ "anyhow", "binread", "byteorder", "candid_derive", - "codespan-reporting", - "convert_case", - "crc32fast", - "data-encoding", "hex", - "lalrpop", - "lalrpop-util", + "ic_principal", "leb128", - "logos", "num-bigint", "num-traits", - "num_enum", "paste", "pretty", "serde", "serde_bytes", - "sha2", "stacker", "thiserror", ] @@ -228,9 +220,9 @@ dependencies = [ [[package]] name = "candid_derive" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158403ea38fab5904ae47a5d67eb7047650a91681407f5ccbcbcabc4f4ffb489" +checksum = "970c220da8aa2fa6f7ef5dbbf3ea5b620a59eb3ac107cfb95ae8c6eebdfb7a08" dependencies = [ "lazy_static", "proc-macro2", @@ -238,6 +230,25 @@ dependencies = [ "syn 2.0.25", ] +[[package]] +name = "candid_parser" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152b737c1c2681d4ed3359f15016b499f2ddc59aef9fdce0be82f483c11e700" +dependencies = [ + "anyhow", + "candid", + "codespan-reporting", + "convert_case", + "hex", + "lalrpop", + "lalrpop-util", + "logos", + "num-bigint", + "pretty", + "thiserror", +] + [[package]] name = "cargo-platform" version = "0.1.2" @@ -899,6 +910,7 @@ name = "ic-cdk-bindgen" version = "0.1.1" dependencies = [ "candid", + "candid_parser", ] [[package]] @@ -972,9 +984,9 @@ dependencies = [ [[package]] name = "ic-test-state-machine-client" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cadf6ac4a193a8a45287da67c6c385f118d9266f46d6d98e40fbbd469d3822e" +checksum = "b8e05a81e0cbdf178228d72ace06c60ac7fa99927b49a238f9ccf5ef82eaced6" dependencies = [ "candid", "ciborium", @@ -990,6 +1002,22 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "ic_principal" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899a4e8ddada85b91a2fe32b4dc6c0d475ef7bfef3f51cf2aecb26ee4ac4724f" +dependencies = [ + "arbitrary", + "crc32fast", + "data-encoding", + "hex", + "serde", + "serde_bytes", + "sha2", + "thiserror", +] + [[package]] name = "id-arena" version = "2.2.1" @@ -1245,15 +1273,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - [[package]] name = "num-bigint" version = "0.4.3" @@ -1295,27 +1314,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.25", -] - [[package]] name = "object" version = "0.31.1" @@ -1435,16 +1433,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" -dependencies = [ - "once_cell", - "toml_edit", -] - [[package]] name = "proc-macro2" version = "1.0.64" @@ -1947,23 +1935,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" - -[[package]] -name = "toml_edit" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" -dependencies = [ - "indexmap 1.9.2", - "nom8", - "toml_datetime", -] - [[package]] name = "trybuild" version = "1.0.77" diff --git a/Cargo.toml b/Cargo.toml index da46aae85..340d092d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,8 @@ ic0 = { path = "src/ic0", version = "0.21.1" } ic-cdk = { path = "src/ic-cdk", version = "0.11.4" } ic-cdk-timers = { path = "src/ic-cdk-timers", version = "0.5.1" } -candid = "0.9.6" +candid = "0.10.0" +candid_parser = "0.1.0" futures = "0.3" hex = "0.4" quote = "1" diff --git a/src/ic-cdk-bindgen/Cargo.toml b/src/ic-cdk-bindgen/Cargo.toml index 76e94a59e..d064c9fea 100644 --- a/src/ic-cdk-bindgen/Cargo.toml +++ b/src/ic-cdk-bindgen/Cargo.toml @@ -13,4 +13,5 @@ keywords = ["internet-computer", "types", "dfinity", "canister", "cdk"] include = ["src", "Cargo.toml", "LICENSE", "README.md"] [dependencies] -candid = { workspace = true, features = ["parser"] } +candid.workspace = true +candid_parser.workspace = true