Skip to content

Commit 78c7b0b

Browse files
AsixDev-Eugene0082Daniel-Bloom-dfinity
AsixDev-Eugene0082
andauthored
chore: bump candid (#72)
* chore: bump candid to 0.7.1 * remove `ic-types` direct dependency since `candid` exports it (#111) Co-authored-by: Daniel-Bloom-dfinity <[email protected]>
1 parent 469deef commit 78c7b0b

File tree

17 files changed

+14
-26
lines changed

17 files changed

+14
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ members = [
55
"src/ic-cdk-optimizer",
66
"src/ic-certified-map",
77
]
8+

docs/modules/rust-guide/examples/counter-tutorial/counter_Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ crate-type = ["cdylib"]
1111
[dependencies]
1212
ic-cdk = { version = "0.2.4" }
1313
ic-cdk-macros = { version = "0.2.4" }
14-
ic-types = "0.1.1"
1514
lazy_static = "1.4.0"

docs/modules/rust-guide/examples/mul-deps/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ crate-type = ["cdylib"]
1111
[dependencies]
1212
ic-cdk = { version="0.2.4" }
1313
ic-cdk-macros = { version="0.2.4" }
14-
ic-types = "0.1.1"
1514

docs/modules/rust-guide/examples/profile-tutorial/profile-Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
ic-cdk = "0.2.4"
1414
ic-cdk-macros = "0.2.4"
15-
ic-types = "0.1.1"
1615
serde = "1.0.111"

docs/modules/rust-guide/pages/rust-profile.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ crate-type = ["cdylib"]
182182
[dependencies]
183183
ic-cdk = "0.3"
184184
ic-cdk-macros = "0.3"
185-
ic-types = "0.1.1"
186185
serde = "1.0.111"
187186
----
188187
+

examples/asset_storage/src/asset_storage_rs/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ crate-type = ["cdylib"]
1313
[dependencies]
1414
ic-cdk = { path = "../../../../src/ic-cdk", version = "0.3" }
1515
ic-cdk-macros = { path = "../../../../src/ic-cdk-macros", version = "0.3" }
16-
ic-types = "0.1.1"
1716
serde = "1.0.111"

examples/asset_storage/src/asset_storage_rs/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use ic_cdk::storage;
1+
use ic_cdk::{storage, export::Principal};
22
use ic_cdk_macros::*;
3-
use ic_types::Principal;
43
use std::collections::{BTreeMap, BTreeSet};
54

65
type Users = BTreeSet<Principal>;

examples/counter/src/counter_rs/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ crate-type = ["cdylib"]
1313
[dependencies]
1414
ic-cdk = { path = "../../../../src/ic-cdk", version = "0.3" }
1515
ic-cdk-macros = { path = "../../../../src/ic-cdk-macros", version = "0.3" }
16-
ic-types = "0.1.1"
1716
lazy_static = "1.4.0"

examples/profile/src/profile_rs/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ crate-type = ["cdylib"]
1313
[dependencies]
1414
ic-cdk = { path = "../../../../src/ic-cdk", version = "0.3" }
1515
ic-cdk-macros = { path = "../../../../src/ic-cdk-macros", version = "0.3" }
16-
ic-types = "0.1.1"
1716
serde = "1.0.111"

src/ic-cdk-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include = ["src", "Cargo.toml", "LICENSE", "README.md"]
1616
proc-macro = true
1717

1818
[dependencies]
19-
candid = "0.6.19"
19+
candid = "0.7.1"
2020
ic-cdk = { path = "../ic-cdk", version = "0.3" }
2121
syn = { version = "1.0.58", features = ["fold", "full"] }
2222
quote = "1.0"

src/ic-cdk/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ keywords = ["internet-computer", "types", "dfinity", "canister", "cdk"]
1313
include = ["src", "Cargo.toml", "LICENSE", "README.md"]
1414

1515
[dependencies]
16-
candid = "0.6.19"
16+
candid = "0.7.1"
1717
cfg-if = "0.1.10"
18-
ic-types = "0.1.1"
1918
serde = "1.0.110"
2019

2120
[features]

src/ic-cdk/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! System API and low level functions for it.
2-
use ic_types::Principal;
2+
use crate::export::Principal;
33
use std::convert::TryFrom;
44

55
pub mod call;

src/ic-cdk/src/api/call.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
//! APIs to make and manage calls in the canister.
22
use crate::api::{ic0, trap};
3-
use crate::export::candid::ser::write_args;
43
use crate::export::Principal;
5-
use candid::de::ArgumentDecoder;
6-
use candid::ser::ArgumentEncoder;
7-
use candid::{decode_args, encode_args};
4+
use candid::utils::{ArgumentDecoder, ArgumentEncoder};
5+
use candid::{decode_args, encode_args, write_args};
86
use std::future::Future;
97
use std::pin::Pin;
108
use std::task::{Context, Poll, Waker};

src/ic-cdk/src/futures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::future::Future;
22
use std::pin::Pin;
3-
use std::task::{Context, Poll};
3+
use std::task::Context;
44

55
/// Must be called on every top-level future corresponding to a method call of a
66
/// canister by the IC.

src/ic-cdk/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static mut DONE: bool = false;
1010

1111
pub mod export {
1212
pub use candid;
13-
pub use ic_types::Principal;
13+
pub use candid::types::ic_types::Principal;
1414
}
1515

1616
/// Setup the stdlib hooks.

src/ic-cdk/src/storage.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ pub fn get<T: Sized + Default + 'static>() -> &'static T {
4343
/// This will override any value previously stored to stable memory.
4444
pub fn stable_save<T>(t: T) -> Result<(), candid::Error>
4545
where
46-
T: candid::ser::ArgumentEncoder,
46+
T: candid::utils::ArgumentEncoder,
4747
{
48-
candid::ser::write_args(&mut stable::StableWriter::default(), t)
48+
candid::write_args(&mut stable::StableWriter::default(), t)
4949
}
5050

5151
/// Restore a value to the storage, from the stable memory.
5252
/// There can only be one value in stable memory, currently.
5353
pub fn stable_restore<T>() -> Result<T, String>
5454
where
55-
T: for<'de> candid::de::ArgumentDecoder<'de>,
55+
T: for<'de> candid::utils::ArgumentDecoder<'de>,
5656
{
5757
let bytes = stable::stable_bytes();
5858

5959
let mut de =
6060
candid::de::IDLDeserialize::new(bytes.as_slice()).map_err(|e| format!("{:?}", e))?;
61-
let res = candid::de::ArgumentDecoder::decode(&mut de).map_err(|e| format!("{:?}", e))?;
61+
let res = candid::utils::ArgumentDecoder::decode(&mut de).map_err(|e| format!("{:?}", e))?;
6262
// The idea here is to ignore an error that comes from Candid, because we have trailing
6363
// bytes.
6464
let _ = de.done();

src/ic-certified-map/src/rbtree.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ impl<K: 'static + AsRef<[u8]>, V: AsHashTree + 'static> RbTree<K, V> {
637637
h = move_red_left(h);
638638
}
639639
(*h).left = go((*h).left, key);
640-
(*h).subtree_hash = Node::subtree_hash(h);
641640
} else {
642641
if is_red((*h).left) {
643642
h = rotate_right(h);
@@ -657,12 +656,11 @@ impl<K: 'static + AsRef<[u8]>, V: AsHashTree + 'static> RbTree<K, V> {
657656
std::mem::swap(&mut (*h).key, &mut (*m).key);
658657
std::mem::swap(&mut (*h).value, &mut (*m).value);
659658
(*h).right = delete_min((*h).right);
660-
(*h).subtree_hash = Node::subtree_hash(h);
661659
} else {
662660
(*h).right = go((*h).right, key);
663-
(*h).subtree_hash = Node::subtree_hash(h);
664661
}
665662
}
663+
(*h).subtree_hash = Node::subtree_hash(h);
666664
balance(h)
667665
}
668666

0 commit comments

Comments
 (0)