Skip to content

Commit

Permalink
always compile candid type because imports need to be resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
sesi200 committed Jan 12, 2024
1 parent 3b7d576 commit 9b34c88
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dfx/src/lib/models/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ fn separate_candid(path: &Path) -> DfxResult<(String, String)> {
let init_args = enclose("(", doc, ")").pretty(80).to_string();
Ok((service_did, init_args))
} else {
// The original candid from builder output doesn't contain init_args
// Use it directly to avoid items reordering
let service_did = dfx_core::fs::read_to_string(path)?;
// Note for migration to candid 0.10: this function is now candid_parser::pretty::candid::compile
let service_did = candid::bindings::candid::compile(&env, &Some(actor));
let init_args = String::from("()");
Ok((service_did, init_args))
}
Expand Down

0 comments on commit 9b34c88

Please sign in to comment.