Skip to content

Commit

Permalink
Merge branch 'master' into update/advisory-db-0fcce3f7cbbc76da50ab0d7…
Browse files Browse the repository at this point in the history
…78399bf85dc141834
  • Loading branch information
ericswanson-dfinity authored Sep 12, 2023
2 parents 170da5d + cb4858c commit 9ed833f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# UNRELEASED

### fix: Include remote canisters in canisters_to_generate

Generate frontend declarations for remote canisters too because frontend JS code may want to call them.

### feat: Updated handling of missing values in state tree certificates

The `Unknown` lookup of a path in a certificate results in an `AgentError` (the IC returns `Absent` for non-existing paths).
Expand Down
9 changes: 9 additions & 0 deletions e2e/tests-dfx/remote.bash
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ teardown() {

assert_command jq .remote canister_ids.json
assert_eq "null"

# Assert frontend declarations are actually created
dfx generate
assert_file_exists "src/declarations/remote/remote.did"
assert_file_exists "src/declarations/remote/remote.did.js"
assert_file_exists "src/declarations/remote/remote.did.d.ts"
assert_file_exists "src/declarations/remote/index.js"
assert_file_exists "src/declarations/remote/index.d.ts"

}

@test "for remote build, checks imports against the candid file rather than the mock" {
Expand Down
11 changes: 1 addition & 10 deletions src/dfx/src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,7 @@ pub fn exec(env: &dyn Environment, opts: GenerateOpts) -> DfxResult {
let canisters_to_load = config
.get_config()
.get_canister_names_with_dependencies(opts.canister_name.as_deref())?;
let canisters_to_generate = canisters_to_load
.clone()
.into_iter()
.filter(|canister_name| {
!config
.get_config()
.is_remote_canister(canister_name, &env.get_network_descriptor().name)
.unwrap_or(false)
})
.collect();
let canisters_to_generate = canisters_to_load.clone().into_iter().collect();

let canister_pool_load = CanisterPool::load(&env, false, &canisters_to_load)?;

Expand Down

0 comments on commit 9ed833f

Please sign in to comment.