Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dfx/src/commands/canister/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn construct() -> App<'static, 'static> {
.long("type")
.takes_value(true)
.requires("argument")
.possible_values(&["string", "number", "idl"]),
.possible_values(&["string", "number", "idl", "raw"]),
)
.arg(
Arg::with_name("argument")
Expand Down Expand Up @@ -135,6 +135,9 @@ where
e
))
})?)),
Some("raw") => Ok(hex::decode(&a).map_err(|e| {
DfxError::InvalidArgument(format!("Argument is not a valid hex string: {}", e))
})?),
Some("idl") | None => {
let args: IDLArgs = a
.parse()
Expand Down
3 changes: 3 additions & 0 deletions e2e/basic-project.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ teardown() {
assert_command dfx canister call hello greet '("Banzai")'
assert_eq '("Hello, Banzai!")'

assert_command dfx canister call hello greet --type raw '4449444c00017103e29883'
assert_eq '("Hello, ☃!")'

assert_command dfx canister query hello greet '("Banzai")'
assert_match '\("Hello, Banzai!"\)'

Expand Down