Skip to content

Commit

Permalink
build: upgrade to holochain 0.4.0 dev.27 (#274)
Browse files Browse the repository at this point in the history
* fix: clone cell id type

* fix: clone cell ids in tests

* build(nix): update to holochain v0.4.0-dev.27

* fix tests

* feat: add util function to compare cell ids

* fix test

* style: prettier
  • Loading branch information
jost-s authored Sep 27, 2024
1 parent 7d9fae2 commit 21aeeba
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 76 deletions.
66 changes: 30 additions & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/api/admin/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ export interface DeleteCloneCellRequest {
/**
* The clone id or cell id of the clone cell
*/
clone_cell_id: RoleName | CellId;
clone_cell_id: RoleName | DnaHash;
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/api/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export interface DisableCloneCellRequest {
/**
* The clone id or cell id of the clone cell
*/
clone_cell_id: RoleName | CellId;
clone_cell_id: RoleName | DnaHash;
}
/**
* @public
Expand Down Expand Up @@ -249,22 +249,22 @@ export const SignalType = {
*/
export type RawSignal =
| {
[SignalType.App]: EncodedAppSignal;
}
[SignalType.App]: EncodedAppSignal;
}
| {
[SignalType.System]: SystemSignal;
};
[SignalType.System]: SystemSignal;
};

/**
* @public
*/
export type Signal =
| {
[SignalType.App]: AppSignal;
}
[SignalType.App]: AppSignal;
}
| {
[SignalType.System]: SystemSignal;
};
[SignalType.System]: SystemSignal;
};

/**
* @public
Expand Down
10 changes: 10 additions & 0 deletions src/utils/cell.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CellId } from "../types.js";
import { encodeHashToBase64 } from "./base64.js";

export const isSameCell = (cellId1: CellId, cellId2: CellId) => {
const dnaHashB64_1 = encodeHashToBase64(cellId1[0]);
const agentPubKeyB64_1 = encodeHashToBase64(cellId1[1]);
const dnaHashB64_2 = encodeHashToBase64(cellId2[0]);
const agentPubKeyB64_2 = encodeHashToBase64(cellId2[1]);
return dnaHashB64_1 === dnaHashB64_2 && agentPubKeyB64_1 === agentPubKeyB64_2;
};
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./base64.js";
export * from "./fake-hash.js";
export * from "./hash-parts.js";
export * from "./cell.js";
8 changes: 4 additions & 4 deletions test/e2e/app-websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ test(
await admin.enableApp({ installed_app_id: app_id1 });

let received1 = false;
const signalCb1: AppSignal = () => {
const signalCb1: SignalCb = () => {
received1 = true;
};

Expand All @@ -164,7 +164,7 @@ test(
await admin.enableApp({ installed_app_id: app_id2 });

let received2 = false;
const signalCb2: AppSignal = () => {
const signalCb2: SignalCb = () => {
received2 = true;
};

Expand Down Expand Up @@ -261,7 +261,7 @@ test(
await admin.authorizeSigningCredentials(cloneCell.cell_id);

await appWs.disableCloneCell({
clone_cell_id: cloneCell.cell_id,
clone_cell_id: cloneCell.cell_id[0],
});

const appInfo = await appWs.appInfo();
Expand All @@ -284,7 +284,7 @@ test(
}

await appWs.enableCloneCell({
clone_cell_id: cloneCell.cell_id,
clone_cell_id: cloneCell.cell_id[0],
});
await appWs.callZome(params);
t.pass("re-enabled clone can be called");
Expand Down
9 changes: 8 additions & 1 deletion test/e2e/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ const LAIR_PASSPHRASE = "passphrase";

export const launch = async (port: number) => {
// create sandbox conductor
const args = ["sandbox", "--piped", "create", "--in-process-lair"];
const args = [
"sandbox",
"--piped",
"create",
"--in-process-lair",
"--dpki-network-seed",
Date.now().toString(),
];
const createConductorProcess = spawn("hc", args);
createConductorProcess.stdin.write(LAIR_PASSPHRASE);
createConductorProcess.stdin.end();
Expand Down
Loading

0 comments on commit 21aeeba

Please sign in to comment.