@proto-kit/protocol 0.1.1-develop.263 → 0.1.1-develop.298
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/dist/blockmodules/AccountStateModule.d.ts +5 -5
- package/dist/blockmodules/AccountStateModule.d.ts.map +1 -1
- package/dist/blockmodules/AccountStateModule.js +1 -1
- package/dist/blockmodules/NoopTransactionHook.d.ts +1 -1
- package/dist/blockmodules/NoopTransactionHook.d.ts.map +1 -1
- package/dist/model/MethodPublicOutput.d.ts +27 -27
- package/dist/model/MethodPublicOutput.js +1 -1
- package/dist/model/Option.d.ts +19 -19
- package/dist/model/Option.d.ts.map +1 -1
- package/dist/model/Option.js +1 -1
- package/dist/model/Path.d.ts +2 -2
- package/dist/model/Path.d.ts.map +1 -1
- package/dist/model/Path.js +1 -1
- package/dist/model/StateTransition.d.ts +12 -12
- package/dist/model/StateTransition.d.ts.map +1 -1
- package/dist/model/StateTransition.js +1 -1
- package/dist/model/StateTransitionProvableBatch.d.ts +13 -13
- package/dist/model/StateTransitionProvableBatch.d.ts.map +1 -1
- package/dist/model/StateTransitionProvableBatch.js +1 -1
- package/dist/model/network/NetworkState.d.ts +7 -7
- package/dist/model/network/NetworkState.d.ts.map +1 -1
- package/dist/model/network/NetworkState.js +1 -1
- package/dist/model/transaction/ProtocolTransaction.d.ts +16 -16
- package/dist/model/transaction/ProtocolTransaction.d.ts.map +1 -1
- package/dist/model/transaction/ProtocolTransaction.js +1 -1
- package/dist/model/transaction/RuntimeTransaction.d.ts +16 -16
- package/dist/model/transaction/RuntimeTransaction.d.ts.map +1 -1
- package/dist/model/transaction/RuntimeTransaction.js +1 -1
- package/dist/protocol/Protocol.d.ts +17 -10
- package/dist/protocol/Protocol.d.ts.map +1 -1
- package/dist/protocol/Protocol.js +30 -32
- package/dist/protocol/ProtocolEnvironment.d.ts +9 -0
- package/dist/protocol/ProtocolEnvironment.d.ts.map +1 -0
- package/dist/protocol/ProtocolEnvironment.js +1 -0
- package/dist/protocol/ProtocolModule.d.ts +5 -5
- package/dist/protocol/ProtocolModule.d.ts.map +1 -1
- package/dist/protocol/ProtocolModule.js +7 -5
- package/dist/protocol/ProvableTransactionHook.d.ts +1 -1
- package/dist/protocol/ProvableTransactionHook.d.ts.map +1 -1
- package/dist/protocol/TransitioningProtocolModule.d.ts +1 -1
- package/dist/protocol/TransitioningProtocolModule.d.ts.map +1 -1
- package/dist/prover/block/BlockProvable.d.ts +40 -40
- package/dist/prover/block/BlockProvable.d.ts.map +1 -1
- package/dist/prover/block/BlockProvable.js +1 -1
- package/dist/prover/block/BlockProver.d.ts +4 -4
- package/dist/prover/block/BlockProver.d.ts.map +1 -1
- package/dist/prover/block/BlockProver.js +1 -1
- package/dist/prover/statetransition/StateTransitionProvable.d.ts +55 -55
- package/dist/prover/statetransition/StateTransitionProvable.d.ts.map +1 -1
- package/dist/prover/statetransition/StateTransitionProvable.js +1 -1
- package/dist/prover/statetransition/StateTransitionProver.d.ts +2 -2
- package/dist/prover/statetransition/StateTransitionProver.d.ts.map +1 -1
- package/dist/prover/statetransition/StateTransitionProver.js +1 -6
- package/dist/prover/statetransition/StateTransitionWitnessProvider.d.ts +1 -1
- package/dist/prover/statetransition/StateTransitionWitnessProvider.d.ts.map +1 -1
- package/dist/state/State.d.ts +1 -1
- package/dist/state/State.d.ts.map +1 -1
- package/dist/state/State.js +1 -1
- package/dist/state/StateMap.d.ts +1 -1
- package/dist/state/StateMap.d.ts.map +1 -1
- package/dist/state/StateService.d.ts +1 -1
- package/dist/state/StateService.d.ts.map +1 -1
- package/dist/state/StateServiceProvider.d.ts +4 -4
- package/dist/state/StateServiceProvider.d.ts.map +1 -1
- package/dist/state/StateServiceProvider.js +19 -11
- package/dist/state/assert/assert.d.ts +1 -1
- package/dist/state/assert/assert.d.ts.map +1 -1
- package/dist/state/assert/assert.js +3 -1
- package/dist/state/context/RuntimeMethodExecutionContext.d.ts +2 -1
- package/dist/state/context/RuntimeMethodExecutionContext.d.ts.map +1 -1
- package/dist/state/context/RuntimeMethodExecutionContext.js +3 -2
- package/dist/state/protocol/ProtocolState.d.ts +1 -1
- package/dist/state/protocol/ProtocolState.d.ts.map +1 -1
- package/dist/utils/PrefixedProvableHashList.d.ts +1 -1
- package/dist/utils/PrefixedProvableHashList.d.ts.map +1 -1
- package/dist/utils/PrefixedProvableHashList.js +1 -1
- package/dist/utils/ProvableHashList.d.ts +2 -2
- package/dist/utils/ProvableHashList.d.ts.map +1 -1
- package/dist/utils/ProvableHashList.js +1 -1
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.d.ts +1 -15
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.d.ts.map +1 -1
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.js +0 -71
- package/dist/utils/merkletree/MerkleTreeStore.d.ts +2 -2
- package/dist/utils/merkletree/MerkleTreeStore.d.ts.map +1 -1
- package/dist/utils/merkletree/RollupMerkleTree.d.ts +17 -16
- package/dist/utils/merkletree/RollupMerkleTree.d.ts.map +1 -1
- package/dist/utils/merkletree/RollupMerkleTree.js +7 -1
- package/dist/utils/utils.d.ts +2 -3
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +2 -3
- package/package.json +3 -3
- package/src/blockmodules/AccountStateModule.ts +2 -2
- package/src/blockmodules/NoopTransactionHook.ts +1 -1
- package/src/model/MethodPublicOutput.ts +1 -1
- package/src/model/Option.test.ts +1 -1
- package/src/model/Option.ts +1 -1
- package/src/model/Path.ts +1 -1
- package/src/model/StateTransition.ts +1 -1
- package/src/model/StateTransitionProvableBatch.ts +1 -1
- package/src/model/Transaction.ts +1 -1
- package/src/model/network/NetworkState.ts +1 -1
- package/src/model/transaction/ProtocolTransaction.ts +1 -1
- package/src/model/transaction/RuntimeTransaction.ts +1 -1
- package/src/protocol/Protocol.ts +72 -63
- package/src/protocol/ProtocolEnvironment.ts +9 -0
- package/src/protocol/ProtocolModule.ts +14 -11
- package/src/protocol/ProvableTransactionHook.ts +1 -1
- package/src/protocol/TransitioningProtocolModule.ts +3 -1
- package/src/prover/block/BlockProvable.ts +1 -1
- package/src/prover/block/BlockProver.ts +4 -4
- package/src/prover/statetransition/StateTransitionProvable.ts +1 -1
- package/src/prover/statetransition/StateTransitionProver.ts +2 -8
- package/src/prover/statetransition/StateTransitionWitnessProvider.ts +1 -1
- package/src/state/State.ts +1 -1
- package/src/state/StateMap.ts +1 -1
- package/src/state/StateService.ts +2 -2
- package/src/state/StateServiceProvider.ts +21 -12
- package/src/state/assert/assert.test.ts +1 -1
- package/src/state/assert/assert.ts +4 -2
- package/src/state/context/RuntimeMethodExecutionContext.ts +6 -2
- package/src/state/protocol/ProtocolState.ts +3 -1
- package/src/utils/PrefixedProvableHashList.ts +1 -1
- package/src/utils/ProvableHashList.ts +1 -1
- package/src/utils/merkletree/InMemoryMerkleTreeStorage.ts +1 -97
- package/src/utils/merkletree/MerkleTreeStore.ts +2 -2
- package/src/utils/merkletree/RollupMerkleTree.ts +10 -1
- package/src/utils/utils.ts +2 -4
- package/test/BlockProver.test.ts +9 -12
- package/test/State.test.ts +1 -1
- package/test/StateTransition.test.ts +4 -2
- package/test/utils/MerkleTree.test.ts +1 -1
- package/test/utils.test.ts +1 -1
|
@@ -1,37 +1,46 @@
|
|
|
1
1
|
import { inject, injectable } from "tsyringe";
|
|
2
2
|
|
|
3
3
|
import { StateService } from "./StateService";
|
|
4
|
+
import { log } from "@proto-kit/common";
|
|
4
5
|
|
|
5
6
|
const errors = {
|
|
6
7
|
stateServiceNotSet: () =>
|
|
7
8
|
new Error(
|
|
8
|
-
|
|
9
|
-
protocol function by creating them with an AppChain or by setting the
|
|
10
|
-
stateService manually.`
|
|
9
|
+
"StateService has not been set yet. Be sure to either call your runtime or protocol function by creating them with an AppChain or by setting the stateService manually."
|
|
11
10
|
),
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
@injectable()
|
|
15
14
|
export class StateServiceProvider {
|
|
16
|
-
private readonly
|
|
17
|
-
this.currentStateService;
|
|
15
|
+
private readonly stateServiceStack: StateService[] = [];
|
|
18
16
|
|
|
19
17
|
public constructor(
|
|
20
|
-
@inject("StateService") private
|
|
21
|
-
) {
|
|
18
|
+
@inject("StateService") private readonly baseStateService?: StateService
|
|
19
|
+
) {
|
|
20
|
+
if (baseStateService !== undefined) {
|
|
21
|
+
this.stateServiceStack.push(baseStateService);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
public get stateService(): StateService {
|
|
24
|
-
if (this.
|
|
26
|
+
if (this.stateServiceStack.length === 0) {
|
|
25
27
|
throw errors.stateServiceNotSet();
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
|
|
30
|
+
// Assertion here is ok, because we check that the array is not empty above
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
|
+
return this.stateServiceStack.at(-1)!;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
public setCurrentStateService(service: StateService) {
|
|
31
|
-
this.
|
|
36
|
+
this.stateServiceStack.push(service);
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
public
|
|
35
|
-
this.
|
|
39
|
+
public popCurrentStateService() {
|
|
40
|
+
if (this.stateServiceStack.length === 1) {
|
|
41
|
+
log.trace("Trying to pop last available (root) stateservice");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.stateServiceStack.pop();
|
|
36
45
|
}
|
|
37
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bool } from "
|
|
1
|
+
import { Bool } from "o1js";
|
|
2
2
|
import { container } from "tsyringe";
|
|
3
3
|
import { log } from "@proto-kit/common";
|
|
4
4
|
|
|
@@ -19,7 +19,9 @@ export function assert(condition: Bool, message?: string) {
|
|
|
19
19
|
const status = condition.and(previousStatus);
|
|
20
20
|
|
|
21
21
|
if (!condition.toBoolean()) {
|
|
22
|
-
|
|
22
|
+
if (!executionContext.current().isSimulated) {
|
|
23
|
+
log.debug("Assertion failed: ", message);
|
|
24
|
+
}
|
|
23
25
|
executionContext.setStatusMessage(message);
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Bool } from "
|
|
1
|
+
import { Bool } from "o1js";
|
|
2
2
|
import { singleton } from "tsyringe";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ProvableMethodExecutionContext,
|
|
5
|
+
ProvableMethodExecutionResult,
|
|
6
|
+
} from "@proto-kit/common";
|
|
4
7
|
import { StateTransition } from "../../model/StateTransition";
|
|
5
8
|
import { RuntimeTransaction } from "../../model/transaction/RuntimeTransaction";
|
|
6
9
|
import { NetworkState } from "../../model/network/NetworkState";
|
|
@@ -119,6 +122,7 @@ export class RuntimeMethodExecutionContext extends ProvableMethodExecutionContex
|
|
|
119
122
|
isFinished: this.isFinished,
|
|
120
123
|
result: this.result,
|
|
121
124
|
input: this.lastInput,
|
|
125
|
+
isSimulated: this.isSimulated,
|
|
122
126
|
};
|
|
123
127
|
}
|
|
124
128
|
}
|
|
@@ -21,7 +21,9 @@ const errors = {
|
|
|
21
21
|
* underlying values to improve developer experience.
|
|
22
22
|
*/
|
|
23
23
|
export function protocolState() {
|
|
24
|
-
return <
|
|
24
|
+
return <
|
|
25
|
+
TargetTransitioningModule extends TransitioningProtocolModule<unknown>
|
|
26
|
+
>(
|
|
25
27
|
target: TargetTransitioningModule,
|
|
26
28
|
propertyKey: string
|
|
27
29
|
) => {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { log } from "@proto-kit/common";
|
|
3
|
-
|
|
4
|
-
import { RollupMerkleTree } from "./RollupMerkleTree.js";
|
|
5
|
-
import { AsyncMerkleTreeStore, MerkleTreeStore } from "./MerkleTreeStore";
|
|
1
|
+
import { MerkleTreeStore } from "./MerkleTreeStore";
|
|
6
2
|
|
|
7
3
|
export class InMemoryMerkleTreeStorage implements MerkleTreeStore {
|
|
8
4
|
protected readonly nodes: {
|
|
@@ -19,95 +15,3 @@ export class InMemoryMerkleTreeStorage implements MerkleTreeStore {
|
|
|
19
15
|
(this.nodes[level] ??= {})[key.toString()] = value;
|
|
20
16
|
}
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
export class CachedMerkleTreeStore extends InMemoryMerkleTreeStorage {
|
|
24
|
-
private writeCache: {
|
|
25
|
-
[key: number]: {
|
|
26
|
-
[key: string]: bigint;
|
|
27
|
-
};
|
|
28
|
-
} = {};
|
|
29
|
-
|
|
30
|
-
public constructor(private readonly parent: AsyncMerkleTreeStore) {
|
|
31
|
-
super();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public setNode(key: bigint, level: number, value: bigint) {
|
|
35
|
-
super.setNode(key, level, value);
|
|
36
|
-
(this.writeCache[level] ??= {})[key.toString()] = value;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public getWrittenNodes(): {
|
|
40
|
-
[key: number]: {
|
|
41
|
-
[key: string]: bigint;
|
|
42
|
-
};
|
|
43
|
-
} {
|
|
44
|
-
return this.writeCache;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public resetWrittenNodes() {
|
|
48
|
-
this.writeCache = {};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
52
|
-
public async preloadKey(index: bigint): Promise<void> {
|
|
53
|
-
// Algo from RollupMerkleTree.getWitness()
|
|
54
|
-
const { leafCount, height } = RollupMerkleTree;
|
|
55
|
-
|
|
56
|
-
if (index >= leafCount) {
|
|
57
|
-
index %= leafCount;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// eslint-disable-next-line no-warning-comments,max-len
|
|
61
|
-
// TODO Not practical at the moment. Improve pattern when implementing DB storage
|
|
62
|
-
for (let level = 0; level < height; level++) {
|
|
63
|
-
const key = index;
|
|
64
|
-
|
|
65
|
-
const isLeft = index % 2n === 0n;
|
|
66
|
-
const siblingKey = isLeft ? index + 1n : index - 1n;
|
|
67
|
-
|
|
68
|
-
// Only preload node if it is not already preloaded.
|
|
69
|
-
// We also don't want to overwrite because changes will get lost (tracing)
|
|
70
|
-
if (this.getNode(key, level) === undefined) {
|
|
71
|
-
// eslint-disable-next-line no-await-in-loop
|
|
72
|
-
const value = await this.parent.getNode(key, level);
|
|
73
|
-
if (level === 0) {
|
|
74
|
-
log.debug(`Preloaded ${key} @ ${level} -> ${value ?? "-"}`);
|
|
75
|
-
}
|
|
76
|
-
if (value !== undefined) {
|
|
77
|
-
this.setNode(key, level, value);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (this.getNode(siblingKey, level) === undefined) {
|
|
82
|
-
// eslint-disable-next-line no-await-in-loop
|
|
83
|
-
const sibling = await this.parent.getNode(siblingKey, level);
|
|
84
|
-
if (sibling !== undefined) {
|
|
85
|
-
this.setNode(siblingKey, level, sibling);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
index /= 2n;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public async mergeIntoParent(): Promise<void> {
|
|
93
|
-
// In case no state got set we can skip this step
|
|
94
|
-
if (Object.keys(this.writeCache).length === 0) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
this.parent.openTransaction();
|
|
99
|
-
const { height } = RollupMerkleTree;
|
|
100
|
-
const nodes = this.getWrittenNodes();
|
|
101
|
-
|
|
102
|
-
const promises = Array.from({ length: height }).flatMap((ignored, level) =>
|
|
103
|
-
Object.entries(nodes[level]).map(async (entry) => {
|
|
104
|
-
await this.parent.setNode(BigInt(entry[0]), level, entry[1]);
|
|
105
|
-
})
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
await Promise.all(promises);
|
|
109
|
-
|
|
110
|
-
this.parent.commit();
|
|
111
|
-
this.resetWrittenNodes();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -3,9 +3,9 @@ export interface AsyncMerkleTreeStore {
|
|
|
3
3
|
|
|
4
4
|
commit: () => void;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
setNodeAsync: (key: bigint, level: number, value: bigint) => Promise<void>;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
getNodeAsync: (key: bigint, level: number) => Promise<bigint | undefined>;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface MerkleTreeStore {
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/* eslint-disable line-comment-position */
|
|
3
3
|
/* eslint-disable no-inline-comments */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
5
|
-
import { Bool, Field, Poseidon, Provable, Struct } from "
|
|
5
|
+
import { Bool, Field, Poseidon, Provable, Struct } from "o1js";
|
|
6
|
+
import { range } from "@proto-kit/common";
|
|
6
7
|
|
|
7
8
|
import { notInCircuit } from "../utils";
|
|
8
9
|
|
|
@@ -69,6 +70,14 @@ class RollupMerkleWitness extends Struct({
|
|
|
69
70
|
|
|
70
71
|
return index;
|
|
71
72
|
}
|
|
73
|
+
|
|
74
|
+
public toShortenedEntries() {
|
|
75
|
+
return range(0, 5)
|
|
76
|
+
.concat(range(251, 255))
|
|
77
|
+
.map((index) =>
|
|
78
|
+
[this.path[index].toString(), this.isLeft[index].toString()].toString()
|
|
79
|
+
);
|
|
80
|
+
}
|
|
72
81
|
}
|
|
73
82
|
|
|
74
83
|
/**
|
package/src/utils/utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line max-len
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/ban-types, @typescript-eslint/no-unsafe-return
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/ban-types, @typescript-eslint/no-unsafe-return */
|
|
3
3
|
|
|
4
|
-
import { Field, Poseidon, Provable } from "
|
|
4
|
+
import { Field, Poseidon, Provable } from "o1js";
|
|
5
5
|
import floor from "lodash/floor";
|
|
6
6
|
|
|
7
7
|
export type ReturnType<FunctionType extends Function> = FunctionType extends (
|
|
@@ -82,5 +82,3 @@ export function singleFieldToString(value: Field | bigint): string {
|
|
|
82
82
|
}
|
|
83
83
|
return value.toString();
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
export function noop(): void {}
|
package/test/BlockProver.test.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import {
|
|
3
|
-
Bool,
|
|
4
|
-
Experimental,
|
|
5
|
-
Field,
|
|
6
|
-
PrivateKey,
|
|
7
|
-
Proof,
|
|
8
|
-
UInt64,
|
|
9
|
-
} from "snarkyjs";
|
|
2
|
+
import { Bool, Experimental, Field, PrivateKey, Proof, UInt64 } from "o1js";
|
|
10
3
|
|
|
11
4
|
import {
|
|
12
5
|
BlockProver,
|
|
@@ -29,12 +22,16 @@ import { UnsignedTransaction } from "@proto-kit/sequencer";
|
|
|
29
22
|
import { AccountStateModule } from "../src/blockmodules/AccountStateModule";
|
|
30
23
|
import { container } from "tsyringe";
|
|
31
24
|
import {
|
|
32
|
-
BlockModule,
|
|
25
|
+
BlockModule,
|
|
26
|
+
DefaultProvableHashList,
|
|
33
27
|
MethodPublicOutput,
|
|
34
28
|
NetworkState,
|
|
35
|
-
Protocol,
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
Protocol,
|
|
30
|
+
ProtocolMethodExecutionContext,
|
|
31
|
+
ProtocolTransaction,
|
|
32
|
+
ProvableStateTransition,
|
|
33
|
+
RuntimeTransaction,
|
|
34
|
+
StateTransitionProver,
|
|
38
35
|
} from "../src";
|
|
39
36
|
|
|
40
37
|
type BlockProverProofPair = [
|
package/test/State.test.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { Bool, Field } from "
|
|
2
|
+
import { Bool, Field } from "o1js";
|
|
3
3
|
import { container } from "tsyringe";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
Option,
|
|
7
7
|
ProvableStateTransition,
|
|
8
8
|
DefaultProvableHashList,
|
|
9
|
-
StateTransitionProvableBatch,
|
|
9
|
+
StateTransitionProvableBatch,
|
|
10
|
+
CachedMerkleTreeStore,
|
|
11
|
+
InMemoryMerkleTreeStorage,
|
|
10
12
|
} from "../src/index";
|
|
11
13
|
import {
|
|
12
14
|
RollupMerkleTree,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MockAsyncMerkleTreeStore } from "@proto-kit/module/test/state/MockAsyncMerkleStore";
|
|
2
|
-
import { Field, Provable } from "
|
|
2
|
+
import { Field, Provable } from "o1js";
|
|
3
3
|
|
|
4
4
|
import { CachedMerkleTreeStore, RollupMerkleTree } from "../../src";
|
|
5
5
|
import { log } from "@proto-kit/common";
|
package/test/utils.test.ts
CHANGED