Skip to content

Commit

Permalink
chore: bump candid to 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Nov 17, 2023
1 parent ed0862a commit f72c6ec
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 77 deletions.
129 changes: 58 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ ic-utils = { path = "ic-utils", version = "0.30.2" }
ic-transport-types = { path = "ic-transport-types", version = "0.30.2" }

ic-certification = "1.2.0"
candid = "0.9.5"
candid = "0.10.0"
candid_parser = "0.1.0"
clap = "4.4.3"
hex = "0.4.3"
leb128 = "0.2.5"
Expand Down
3 changes: 2 additions & 1 deletion icx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ path = "src/main.rs"

[dependencies]
anyhow = { version = "1.0", features = ["backtrace"] }
candid = { workspace = true, features = ["parser"] }
candid = { workspace = true, features = ["value"] }
candid_parser = { workspace = true }
clap = { workspace = true, features = ["derive", "cargo", "color"] }
hex = { workspace = true }
humantime = "2.0.1"
Expand Down
8 changes: 4 additions & 4 deletions icx/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use anyhow::{bail, Context, Result};
use candid::{
check_prog,
types::value::IDLValue,
types::{Function, Type, TypeInner},
CandidType, Decode, Deserialize, IDLArgs, IDLProg, TypeEnv,
CandidType, Decode, Deserialize, IDLArgs, TypeEnv,
};
use candid_parser::{check_prog, parse_idl_args, parse_idl_value, IDLProg};
use clap::{crate_authors, crate_version, Parser, ValueEnum};
use ic_agent::{
agent::{self, signed::SignedUpdate},
Expand Down Expand Up @@ -194,7 +194,7 @@ fn blob_from_arguments(
}
ArgType::Idl => {
let arguments = arguments.unwrap_or("()");
let args = arguments.parse::<IDLArgs>();
let args = parse_idl_args(arguments);
let typed_args = match method_type {
None => args
.context("Failed to parse arguments with no method type info")?
Expand All @@ -210,7 +210,7 @@ fn blob_from_arguments(
if &TypeInner::Text == func.args[0].as_ref() && !is_quote {
Ok(IDLValue::Text(arguments.to_string()))
} else {
arguments.parse::<IDLValue>()
parse_idl_value(arguments)
}
.map(|v| IDLArgs::new(&[v]))
} else {
Expand Down

0 comments on commit f72c6ec

Please sign in to comment.