@proto-kit/module 0.1.1-develop.261 → 0.1.1-develop.263

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,7 @@
1
1
  import type { Runtime, RuntimeModulesRecord } from "./Runtime";
2
2
  /**
3
- * How do we encode MethodIds
4
- * A MethodId is defined as the following in little-endian
5
- * [0
6
- * ...hash(stringToField(moduleName))[0..128],
7
- * ...hash(stringToField(methodName))[0..128]
8
- * ]
3
+ * Please see `getMethodId` to learn more about
4
+ * methodId encoding
9
5
  */
10
6
  export declare class MethodIdResolver {
11
7
  private readonly runtime;
@@ -1 +1 @@
1
- {"version":3,"file":"MethodIdResolver.d.ts","sourceRoot":"","sources":["../../src/runtime/MethodIdResolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAM/D;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAEpB;gBAGY,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtC,OAAO,EAAE,oBAAoB;IAkBzC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAcnE,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAQnE"}
1
+ {"version":3,"file":"MethodIdResolver.d.ts","sourceRoot":"","sources":["../../src/runtime/MethodIdResolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAE/D;;;GAGG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAEpB;gBAGY,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtC,OAAO,EAAE,oBAAoB;IAkBzC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAcnE,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAQnE"}
@@ -1,15 +1,8 @@
1
1
  import { stringToField } from "@proto-kit/protocol";
2
2
  import { Poseidon } from "snarkyjs";
3
- const offset = 128n;
4
- // eslint-disable-next-line @typescript-eslint/no-magic-numbers
5
- const modulus = 2n ** (offset - 1n);
6
3
  /**
7
- * How do we encode MethodIds
8
- * A MethodId is defined as the following in little-endian
9
- * [0
10
- * ...hash(stringToField(moduleName))[0..128],
11
- * ...hash(stringToField(methodName))[0..128]
12
- * ]
4
+ * Please see `getMethodId` to learn more about
5
+ * methodId encoding
13
6
  */
14
7
  export class MethodIdResolver {
15
8
  constructor(runtime, modules) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@proto-kit/module",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.1.1-develop.261+8731dfa",
5
+ "version": "0.1.1-develop.263+f167699",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "tsc -p tsconfig.json",
@@ -31,5 +31,5 @@
31
31
  "snarkyjs": "0.12.0",
32
32
  "tsyringe": "^4.7.0"
33
33
  },
34
- "gitHead": "8731dfa8f5df502eadf6266a7216617737985146"
34
+ "gitHead": "f167699bddb5831155c4aa9587b4da032c30db0d"
35
35
  }
@@ -4,12 +4,8 @@ import { Poseidon } from "snarkyjs";
4
4
  import type { Runtime, RuntimeModulesRecord } from "./Runtime";
5
5
 
6
6
  /**
7
- * How do we encode MethodIds
8
- * A MethodId is defined as the following in little-endian
9
- * [0
10
- * ...hash(stringToField(moduleName))[0..128],
11
- * ...hash(stringToField(methodName))[0..128]
12
- * ]
7
+ * Please see `getMethodId` to learn more about
8
+ * methodId encoding
13
9
  */
14
10
  export class MethodIdResolver {
15
11
  private readonly dictionary: {