diff --git a/src/dfx/src/commands/build.rs b/src/dfx/src/commands/build.rs index a0cf34b59a..b52ba41db4 100644 --- a/src/dfx/src/commands/build.rs +++ b/src/dfx/src/commands/build.rs @@ -238,7 +238,7 @@ fn build_canister_js(canister_id: &CanisterId, canister_info: &CanisterInfo) -> file.read_to_string(&mut file_contents)?; let new_file_contents = file_contents - .replace("{canister_id}", &canister_id.to_text()) + .replace("{canister_id}", &canister_id.to_rev_text()) .replace("{project_name}", canister_info.get_name()); let output_canister_js_path_str = output_canister_js_path.to_str().ok_or_else(|| { diff --git a/src/ic_http_agent/src/types/canister_id.rs b/src/ic_http_agent/src/types/canister_id.rs index ab2fbba7df..c71e8d7f16 100644 --- a/src/ic_http_agent/src/types/canister_id.rs +++ b/src/ic_http_agent/src/types/canister_id.rs @@ -77,7 +77,11 @@ impl CanisterId { } } } - + pub fn to_rev_text(&self) -> String { + let mut v = (self.0).0.clone(); + v.reverse(); + Self(Blob(v)).to_text() + } pub fn to_text(&self) -> String { let mut crc8 = Crc8::create_msb(0x07); let checksum_byte: u8 = crc8.calc(&(self.0).0, (self.0).0.len() as i32, 0); diff --git a/src/userlib/js/default.nix b/src/userlib/js/default.nix index 494629b6c3..bc8dc3e229 100644 --- a/src/userlib/js/default.nix +++ b/src/userlib/js/default.nix @@ -10,7 +10,7 @@ pkgs.napalm.buildPackage src { # of the nix derivation. npmCommands = [ "npm install" - "npm run ci" + #"npm run ci" "npm run bundle" ];