@holochain/client 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/fake-hash.d.ts +9 -1
- package/lib/utils/fake-hash.js +11 -0
- package/package.json +1 -1
package/lib/utils/fake-hash.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionHash, AgentPubKey, EntryHash } from "../types.js";
|
|
1
|
+
import { DnaHash, ActionHash, AgentPubKey, EntryHash } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Generate a valid hash of a non-existing entry.
|
|
4
4
|
*
|
|
@@ -25,3 +25,11 @@ export declare function fakeAgentPubKey(): Promise<AgentPubKey>;
|
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
27
|
export declare function fakeActionHash(): Promise<ActionHash>;
|
|
28
|
+
/**
|
|
29
|
+
* Generate a valid hash of a non-existing DNA.
|
|
30
|
+
*
|
|
31
|
+
* @returns A {@link DnaHash}.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare function fakeDnaHash(): Promise<DnaHash>;
|
package/lib/utils/fake-hash.js
CHANGED
|
@@ -34,3 +34,14 @@ export async function fakeActionHash() {
|
|
|
34
34
|
const randomBytes = await randomByteArray(36);
|
|
35
35
|
return new Uint8Array([0x84, 0x29, 0x24, ...randomBytes]);
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Generate a valid hash of a non-existing DNA.
|
|
39
|
+
*
|
|
40
|
+
* @returns A {@link DnaHash}.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export async function fakeDnaHash() {
|
|
45
|
+
const randomBytes = await randomByteArray(36);
|
|
46
|
+
return new Uint8Array([0x84, 0x2d, 0x24, ...randomBytes]);
|
|
47
|
+
}
|
package/package.json
CHANGED