Skip to content

Commit

Permalink
Merge branch 'master' into vincent/SDK-1864
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-dfinity authored Nov 5, 2024
2 parents e2493f0 + e38b55f commit b3cd8dc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 44 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Allow setting permissions lists in init arguments just like in upgrade arguments
- Module hash: 2c24b5e1584890a7965011d5d1d827aca68c489c9a6308475730420fa53372e8
- https://github.com/dfinity/sdk/pull/3965

### Candid UI

- Module hash: f45db224b40fac516c877e3108dc809d4b22fa42d05ee8dfa5002536a3a3daed
- Bump agent-js to fix error code

### chore!: improve `dfx cycles balance` messages.

If users run `dfx cycles balance` without running the `--ic` flag, show below messages to indicate what to do next.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli-reference/dfx-identity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dfx identity export alice >generated-id.pem

## dfx identity import

Use the `dfx identity import` command to create a user identity by importing the user’s key information or security certificate from a PEM file.
Use the `dfx identity import` command to create a user identity by importing the user’s key information or security certificate from a PEM file or seed phrase file.

*Password policy*: If an identity is imported using `--storage-mode password-protected`, the following requirements apply to the password:
- The password needs to be longer than 8 characters.
Expand Down
52 changes: 11 additions & 41 deletions scripts/test-uis.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,21 @@
("Error", "/index.js"),
("Invalid asm.js: Unexpected token", "/index.js"),
("Expected to find result for path [object Object], but instead found nothing.", "/index.js"),
("If you want to use Internet Identity, please provide a URL to your local Internet Identity service using the `ii` query parameter", "/index.js"),
(
"""
Error: Server returned an error:
Code: 404 (Not Found)
Body: Custom section name not found.
at j.readState (http://localhost:4943/index.js:2:11709)
at async http://localhost:4943/index.js:2:97683
at async Promise.all (index 0)
at async Module.UA (http://localhost:4943/index.js:2:98732)
at async Object.getNames (http://localhost:4943/index.js:2:266156)
at async http://localhost:4943/index.js:2:275479""".strip(),
AgentError: Call failed:
Canister: aaaaa-aa
Method: fetch_canister_logs (query)
"Status": "rejected"
"Code": "CanisterReject"
"Message": "IC0406: Caller 2vxsx-fae is not allowed to query ic00 method fetch_canister_logs"
""".strip(),
"/index.js",
),
(
"""
Error: Server returned an error:
Code: 404 (Not Found)
Body: Custom section name not found.""".strip(),
"/index.js",
),
)
]
_CANDID_UI_ERRORS_TO_IGNORE = [
("Error", "/index.js"),
("Failed to load resource: the server responded with a status of 404 (Not Found)", "/read_state"),
(
"Error: Please provide a URL to your local Internet Identity service using the `ii` query parameter",
"/index.js",
),
(
"""
Error: Please provide a URL to your local Internet Identity service using the `ii` query parameter
at http://localhost:4943/index.js:2:300040
at t.renderAuth (http://localhost:4943/index.js:2:301237)
at async http://localhost:4943/index.js:2:314291""".strip(),
"/index.js",
),
(
"""
Error: Please provide a URL to your local Internet Identity service using the `ii` query parameter
at http://127.0.0.1:4943/index.js:2:300040
at t.renderAuth (http://127.0.0.1:4943/index.js:2:301237)
at async http://127.0.0.1:4943/index.js:2:314291""".strip(),
"/index.js",
),
("Error", "/index.js")
]
# `page.route` does not support additional function parameters
_FRONTEND_URL = None
Expand Down Expand Up @@ -161,7 +131,7 @@ def _check_console_logs(console_logs):
for actual_text, endpoint in (
_CANDID_UI_ERRORS_TO_IGNORE if log.type == "error" else _CANDID_UI_WARNINGS_TO_IGNORE
):
if actual_text == log.text.strip() and endpoint in url:
if log.text.strip().startswith(actual_text) and endpoint in url:
logging.warning(
f'Found {log.type}, but it was expected (log.type="{actual_text}", endpoint="{endpoint}")'
)
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/commands/identity/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fs;
use std::path::PathBuf;
use std::str::FromStr;

/// Creates a new identity from a PEM file.
/// Creates a new identity from a PEM file or seed phrase file.
#[derive(Parser)]
pub struct ImportOpts {
/// The identity to create.
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/lib/canister_info/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl CanisterInfoFactory for RustCanisterInfo {
};
let mut candidate_targets = package_info.targets.iter().filter(|x| {
x.crate_types.iter().any(|c| {
(c == "cdylib" && x.name == crate_name.replace('-', "_"))
(c == "cdylib" && x.name.replace('-', "_") == crate_name.replace('-', "_"))
|| (c == "bin" && x.name == crate_name)
})
});
Expand Down
Binary file modified src/distributed/ui.wasm
Binary file not shown.

0 comments on commit b3cd8dc

Please sign in to comment.