@hazae41/bobine 0.1.5 → 0.1.6

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.
@@ -1,11 +1,10 @@
1
1
  import { Nullable } from "../../../libs/nullable/mod.ts";
2
- import { type Packable } from "@hazae41/webpack";
3
2
  import { Database } from "@tursodatabase/database";
4
- export interface Run {
3
+ export interface Proof {
5
4
  readonly module: string;
6
5
  readonly method: string;
7
- readonly params: Packable[];
8
- readonly result: Packable;
6
+ readonly params: unknown[];
7
+ readonly result: unknown;
9
8
  readonly sparks: bigint;
10
9
  readonly reads: [string, Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>][];
11
10
  readonly writes: [string, Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>][];
@@ -19,6 +18,6 @@ export declare class Runner {
19
18
  private constructor();
20
19
  static setup(uuid: string, path: string): Promise<Runner>;
21
20
  create(code: Uint8Array<ArrayBuffer>, salt: Uint8Array<ArrayBuffer>): Promise<string>;
22
- execute(module: string, method: string, params: Packable[], target?: Nullable<bigint>): Promise<Run>;
23
- simulate(module: string, method: string, params: Packable[], target?: Nullable<bigint>): Promise<Run>;
21
+ execute(module: string, method: string, params: unknown[], target?: Nullable<bigint>): Promise<Proof>;
22
+ simulate(module: string, method: string, params: unknown[], target?: Nullable<bigint>): Promise<Proof>;
24
23
  }
@@ -4,5 +4,5 @@ export declare class RpcWorkerServer {
4
4
  #private;
5
5
  readonly runner: Runner;
6
6
  constructor(runner: Runner);
7
- respond(request: RpcRequestInit): Promise<RpcErr | RpcOk<string | import("../runner/mod.ts").Run>>;
7
+ respond(request: RpcRequestInit): Promise<RpcErr | RpcOk<string | import("../runner/mod.ts").Proof>>;
8
8
  }
@@ -22,18 +22,18 @@ export class RpcWorkerServer {
22
22
  }
23
23
  if (request.method === "create") {
24
24
  const [code, salt] = request.params;
25
- const pack = await this.runner.create(code, salt);
26
- return pack;
25
+ const digest = await this.runner.create(code, salt);
26
+ return digest;
27
27
  }
28
28
  if (request.method === "execute") {
29
29
  const [module, method, params, target] = request.params;
30
- const proof = await this.runner.execute(module, method, params, target);
31
- return proof;
30
+ const result = await this.runner.execute(module, method, params, target);
31
+ return result;
32
32
  }
33
33
  if (request.method === "simulate") {
34
34
  const [module, method, params, target] = request.params;
35
- const proof = await this.runner.simulate(module, method, params, target);
36
- return proof;
35
+ const result = await this.runner.simulate(module, method, params, target);
36
+ return result;
37
37
  }
38
38
  throw new RpcMethodNotFoundError();
39
39
  }
@@ -1,5 +1,5 @@
1
1
  import { Nullable } from "../../../libs/nullable/mod.ts";
2
- import { Run } from "../runner/mod.ts";
2
+ import { Proof } from "../runner/mod.ts";
3
3
  export declare class RpcWorkerClient {
4
4
  #private;
5
5
  readonly worker: Worker;
@@ -7,6 +7,6 @@ export declare class RpcWorkerClient {
7
7
  static spawn(uuid: string, path: string): Promise<RpcWorkerClient>;
8
8
  setup(): Promise<Uint8Array<ArrayBuffer>>;
9
9
  create(code: Uint8Array<ArrayBuffer>, salt: Uint8Array<ArrayBuffer>): Promise<string>;
10
- execute(module: string, method: string, params: Uint8Array<ArrayBuffer>, target?: Nullable<bigint>): Promise<Run>;
11
- simulate(module: string, method: string, params: Uint8Array<ArrayBuffer>, target?: Nullable<bigint>): Promise<Run>;
10
+ execute(module: string, method: string, params: Uint8Array<ArrayBuffer>, target?: Nullable<bigint>): Promise<Proof>;
11
+ simulate(module: string, method: string, params: Uint8Array<ArrayBuffer>, target?: Nullable<bigint>): Promise<Proof>;
12
12
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@hazae41/bobine",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "description": "WebAssembly-based metered chain of compute",
6
6
  "repository": "github:hazae41/bobine",
7
7
  "author": "hazae41",
@@ -23,7 +23,7 @@
23
23
  "@hazae41/binary": "^2.1.1",
24
24
  "@hazae41/jsonrpc": "^1.2.1",
25
25
  "@hazae41/wasm": "^1.0.2",
26
- "@hazae41/webpack": "^1.0.0",
26
+ "@hazae41/webpack": "^1.0.1",
27
27
  "@tursodatabase/database": "^0.8.4"
28
28
  },
29
29
  "devDependencies": {