@aztec/stdlib 0.82.3 → 0.83.0
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/dest/avm/avm.d.ts +3889 -382
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +64 -18
- package/dest/avm/avm_proving_request.d.ts +1610 -66
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +9 -12
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +39 -11
- package/dest/config/config.d.ts +2 -2
- package/dest/config/config.d.ts.map +1 -1
- package/dest/config/config.js +4 -5
- package/dest/contract/interfaces/node-info.d.ts +2 -2
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +1 -1
- package/dest/interfaces/prover-client.d.ts +3 -3
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +6 -4
- package/dest/interfaces/proving-job.d.ts +1610 -66
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +7 -6
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +1 -1
- package/dest/keys/derivation.d.ts +1 -1
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +10 -2
- package/dest/logs/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/pending_tagged_log.d.ts +17 -0
- package/dest/logs/pending_tagged_log.d.ts.map +1 -0
- package/dest/logs/pending_tagged_log.js +45 -0
- package/dest/logs/{l1_payload/shared_secret_derivation.d.ts → shared_secret_derivation.d.ts} +4 -3
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -0
- package/dest/logs/{l1_payload/shared_secret_derivation.js → shared_secret_derivation.js} +3 -5
- package/dest/logs/tx_scoped_l2_log.d.ts +6 -1
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +12 -4
- package/dest/note/note.d.ts +45 -4
- package/dest/note/note.d.ts.map +1 -1
- package/dest/note/note.js +51 -4
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +33 -7
- package/dest/snapshots/download.js +1 -1
- package/dest/snapshots/types.d.ts +4 -4
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/snapshots/types.js +1 -1
- package/dest/snapshots/upload.d.ts +1 -1
- package/dest/snapshots/upload.d.ts.map +1 -1
- package/dest/snapshots/upload.js +1 -1
- package/dest/tests/factories.d.ts +10 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +42 -6
- package/dest/tests/mocks.d.ts +2 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +5 -1
- package/dest/trees/nullifier_leaf.d.ts +46 -21
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +48 -30
- package/dest/trees/nullifier_membership_witness.d.ts +28 -12
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/protocol_contract_leaf.d.ts +0 -1
- package/dest/trees/protocol_contract_leaf.d.ts.map +1 -1
- package/dest/trees/protocol_contract_leaf.js +0 -3
- package/dest/trees/public_data_leaf.d.ts +46 -25
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +35 -30
- package/dest/trees/public_data_witness.d.ts +36 -18
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +6 -6
- package/dest/versioning/versioning.d.ts +1 -1
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +6 -6
- package/package.json +6 -7
- package/src/avm/avm.ts +74 -20
- package/src/block/l2_block_downloader/l2_block_stream.ts +58 -29
- package/src/config/config.ts +6 -6
- package/src/contract/interfaces/node-info.ts +3 -3
- package/src/interfaces/prover-client.ts +9 -7
- package/src/interfaces/pxe.ts +14 -7
- package/src/keys/derivation.ts +12 -6
- package/src/logs/index.ts +2 -1
- package/src/logs/pending_tagged_log.ts +43 -0
- package/src/logs/{l1_payload/shared_secret_derivation.ts → shared_secret_derivation.ts} +4 -11
- package/src/logs/tx_scoped_l2_log.ts +13 -4
- package/src/note/note.ts +61 -5
- package/src/proofs/proof.ts +39 -5
- package/src/snapshots/download.ts +1 -1
- package/src/snapshots/types.ts +2 -2
- package/src/snapshots/upload.ts +5 -3
- package/src/tests/factories.ts +72 -8
- package/src/tests/mocks.ts +7 -0
- package/src/trees/nullifier_leaf.ts +49 -26
- package/src/trees/protocol_contract_leaf.ts +0 -4
- package/src/trees/public_data_leaf.ts +31 -29
- package/src/trees/public_data_witness.ts +6 -6
- package/src/versioning/versioning.ts +8 -14
- package/dest/event/event.d.ts +0 -24
- package/dest/event/event.d.ts.map +0 -1
- package/dest/event/event.js +0 -13
- package/dest/event/event_metadata.d.ts +0 -38
- package/dest/event/event_metadata.d.ts.map +0 -1
- package/dest/event/event_metadata.js +0 -45
- package/dest/event/index.d.ts +0 -4
- package/dest/event/index.d.ts.map +0 -1
- package/dest/event/index.js +0 -3
- package/dest/event/l1_event_payload.d.ts +0 -52
- package/dest/event/l1_event_payload.d.ts.map +0 -1
- package/dest/event/l1_event_payload.js +0 -64
- package/dest/logs/l1_payload/encrypted_log_payload.d.ts +0 -50
- package/dest/logs/l1_payload/encrypted_log_payload.d.ts.map +0 -1
- package/dest/logs/l1_payload/encrypted_log_payload.js +0 -140
- package/dest/logs/l1_payload/encryption_util.d.ts +0 -24
- package/dest/logs/l1_payload/encryption_util.d.ts.map +0 -1
- package/dest/logs/l1_payload/encryption_util.js +0 -46
- package/dest/logs/l1_payload/index.d.ts +0 -3
- package/dest/logs/l1_payload/index.d.ts.map +0 -1
- package/dest/logs/l1_payload/index.js +0 -2
- package/dest/logs/l1_payload/payload.d.ts +0 -60
- package/dest/logs/l1_payload/payload.d.ts.map +0 -1
- package/dest/logs/l1_payload/payload.js +0 -61
- package/dest/logs/l1_payload/shared_secret_derivation.d.ts.map +0 -1
- package/src/event/event.ts +0 -16
- package/src/event/event_metadata.ts +0 -56
- package/src/event/index.ts +0 -3
- package/src/event/l1_event_payload.ts +0 -87
- package/src/logs/l1_payload/encrypted_log_payload.ts +0 -202
- package/src/logs/l1_payload/encryption_util.ts +0 -54
- package/src/logs/l1_payload/index.ts +0 -2
- package/src/logs/l1_payload/payload.ts +0 -73
|
@@ -7,46 +7,49 @@ import { z } from 'zod';
|
|
|
7
7
|
* Class containing the data of a preimage of a single leaf in the nullifier tree.
|
|
8
8
|
* Note: It's called preimage because this data gets hashed before being inserted as a node into the `IndexedTree`.
|
|
9
9
|
*/ export class NullifierLeafPreimage {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
leaf;
|
|
11
|
+
nextKey;
|
|
12
12
|
nextIndex;
|
|
13
13
|
constructor(/**
|
|
14
14
|
* Leaf value inside the indexed tree's linked list.
|
|
15
|
-
*/
|
|
16
|
-
* Next
|
|
17
|
-
*/
|
|
15
|
+
*/ leaf, /**
|
|
16
|
+
* Next nullifier inside the indexed tree's linked list.
|
|
17
|
+
*/ nextKey, /**
|
|
18
18
|
* Index of the next leaf in the indexed tree's linked list.
|
|
19
19
|
*/ nextIndex){
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
20
|
+
this.leaf = leaf;
|
|
21
|
+
this.nextKey = nextKey;
|
|
22
22
|
this.nextIndex = nextIndex;
|
|
23
23
|
}
|
|
24
24
|
static get schema() {
|
|
25
25
|
return z.object({
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
leaf: NullifierLeaf.schema,
|
|
27
|
+
nextKey: schemas.Fr,
|
|
28
28
|
nextIndex: schemas.BigInt
|
|
29
|
-
}).transform(({
|
|
29
|
+
}).transform(({ leaf, nextKey, nextIndex })=>new NullifierLeafPreimage(leaf, nextKey, nextIndex));
|
|
30
|
+
}
|
|
31
|
+
static get leafSchema() {
|
|
32
|
+
return NullifierLeaf.schema;
|
|
30
33
|
}
|
|
31
34
|
getKey() {
|
|
32
|
-
return this.
|
|
35
|
+
return this.leaf.getKey();
|
|
33
36
|
}
|
|
34
37
|
getNextKey() {
|
|
35
|
-
return this.
|
|
38
|
+
return this.nextKey.toBigInt();
|
|
36
39
|
}
|
|
37
40
|
getNextIndex() {
|
|
38
41
|
return this.nextIndex;
|
|
39
42
|
}
|
|
40
43
|
asLeaf() {
|
|
41
|
-
return
|
|
44
|
+
return this.leaf;
|
|
42
45
|
}
|
|
43
46
|
toBuffer() {
|
|
44
47
|
return Buffer.concat(this.toHashInputs());
|
|
45
48
|
}
|
|
46
49
|
toHashInputs() {
|
|
47
50
|
return [
|
|
48
|
-
|
|
49
|
-
Buffer.from(this.
|
|
51
|
+
...this.leaf.toHashInputs(),
|
|
52
|
+
Buffer.from(this.nextKey.toBuffer()),
|
|
50
53
|
Buffer.from(toBufferBE(this.nextIndex, 32))
|
|
51
54
|
];
|
|
52
55
|
}
|
|
@@ -54,42 +57,56 @@ import { z } from 'zod';
|
|
|
54
57
|
return this.toHashInputs().map((buf)=>Fr.fromBuffer(buf));
|
|
55
58
|
}
|
|
56
59
|
clone() {
|
|
57
|
-
return new NullifierLeafPreimage(this.
|
|
60
|
+
return new NullifierLeafPreimage(this.leaf.clone(), this.nextKey, this.nextIndex);
|
|
58
61
|
}
|
|
59
62
|
static random() {
|
|
60
|
-
return new NullifierLeafPreimage(
|
|
63
|
+
return new NullifierLeafPreimage(NullifierLeaf.random(), Fr.random(), BigInt(Math.floor(Math.random() * 1000)));
|
|
61
64
|
}
|
|
62
65
|
static empty() {
|
|
63
|
-
return new NullifierLeafPreimage(
|
|
66
|
+
return new NullifierLeafPreimage(NullifierLeaf.empty(), Fr.zero(), 0n);
|
|
64
67
|
}
|
|
65
68
|
static fromBuffer(buffer) {
|
|
66
69
|
const reader = BufferReader.asReader(buffer);
|
|
67
|
-
return new NullifierLeafPreimage(
|
|
70
|
+
return new NullifierLeafPreimage(NullifierLeaf.fromBuffer(reader), reader.readObject(Fr), toBigIntBE(reader.readBytes(32)));
|
|
68
71
|
}
|
|
69
72
|
static fromLeaf(leaf, nextKey, nextIndex) {
|
|
70
|
-
return new NullifierLeafPreimage(leaf
|
|
73
|
+
return new NullifierLeafPreimage(leaf, new Fr(nextKey), nextIndex);
|
|
71
74
|
}
|
|
72
75
|
static clone(preimage) {
|
|
73
|
-
return
|
|
76
|
+
return preimage.clone();
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
77
80
|
* A nullifier to be inserted in the nullifier tree.
|
|
78
81
|
*/ export class NullifierLeaf {
|
|
79
|
-
|
|
82
|
+
nullifier;
|
|
80
83
|
constructor(/**
|
|
81
84
|
* Nullifier value.
|
|
82
|
-
*/
|
|
83
|
-
this.
|
|
85
|
+
*/ nullifier){
|
|
86
|
+
this.nullifier = nullifier;
|
|
84
87
|
}
|
|
85
88
|
getKey() {
|
|
86
|
-
return this.
|
|
89
|
+
return this.nullifier.toBigInt();
|
|
87
90
|
}
|
|
88
91
|
toBuffer() {
|
|
89
|
-
return this.
|
|
92
|
+
return this.nullifier.toBuffer();
|
|
93
|
+
}
|
|
94
|
+
clone() {
|
|
95
|
+
return new NullifierLeaf(new Fr(this.nullifier));
|
|
96
|
+
}
|
|
97
|
+
toHashInputs() {
|
|
98
|
+
return [
|
|
99
|
+
Buffer.from(this.nullifier.toBuffer())
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
static empty() {
|
|
103
|
+
return new NullifierLeaf(Fr.ZERO);
|
|
104
|
+
}
|
|
105
|
+
static random() {
|
|
106
|
+
return new NullifierLeaf(Fr.random());
|
|
90
107
|
}
|
|
91
108
|
isEmpty() {
|
|
92
|
-
return this.
|
|
109
|
+
return this.nullifier.isZero();
|
|
93
110
|
}
|
|
94
111
|
updateTo(_another) {
|
|
95
112
|
throw new Error('Nullifiers are create only');
|
|
@@ -98,11 +115,12 @@ import { z } from 'zod';
|
|
|
98
115
|
return new NullifierLeaf(new Fr(key));
|
|
99
116
|
}
|
|
100
117
|
static fromBuffer(buf) {
|
|
101
|
-
|
|
118
|
+
const reader = BufferReader.asReader(buf);
|
|
119
|
+
return new NullifierLeaf(reader.readObject(Fr));
|
|
102
120
|
}
|
|
103
121
|
static get schema() {
|
|
104
122
|
return z.object({
|
|
105
|
-
|
|
106
|
-
}).transform(({
|
|
123
|
+
nullifier: schemas.Fr
|
|
124
|
+
}).transform(({ nullifier })=>new NullifierLeaf(nullifier));
|
|
107
125
|
}
|
|
108
126
|
}
|
|
@@ -40,20 +40,32 @@ export declare class NullifierMembershipWitness {
|
|
|
40
40
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
41
41
|
index: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
42
42
|
leafPreimage: z.ZodEffects<z.ZodObject<{
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
leaf: z.ZodEffects<z.ZodObject<{
|
|
44
|
+
nullifier: z.ZodType<Fr, any, string>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
nullifier: Fr;
|
|
47
|
+
}, {
|
|
48
|
+
nullifier: string;
|
|
49
|
+
}>, import("./nullifier_leaf.js").NullifierLeaf, {
|
|
50
|
+
nullifier: string;
|
|
51
|
+
}>;
|
|
52
|
+
nextKey: z.ZodType<Fr, any, string>;
|
|
45
53
|
nextIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
46
54
|
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
leaf: import("./nullifier_leaf.js").NullifierLeaf;
|
|
56
|
+
nextKey: Fr;
|
|
49
57
|
nextIndex: bigint;
|
|
50
58
|
}, {
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
leaf: {
|
|
60
|
+
nullifier: string;
|
|
61
|
+
};
|
|
62
|
+
nextKey: string;
|
|
53
63
|
nextIndex: string | number | bigint;
|
|
54
64
|
}>, NullifierLeafPreimage, {
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
leaf: {
|
|
66
|
+
nullifier: string;
|
|
67
|
+
};
|
|
68
|
+
nextKey: string;
|
|
57
69
|
nextIndex: string | number | bigint;
|
|
58
70
|
}>;
|
|
59
71
|
siblingPath: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>, z.ZodEffects<z.ZodObject<{
|
|
@@ -82,8 +94,10 @@ export declare class NullifierMembershipWitness {
|
|
|
82
94
|
}, {
|
|
83
95
|
index: string | number | bigint;
|
|
84
96
|
leafPreimage: {
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
leaf: {
|
|
98
|
+
nullifier: string;
|
|
99
|
+
};
|
|
100
|
+
nextKey: string;
|
|
87
101
|
nextIndex: string | number | bigint;
|
|
88
102
|
};
|
|
89
103
|
siblingPath: string | {
|
|
@@ -93,8 +107,10 @@ export declare class NullifierMembershipWitness {
|
|
|
93
107
|
}>, NullifierMembershipWitness, {
|
|
94
108
|
index: string | number | bigint;
|
|
95
109
|
leafPreimage: {
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
leaf: {
|
|
111
|
+
nullifier: string;
|
|
112
|
+
};
|
|
113
|
+
nextKey: string;
|
|
98
114
|
nextIndex: string | number | bigint;
|
|
99
115
|
};
|
|
100
116
|
siblingPath: string | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullifier_membership_witness.d.ts","sourceRoot":"","sources":["../../src/trees/nullifier_membership_witness.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;GAKG;AACH,qBAAa,0BAA0B;IAEnC;;OAEG;aACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;aACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;aACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC;;IAXtE;;OAEG;IACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;IACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;IACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC;IAGxE,MAAM,KAAK,MAAM
|
|
1
|
+
{"version":3,"file":"nullifier_membership_witness.d.ts","sourceRoot":"","sources":["../../src/trees/nullifier_membership_witness.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;GAKG;AACH,qBAAa,0BAA0B;IAEnC;;OAEG;aACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;aACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;aACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC;;IAXtE;;OAEG;IACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;IACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;IACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC;IAGxE,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAUhB;IAED,MAAM,CAAC,MAAM;IAQb;;;OAGG;IACI,QAAQ,IAAI,EAAE,EAAE;IAIvB;;OAEG;IACI,oBAAoB,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE;CAQrD"}
|
|
@@ -62,7 +62,6 @@ export declare class ProtocolContractLeafPreimage implements IndexedTreeLeafPrei
|
|
|
62
62
|
static random(): ProtocolContractLeafPreimage;
|
|
63
63
|
static empty(): ProtocolContractLeafPreimage;
|
|
64
64
|
static fromBuffer(buffer: Buffer | BufferReader): ProtocolContractLeafPreimage;
|
|
65
|
-
static fromLeaf(leaf: ProtocolContractLeaf, nextKey: bigint, nextIndex: bigint): ProtocolContractLeafPreimage;
|
|
66
65
|
}
|
|
67
66
|
/**
|
|
68
67
|
* An address to be inserted or checked in the protocol contract tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol_contract_leaf.d.ts","sourceRoot":"","sources":["../../src/trees/protocol_contract_leaf.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,qBAAa,4BAA6B,YAAW,uBAAuB;IAExE;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,WAAW,EAAE,EAAE;IACtB;;OAEG;IACI,SAAS,EAAE,MAAM;;IAXxB;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,WAAW,EAAE,EAAE;IACtB;;OAEG;IACI,SAAS,EAAE,MAAM;IAG1B,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;OAUhB;IAED,MAAM,IAAI,MAAM;IAIh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AAM,EAAE,MAAM,GAAG,YAAY,GAAG,4BAA4B;CAQ/E;AAED;;GAEG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAExD;;OAEG;IACI,OAAO,EAAE,EAAE;;IAHlB;;OAEG;IACI,OAAO,EAAE,EAAE;IAGpB,MAAM,IAAI,MAAM;IAIhB,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,OAAO;IAIlB,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,GAAG,oBAAoB;IAI9D,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB;IAIpD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB;CAGrD"}
|
|
@@ -69,9 +69,6 @@ import { z } from 'zod';
|
|
|
69
69
|
const reader = BufferReader.asReader(buffer);
|
|
70
70
|
return new ProtocolContractLeafPreimage(reader.readObject(Fr), reader.readObject(Fr), toBigIntBE(reader.readBytes(32)));
|
|
71
71
|
}
|
|
72
|
-
static fromLeaf(leaf, nextKey, nextIndex) {
|
|
73
|
-
return new ProtocolContractLeafPreimage(leaf.address, new Fr(nextKey), nextIndex);
|
|
74
|
-
}
|
|
75
72
|
}
|
|
76
73
|
/**
|
|
77
74
|
* An address to be inserted or checked in the protocol contract tree.
|
|
@@ -10,58 +10,77 @@ import { z } from 'zod';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class PublicDataTreeLeafPreimage implements IndexedTreeLeafPreimage {
|
|
12
12
|
/**
|
|
13
|
-
* The slot
|
|
13
|
+
* The leaf (slot, value).
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The value of the leaf
|
|
18
|
-
*/
|
|
19
|
-
value: Fr;
|
|
15
|
+
leaf: PublicDataTreeLeaf;
|
|
20
16
|
/**
|
|
21
|
-
* Next
|
|
17
|
+
* Next key (slot) inside the indexed tree's linked list.
|
|
22
18
|
*/
|
|
23
|
-
|
|
19
|
+
nextKey: Fr;
|
|
24
20
|
/**
|
|
25
21
|
* Index of the next leaf in the indexed tree's linked list.
|
|
26
22
|
*/
|
|
27
23
|
nextIndex: bigint;
|
|
28
24
|
constructor(
|
|
29
25
|
/**
|
|
30
|
-
* The slot
|
|
26
|
+
* The leaf (slot, value).
|
|
31
27
|
*/
|
|
32
|
-
|
|
28
|
+
leaf: PublicDataTreeLeaf,
|
|
33
29
|
/**
|
|
34
|
-
*
|
|
30
|
+
* Next key (slot) inside the indexed tree's linked list.
|
|
35
31
|
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Next value inside the indexed tree's linked list.
|
|
39
|
-
*/
|
|
40
|
-
nextSlot: Fr,
|
|
32
|
+
nextKey: Fr,
|
|
41
33
|
/**
|
|
42
34
|
* Index of the next leaf in the indexed tree's linked list.
|
|
43
35
|
*/
|
|
44
36
|
nextIndex: bigint);
|
|
45
37
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
38
|
+
leaf: z.ZodEffects<z.ZodObject<{
|
|
39
|
+
slot: z.ZodType<Fr, any, string>;
|
|
40
|
+
value: z.ZodType<Fr, any, string>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
value: Fr;
|
|
43
|
+
slot: Fr;
|
|
44
|
+
}, {
|
|
45
|
+
value: string;
|
|
46
|
+
slot: string;
|
|
47
|
+
}>, PublicDataTreeLeaf, {
|
|
48
|
+
value: string;
|
|
49
|
+
slot: string;
|
|
50
|
+
}>;
|
|
51
|
+
nextKey: z.ZodType<Fr, any, string>;
|
|
52
|
+
nextIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
leaf: PublicDataTreeLeaf;
|
|
55
|
+
nextKey: Fr;
|
|
56
|
+
nextIndex: bigint;
|
|
57
|
+
}, {
|
|
58
|
+
leaf: {
|
|
59
|
+
value: string;
|
|
60
|
+
slot: string;
|
|
61
|
+
};
|
|
62
|
+
nextKey: string;
|
|
63
|
+
nextIndex: string | number | bigint;
|
|
64
|
+
}>, PublicDataTreeLeafPreimage, {
|
|
65
|
+
leaf: {
|
|
66
|
+
value: string;
|
|
67
|
+
slot: string;
|
|
68
|
+
};
|
|
69
|
+
nextKey: string;
|
|
70
|
+
nextIndex: string | number | bigint;
|
|
71
|
+
}>;
|
|
72
|
+
static get leafSchema(): z.ZodEffects<z.ZodObject<{
|
|
46
73
|
slot: z.ZodType<Fr, any, string>;
|
|
47
74
|
value: z.ZodType<Fr, any, string>;
|
|
48
|
-
nextSlot: z.ZodType<Fr, any, string>;
|
|
49
|
-
nextIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
50
75
|
}, "strip", z.ZodTypeAny, {
|
|
51
76
|
value: Fr;
|
|
52
77
|
slot: Fr;
|
|
53
|
-
nextIndex: bigint;
|
|
54
|
-
nextSlot: Fr;
|
|
55
78
|
}, {
|
|
56
79
|
value: string;
|
|
57
80
|
slot: string;
|
|
58
|
-
|
|
59
|
-
nextSlot: string;
|
|
60
|
-
}>, PublicDataTreeLeafPreimage, {
|
|
81
|
+
}>, PublicDataTreeLeaf, {
|
|
61
82
|
value: string;
|
|
62
83
|
slot: string;
|
|
63
|
-
nextIndex: string | number | bigint;
|
|
64
|
-
nextSlot: string;
|
|
65
84
|
}>;
|
|
66
85
|
getKey(): bigint;
|
|
67
86
|
getNextKey(): bigint;
|
|
@@ -99,6 +118,8 @@ export declare class PublicDataTreeLeaf implements IndexedTreeLeaf {
|
|
|
99
118
|
value: Fr);
|
|
100
119
|
getKey(): bigint;
|
|
101
120
|
toBuffer(): Buffer;
|
|
121
|
+
clone(): PublicDataTreeLeaf;
|
|
122
|
+
toHashInputs(): Buffer[];
|
|
102
123
|
static fromBuffer(buffer: Buffer | BufferReader): PublicDataTreeLeaf;
|
|
103
124
|
equals(another: PublicDataTreeLeaf): boolean;
|
|
104
125
|
toString(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_data_leaf.d.ts","sourceRoot":"","sources":["../../src/trees/public_data_leaf.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IAEtE;;OAEG;IACI,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"public_data_leaf.d.ts","sourceRoot":"","sources":["../../src/trees/public_data_leaf.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IAEtE;;OAEG;IACI,IAAI,EAAE,kBAAkB;IAC/B;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,SAAS,EAAE,MAAM;;IAXxB;;OAEG;IACI,IAAI,EAAE,kBAAkB;IAC/B;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,SAAS,EAAE,MAAM;IAG1B,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED,MAAM,KAAK,UAAU;;;;;;;;;;;;OAEpB;IAED,MAAM,IAAI,MAAM;IAIhB,UAAU,IAAI,MAAM;IAIpB,YAAY,IAAI,MAAM;IAItB,MAAM,IAAI,kBAAkB;IAI5B,QAAQ,IAAI,MAAM;IAIlB,YAAY,IAAI,MAAM,EAAE;IAQxB,KAAK,IAAI,0BAA0B;IAInC,MAAM,CAAC,MAAM;IAQb,MAAM,CAAC,KAAK,IAAI,0BAA0B;IAI1C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,0BAA0B;IAQ5E,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,0BAA0B;IAIzG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,0BAA0B,GAAG,0BAA0B;CAG/E;AAED;;GAEG;AACH,qBAAa,kBAAmB,YAAW,eAAe;IAEtD;;OAEG;IACI,IAAI,EAAE,EAAE;IACf;;OAEG;IACI,KAAK,EAAE,EAAE;;IAPhB;;OAEG;IACI,IAAI,EAAE,EAAE;IACf;;OAEG;IACI,KAAK,EAAE,EAAE;IAGlB,MAAM,IAAI,MAAM;IAIhB,QAAQ;IAIR,KAAK,IAAI,kBAAkB;IAI3B,YAAY,IAAI,MAAM,EAAE;IAIxB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO;IAI5C,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,OAAO;IAIlB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,kBAAkB;IAOzD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB;IAIlD,MAAM,CAAC,KAAK,IAAI,kBAAkB;IAIlC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;CACF"}
|
|
@@ -7,77 +7,73 @@ import { z } from 'zod';
|
|
|
7
7
|
* Class containing the data of a preimage of a single leaf in the public data tree.
|
|
8
8
|
* Note: It's called preimage because this data gets hashed before being inserted as a node into the `IndexedTree`.
|
|
9
9
|
*/ export class PublicDataTreeLeafPreimage {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
nextSlot;
|
|
10
|
+
leaf;
|
|
11
|
+
nextKey;
|
|
13
12
|
nextIndex;
|
|
14
13
|
constructor(/**
|
|
15
|
-
* The slot
|
|
16
|
-
*/
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
* Next value inside the indexed tree's linked list.
|
|
20
|
-
*/ nextSlot, /**
|
|
14
|
+
* The leaf (slot, value).
|
|
15
|
+
*/ leaf, /**
|
|
16
|
+
* Next key (slot) inside the indexed tree's linked list.
|
|
17
|
+
*/ nextKey, /**
|
|
21
18
|
* Index of the next leaf in the indexed tree's linked list.
|
|
22
19
|
*/ nextIndex){
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.nextSlot = nextSlot;
|
|
20
|
+
this.leaf = leaf;
|
|
21
|
+
this.nextKey = nextKey;
|
|
26
22
|
this.nextIndex = nextIndex;
|
|
27
23
|
}
|
|
28
24
|
static get schema() {
|
|
29
25
|
return z.object({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
nextSlot: schemas.Fr,
|
|
26
|
+
leaf: PublicDataTreeLeaf.schema,
|
|
27
|
+
nextKey: schemas.Fr,
|
|
33
28
|
nextIndex: schemas.BigInt
|
|
34
|
-
}).transform(({
|
|
29
|
+
}).transform(({ leaf, nextKey, nextIndex })=>new PublicDataTreeLeafPreimage(leaf, nextKey, nextIndex));
|
|
30
|
+
}
|
|
31
|
+
static get leafSchema() {
|
|
32
|
+
return PublicDataTreeLeaf.schema;
|
|
35
33
|
}
|
|
36
34
|
getKey() {
|
|
37
|
-
return this.
|
|
35
|
+
return this.leaf.getKey();
|
|
38
36
|
}
|
|
39
37
|
getNextKey() {
|
|
40
|
-
return this.
|
|
38
|
+
return this.nextKey.toBigInt();
|
|
41
39
|
}
|
|
42
40
|
getNextIndex() {
|
|
43
41
|
return this.nextIndex;
|
|
44
42
|
}
|
|
45
43
|
asLeaf() {
|
|
46
|
-
return
|
|
44
|
+
return this.leaf;
|
|
47
45
|
}
|
|
48
46
|
toBuffer() {
|
|
49
47
|
return Buffer.concat(this.toHashInputs());
|
|
50
48
|
}
|
|
51
49
|
toHashInputs() {
|
|
52
50
|
return [
|
|
53
|
-
|
|
54
|
-
Buffer.from(this.value.toBuffer()),
|
|
51
|
+
...this.leaf.toHashInputs(),
|
|
55
52
|
Buffer.from(toBufferBE(this.nextIndex, 32)),
|
|
56
|
-
Buffer.from(this.
|
|
53
|
+
Buffer.from(this.nextKey.toBuffer())
|
|
57
54
|
];
|
|
58
55
|
}
|
|
59
56
|
clone() {
|
|
60
|
-
return new PublicDataTreeLeafPreimage(this.
|
|
57
|
+
return new PublicDataTreeLeafPreimage(this.leaf.clone(), this.nextKey, this.nextIndex);
|
|
61
58
|
}
|
|
62
59
|
static random() {
|
|
63
|
-
return new PublicDataTreeLeafPreimage(
|
|
60
|
+
return new PublicDataTreeLeafPreimage(PublicDataTreeLeaf.buildDummy(BigInt(Math.floor(Math.random() * 1000))), Fr.random(), BigInt(Math.floor(Math.random() * 1000)));
|
|
64
61
|
}
|
|
65
62
|
static empty() {
|
|
66
|
-
return new PublicDataTreeLeafPreimage(
|
|
63
|
+
return new PublicDataTreeLeafPreimage(PublicDataTreeLeaf.empty(), Fr.ZERO, 0n);
|
|
67
64
|
}
|
|
68
65
|
static fromBuffer(buffer) {
|
|
69
66
|
const reader = BufferReader.asReader(buffer);
|
|
70
|
-
const
|
|
71
|
-
const value = Fr.fromBuffer(reader);
|
|
67
|
+
const value = PublicDataTreeLeaf.fromBuffer(reader);
|
|
72
68
|
const nextIndex = toBigIntBE(reader.readBytes(32));
|
|
73
69
|
const nextSlot = Fr.fromBuffer(reader);
|
|
74
|
-
return new PublicDataTreeLeafPreimage(
|
|
70
|
+
return new PublicDataTreeLeafPreimage(value, nextSlot, nextIndex);
|
|
75
71
|
}
|
|
76
72
|
static fromLeaf(leaf, nextKey, nextIndex) {
|
|
77
|
-
return new PublicDataTreeLeafPreimage(leaf
|
|
73
|
+
return new PublicDataTreeLeafPreimage(leaf, new Fr(nextKey), nextIndex);
|
|
78
74
|
}
|
|
79
75
|
static clone(preimage) {
|
|
80
|
-
return
|
|
76
|
+
return preimage.clone();
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
/**
|
|
@@ -102,6 +98,15 @@ import { z } from 'zod';
|
|
|
102
98
|
this.value
|
|
103
99
|
]);
|
|
104
100
|
}
|
|
101
|
+
clone() {
|
|
102
|
+
return new PublicDataTreeLeaf(this.slot, this.value);
|
|
103
|
+
}
|
|
104
|
+
toHashInputs() {
|
|
105
|
+
return [
|
|
106
|
+
this.slot.toBuffer(),
|
|
107
|
+
this.value.toBuffer()
|
|
108
|
+
];
|
|
109
|
+
}
|
|
105
110
|
static fromBuffer(buffer) {
|
|
106
111
|
const reader = BufferReader.asReader(buffer);
|
|
107
112
|
return new PublicDataTreeLeaf(Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
|
@@ -43,25 +43,39 @@ export declare class PublicDataWitness {
|
|
|
43
43
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
44
44
|
index: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
45
45
|
leafPreimage: z.ZodEffects<z.ZodObject<{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
leaf: z.ZodEffects<z.ZodObject<{
|
|
47
|
+
slot: z.ZodType<Fr, any, string>;
|
|
48
|
+
value: z.ZodType<Fr, any, string>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
value: Fr;
|
|
51
|
+
slot: Fr;
|
|
52
|
+
}, {
|
|
53
|
+
value: string;
|
|
54
|
+
slot: string;
|
|
55
|
+
}>, import("./public_data_leaf.js").PublicDataTreeLeaf, {
|
|
56
|
+
value: string;
|
|
57
|
+
slot: string;
|
|
58
|
+
}>;
|
|
59
|
+
nextKey: z.ZodType<Fr, any, string>;
|
|
49
60
|
nextIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
50
61
|
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
leaf: import("./public_data_leaf.js").PublicDataTreeLeaf;
|
|
63
|
+
nextKey: Fr;
|
|
53
64
|
nextIndex: bigint;
|
|
54
|
-
nextSlot: Fr;
|
|
55
65
|
}, {
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
leaf: {
|
|
67
|
+
value: string;
|
|
68
|
+
slot: string;
|
|
69
|
+
};
|
|
70
|
+
nextKey: string;
|
|
58
71
|
nextIndex: string | number | bigint;
|
|
59
|
-
nextSlot: string;
|
|
60
72
|
}>, PublicDataTreeLeafPreimage, {
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
leaf: {
|
|
74
|
+
value: string;
|
|
75
|
+
slot: string;
|
|
76
|
+
};
|
|
77
|
+
nextKey: string;
|
|
63
78
|
nextIndex: string | number | bigint;
|
|
64
|
-
nextSlot: string;
|
|
65
79
|
}>;
|
|
66
80
|
siblingPath: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>, z.ZodEffects<z.ZodObject<{
|
|
67
81
|
type: z.ZodLiteral<"Buffer">;
|
|
@@ -89,10 +103,12 @@ export declare class PublicDataWitness {
|
|
|
89
103
|
}, {
|
|
90
104
|
index: string | number | bigint;
|
|
91
105
|
leafPreimage: {
|
|
92
|
-
|
|
93
|
-
|
|
106
|
+
leaf: {
|
|
107
|
+
value: string;
|
|
108
|
+
slot: string;
|
|
109
|
+
};
|
|
110
|
+
nextKey: string;
|
|
94
111
|
nextIndex: string | number | bigint;
|
|
95
|
-
nextSlot: string;
|
|
96
112
|
};
|
|
97
113
|
siblingPath: string | {
|
|
98
114
|
type: "Buffer";
|
|
@@ -101,10 +117,12 @@ export declare class PublicDataWitness {
|
|
|
101
117
|
}>, PublicDataWitness, {
|
|
102
118
|
index: string | number | bigint;
|
|
103
119
|
leafPreimage: {
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
leaf: {
|
|
121
|
+
value: string;
|
|
122
|
+
slot: string;
|
|
123
|
+
};
|
|
124
|
+
nextKey: string;
|
|
106
125
|
nextIndex: string | number | bigint;
|
|
107
|
-
nextSlot: string;
|
|
108
126
|
};
|
|
109
127
|
siblingPath: string | {
|
|
110
128
|
type: "Buffer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_data_witness.d.ts","sourceRoot":"","sources":["../../src/trees/public_data_witness.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;GAKG;AACH,qBAAa,iBAAiB;IAE1B;;OAEG;aACa,KAAK,EAAE,MAAM;IAC7B;;;OAGG;aACa,YAAY,EAAE,0BAA0B;IACxD;;OAEG;aACa,WAAW,EAAE,WAAW,CAAC,OAAO,uBAAuB,CAAC;;IAZxE;;OAEG;IACa,KAAK,EAAE,MAAM;IAC7B;;;OAGG;IACa,YAAY,EAAE,0BAA0B;IACxD;;OAEG;IACa,WAAW,EAAE,WAAW,CAAC,OAAO,uBAAuB,CAAC;IAG1E,MAAM,KAAK,MAAM
|
|
1
|
+
{"version":3,"file":"public_data_witness.d.ts","sourceRoot":"","sources":["../../src/trees/public_data_witness.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAk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|
-
new Fr(this.leafPreimage.slot),
|
|
45
|
-
new Fr(this.leafPreimage.value),
|
|
44
|
+
new Fr(this.leafPreimage.leaf.slot),
|
|
45
|
+
new Fr(this.leafPreimage.leaf.value),
|
|
46
46
|
new Fr(this.leafPreimage.nextIndex),
|
|
47
|
-
new Fr(this.leafPreimage.
|
|
47
|
+
new Fr(this.leafPreimage.nextKey),
|
|
48
48
|
...this.siblingPath.toFields()
|
|
49
49
|
];
|
|
50
50
|
}
|
|
@@ -54,9 +54,9 @@ import { PublicDataTreeLeafPreimage } from './public_data_leaf.js';
|
|
|
54
54
|
// TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
|
|
55
55
|
return [
|
|
56
56
|
new Fr(this.index).toString(),
|
|
57
|
-
new Fr(this.leafPreimage.slot).toString(),
|
|
58
|
-
new Fr(this.leafPreimage.value).toString(),
|
|
59
|
-
new Fr(this.leafPreimage.
|
|
57
|
+
new Fr(this.leafPreimage.leaf.slot).toString(),
|
|
58
|
+
new Fr(this.leafPreimage.leaf.value).toString(),
|
|
59
|
+
new Fr(this.leafPreimage.nextKey).toString(),
|
|
60
60
|
new Fr(this.leafPreimage.nextIndex).toString(),
|
|
61
61
|
this.siblingPath.toFields().map((fr)=>fr.toString())
|
|
62
62
|
];
|
|
@@ -6,7 +6,7 @@ import type { ChainConfig } from '../config/config.js';
|
|
|
6
6
|
export type ComponentsVersions = {
|
|
7
7
|
l1ChainId: number;
|
|
8
8
|
l1RollupAddress: EthAddress;
|
|
9
|
-
|
|
9
|
+
rollupVersion: number;
|
|
10
10
|
l2ProtocolContractsTreeRoot: string;
|
|
11
11
|
l2CircuitsVkTreeRoot: string;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,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