@sig-net/midnight-contract 0.10.0 → 0.12.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/README.md +4 -4
- package/dist/managed/compiler/contract-info.json +175 -103
- package/dist/managed/compiler/contract-manifest.json +34 -34
- package/dist/managed/contract/index.d.ts +97 -80
- package/dist/managed/contract/index.js +161 -132
- package/dist/managed/contract/index.js.map +1 -1
- package/dist/managed/keys/{postRespondBidirectional.prover → respondBidirectional.prover} +0 -0
- package/dist/managed/keys/respondBidirectional.verifier +0 -0
- package/dist/managed/zkir/respondBidirectional.bzkir +0 -0
- package/dist/managed/zkir/{postRespondBidirectional.zkir → respondBidirectional.zkir} +17 -21
- package/dist/witnesses.js +3 -3
- package/dist/witnesses.js.map +1 -1
- package/package.json +3 -3
- package/dist/managed/keys/postRespondBidirectional.verifier +0 -0
- package/dist/managed/zkir/postRespondBidirectional.bzkir +0 -0
- /package/dist/managed/keys/{postSignatureResponse.prover → respond.prover} +0 -0
- /package/dist/managed/keys/{postSignatureResponse.verifier → respond.verifier} +0 -0
- /package/dist/managed/keys/{signBidirectionalEvent.prover → signBidirectional.prover} +0 -0
- /package/dist/managed/keys/{signBidirectionalEvent.verifier → signBidirectional.verifier} +0 -0
- /package/dist/managed/zkir/{postSignatureResponse.bzkir → respond.bzkir} +0 -0
- /package/dist/managed/zkir/{postSignatureResponse.zkir → respond.zkir} +0 -0
- /package/dist/managed/zkir/{signBidirectionalEvent.bzkir → signBidirectional.bzkir} +0 -0
- /package/dist/managed/zkir/{signBidirectionalEvent.zkir → signBidirectional.zkir} +0 -0
|
@@ -26,65 +26,94 @@ class _SignetMapKey_0 {
|
|
|
26
26
|
|
|
27
27
|
const _descriptor_4 = new _SignetMapKey_0();
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
class _AffinePoint_0 {
|
|
30
|
+
alignment() {
|
|
31
|
+
return _descriptor_0.alignment().concat(_descriptor_0.alignment());
|
|
32
|
+
}
|
|
33
|
+
fromValue(value_0) {
|
|
34
|
+
return {
|
|
35
|
+
x: _descriptor_0.fromValue(value_0),
|
|
36
|
+
y: _descriptor_0.fromValue(value_0)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
toValue(value_0) {
|
|
40
|
+
return _descriptor_0.toValue(value_0.x).concat(_descriptor_0.toValue(value_0.y));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const _descriptor_5 = new _AffinePoint_0();
|
|
30
45
|
|
|
31
46
|
const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
32
47
|
|
|
33
|
-
class
|
|
48
|
+
class _Signature_0 {
|
|
34
49
|
alignment() {
|
|
35
|
-
return _descriptor_5.alignment().concat(
|
|
50
|
+
return _descriptor_5.alignment().concat(_descriptor_0.alignment().concat(_descriptor_6.alignment()));
|
|
36
51
|
}
|
|
37
52
|
fromValue(value_0) {
|
|
38
53
|
return {
|
|
39
|
-
|
|
40
|
-
outputLen: _descriptor_6.fromValue(value_0),
|
|
41
|
-
r: _descriptor_0.fromValue(value_0),
|
|
54
|
+
bigR: _descriptor_5.fromValue(value_0),
|
|
42
55
|
s: _descriptor_0.fromValue(value_0),
|
|
43
56
|
recoveryId: _descriptor_6.fromValue(value_0)
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
toValue(value_0) {
|
|
47
|
-
return _descriptor_5.toValue(value_0.
|
|
60
|
+
return _descriptor_5.toValue(value_0.bigR).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_6.toValue(value_0.recoveryId)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const _descriptor_7 = new _Signature_0();
|
|
65
|
+
|
|
66
|
+
class _RespondBidirectionalEvent_0 {
|
|
67
|
+
alignment() {
|
|
68
|
+
return _descriptor_0.alignment().concat(_descriptor_7.alignment());
|
|
69
|
+
}
|
|
70
|
+
fromValue(value_0) {
|
|
71
|
+
return {
|
|
72
|
+
attestationDigest: _descriptor_0.fromValue(value_0),
|
|
73
|
+
signature: _descriptor_7.fromValue(value_0)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
toValue(value_0) {
|
|
77
|
+
return _descriptor_0.toValue(value_0.attestationDigest).concat(_descriptor_7.toValue(value_0.signature));
|
|
48
78
|
}
|
|
49
79
|
}
|
|
50
80
|
|
|
51
|
-
const
|
|
81
|
+
const _descriptor_8 = new _RespondBidirectionalEvent_0();
|
|
82
|
+
|
|
83
|
+
const _descriptor_9 = new __compactRuntime.CompactTypeBytes(128);
|
|
52
84
|
|
|
53
85
|
class _SignBidirectionalEventNotification_0 {
|
|
54
86
|
alignment() {
|
|
55
|
-
return _descriptor_6.alignment().concat(
|
|
87
|
+
return _descriptor_6.alignment().concat(_descriptor_9.alignment());
|
|
56
88
|
}
|
|
57
89
|
fromValue(value_0) {
|
|
58
90
|
return {
|
|
59
91
|
version: _descriptor_6.fromValue(value_0),
|
|
60
|
-
payload:
|
|
92
|
+
payload: _descriptor_9.fromValue(value_0)
|
|
61
93
|
}
|
|
62
94
|
}
|
|
63
95
|
toValue(value_0) {
|
|
64
|
-
return _descriptor_6.toValue(value_0.version).concat(
|
|
96
|
+
return _descriptor_6.toValue(value_0.version).concat(_descriptor_9.toValue(value_0.payload));
|
|
65
97
|
}
|
|
66
98
|
}
|
|
67
99
|
|
|
68
|
-
const
|
|
100
|
+
const _descriptor_10 = new _SignBidirectionalEventNotification_0();
|
|
69
101
|
|
|
70
102
|
class _SignatureRespondedEvent_0 {
|
|
71
103
|
alignment() {
|
|
72
|
-
return
|
|
104
|
+
return _descriptor_7.alignment();
|
|
73
105
|
}
|
|
74
106
|
fromValue(value_0) {
|
|
75
107
|
return {
|
|
76
|
-
|
|
77
|
-
bigRy: _descriptor_0.fromValue(value_0),
|
|
78
|
-
s: _descriptor_0.fromValue(value_0),
|
|
79
|
-
recoveryId: _descriptor_6.fromValue(value_0)
|
|
108
|
+
signature: _descriptor_7.fromValue(value_0)
|
|
80
109
|
}
|
|
81
110
|
}
|
|
82
111
|
toValue(value_0) {
|
|
83
|
-
return
|
|
112
|
+
return _descriptor_7.toValue(value_0.signature);
|
|
84
113
|
}
|
|
85
114
|
}
|
|
86
115
|
|
|
87
|
-
const
|
|
116
|
+
const _descriptor_11 = new _SignatureRespondedEvent_0();
|
|
88
117
|
|
|
89
118
|
class _Either_0 {
|
|
90
119
|
alignment() {
|
|
@@ -102,9 +131,9 @@ class _Either_0 {
|
|
|
102
131
|
}
|
|
103
132
|
}
|
|
104
133
|
|
|
105
|
-
const
|
|
134
|
+
const _descriptor_12 = new _Either_0();
|
|
106
135
|
|
|
107
|
-
const
|
|
136
|
+
const _descriptor_13 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
|
|
108
137
|
|
|
109
138
|
class _ContractAddress_0 {
|
|
110
139
|
alignment() {
|
|
@@ -120,9 +149,9 @@ class _ContractAddress_0 {
|
|
|
120
149
|
}
|
|
121
150
|
}
|
|
122
151
|
|
|
123
|
-
const
|
|
152
|
+
const _descriptor_14 = new _ContractAddress_0();
|
|
124
153
|
|
|
125
|
-
const
|
|
154
|
+
const _descriptor_15 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
|
|
126
155
|
|
|
127
156
|
export class Contract {
|
|
128
157
|
witnesses;
|
|
@@ -136,29 +165,29 @@ export class Contract {
|
|
|
136
165
|
}
|
|
137
166
|
this.witnesses = witnesses_0;
|
|
138
167
|
this.circuits = {
|
|
139
|
-
|
|
168
|
+
signBidirectional: async (...args_1) => {
|
|
140
169
|
if (args_1.length !== 3) {
|
|
141
|
-
throw new __compactRuntime.CompactError(`
|
|
170
|
+
throw new __compactRuntime.CompactError(`signBidirectional: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
142
171
|
}
|
|
143
172
|
const contextOrig_0 = args_1[0];
|
|
144
173
|
const requestId_0 = args_1[1];
|
|
145
174
|
const notification_0 = args_1[2];
|
|
146
175
|
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
147
|
-
__compactRuntime.typeError('
|
|
176
|
+
__compactRuntime.typeError('signBidirectional',
|
|
148
177
|
'argument 1 (as invoked from Typescript)',
|
|
149
178
|
'signet-contract.compact line 37 char 1',
|
|
150
179
|
'CircuitContext',
|
|
151
180
|
contextOrig_0)
|
|
152
181
|
}
|
|
153
182
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
154
|
-
__compactRuntime.typeError('
|
|
183
|
+
__compactRuntime.typeError('signBidirectional',
|
|
155
184
|
'argument 1 (argument 2 as invoked from Typescript)',
|
|
156
185
|
'signet-contract.compact line 37 char 1',
|
|
157
186
|
'Bytes<32>',
|
|
158
187
|
requestId_0)
|
|
159
188
|
}
|
|
160
189
|
if (!(typeof(notification_0) === 'object' && typeof(notification_0.version) === 'bigint' && notification_0.version >= 0n && notification_0.version <= 255n && notification_0.payload.buffer instanceof ArrayBuffer && notification_0.payload.BYTES_PER_ELEMENT === 1 && notification_0.payload.length === 128)) {
|
|
161
|
-
__compactRuntime.typeError('
|
|
190
|
+
__compactRuntime.typeError('signBidirectional',
|
|
162
191
|
'argument 2 (argument 3 as invoked from Typescript)',
|
|
163
192
|
'signet-contract.compact line 37 char 1',
|
|
164
193
|
'struct SignBidirectionalEventNotification<version: Uint<0..256>, payload: Bytes<128>>',
|
|
@@ -167,123 +196,123 @@ export class Contract {
|
|
|
167
196
|
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
168
197
|
const partialProofData = {
|
|
169
198
|
input: {
|
|
170
|
-
value: _descriptor_0.toValue(requestId_0).concat(
|
|
171
|
-
alignment: _descriptor_0.alignment().concat(
|
|
199
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_10.toValue(notification_0)),
|
|
200
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_10.alignment())
|
|
172
201
|
},
|
|
173
202
|
output: undefined,
|
|
174
203
|
publicTranscript: [],
|
|
175
204
|
privateTranscriptOutputs: []
|
|
176
205
|
};
|
|
177
|
-
const result_0 = await this.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
206
|
+
const result_0 = await this._signBidirectional_0(context,
|
|
207
|
+
partialProofData,
|
|
208
|
+
requestId_0,
|
|
209
|
+
notification_0);
|
|
181
210
|
partialProofData.output = { value: _descriptor_4.toValue(result_0), alignment: _descriptor_4.alignment() };
|
|
182
211
|
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
183
212
|
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
184
213
|
},
|
|
185
|
-
|
|
214
|
+
respond: async (...args_1) => {
|
|
186
215
|
if (args_1.length !== 3) {
|
|
187
|
-
throw new __compactRuntime.CompactError(`
|
|
216
|
+
throw new __compactRuntime.CompactError(`respond: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
188
217
|
}
|
|
189
218
|
const contextOrig_0 = args_1[0];
|
|
190
219
|
const requestId_0 = args_1[1];
|
|
191
220
|
const signatureRespondedEvent_0 = args_1[2];
|
|
192
221
|
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
193
|
-
__compactRuntime.typeError('
|
|
222
|
+
__compactRuntime.typeError('respond',
|
|
194
223
|
'argument 1 (as invoked from Typescript)',
|
|
195
224
|
'signet-contract.compact line 66 char 1',
|
|
196
225
|
'CircuitContext',
|
|
197
226
|
contextOrig_0)
|
|
198
227
|
}
|
|
199
228
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
200
|
-
__compactRuntime.typeError('
|
|
229
|
+
__compactRuntime.typeError('respond',
|
|
201
230
|
'argument 1 (argument 2 as invoked from Typescript)',
|
|
202
231
|
'signet-contract.compact line 66 char 1',
|
|
203
232
|
'Bytes<32>',
|
|
204
233
|
requestId_0)
|
|
205
234
|
}
|
|
206
|
-
if (!(typeof(signatureRespondedEvent_0) === 'object' && signatureRespondedEvent_0.
|
|
207
|
-
__compactRuntime.typeError('
|
|
235
|
+
if (!(typeof(signatureRespondedEvent_0) === 'object' && typeof(signatureRespondedEvent_0.signature) === 'object' && typeof(signatureRespondedEvent_0.signature.bigR) === 'object' && signatureRespondedEvent_0.signature.bigR.x.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.bigR.x.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.bigR.x.length === 32 && signatureRespondedEvent_0.signature.bigR.y.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.bigR.y.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.bigR.y.length === 32 && signatureRespondedEvent_0.signature.s.buffer instanceof ArrayBuffer && signatureRespondedEvent_0.signature.s.BYTES_PER_ELEMENT === 1 && signatureRespondedEvent_0.signature.s.length === 32 && typeof(signatureRespondedEvent_0.signature.recoveryId) === 'bigint' && signatureRespondedEvent_0.signature.recoveryId >= 0n && signatureRespondedEvent_0.signature.recoveryId <= 255n)) {
|
|
236
|
+
__compactRuntime.typeError('respond',
|
|
208
237
|
'argument 2 (argument 3 as invoked from Typescript)',
|
|
209
238
|
'signet-contract.compact line 66 char 1',
|
|
210
|
-
'struct SignatureRespondedEvent<
|
|
239
|
+
'struct SignatureRespondedEvent<signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
211
240
|
signatureRespondedEvent_0)
|
|
212
241
|
}
|
|
213
242
|
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
214
243
|
const partialProofData = {
|
|
215
244
|
input: {
|
|
216
|
-
value: _descriptor_0.toValue(requestId_0).concat(
|
|
217
|
-
alignment: _descriptor_0.alignment().concat(
|
|
245
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_11.toValue(signatureRespondedEvent_0)),
|
|
246
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_11.alignment())
|
|
218
247
|
},
|
|
219
248
|
output: undefined,
|
|
220
249
|
publicTranscript: [],
|
|
221
250
|
privateTranscriptOutputs: []
|
|
222
251
|
};
|
|
223
|
-
const result_0 = await this.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
252
|
+
const result_0 = await this._respond_0(context,
|
|
253
|
+
partialProofData,
|
|
254
|
+
requestId_0,
|
|
255
|
+
signatureRespondedEvent_0);
|
|
227
256
|
partialProofData.output = { value: [], alignment: [] };
|
|
228
257
|
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
229
258
|
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
230
259
|
},
|
|
231
|
-
|
|
260
|
+
respondBidirectional: async (...args_1) => {
|
|
232
261
|
if (args_1.length !== 3) {
|
|
233
|
-
throw new __compactRuntime.CompactError(`
|
|
262
|
+
throw new __compactRuntime.CompactError(`respondBidirectional: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
234
263
|
}
|
|
235
264
|
const contextOrig_0 = args_1[0];
|
|
236
265
|
const requestId_0 = args_1[1];
|
|
237
266
|
const respondBidirectionalEvent_0 = args_1[2];
|
|
238
267
|
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
239
|
-
__compactRuntime.typeError('
|
|
268
|
+
__compactRuntime.typeError('respondBidirectional',
|
|
240
269
|
'argument 1 (as invoked from Typescript)',
|
|
241
270
|
'signet-contract.compact line 97 char 1',
|
|
242
271
|
'CircuitContext',
|
|
243
272
|
contextOrig_0)
|
|
244
273
|
}
|
|
245
274
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
246
|
-
__compactRuntime.typeError('
|
|
275
|
+
__compactRuntime.typeError('respondBidirectional',
|
|
247
276
|
'argument 1 (argument 2 as invoked from Typescript)',
|
|
248
277
|
'signet-contract.compact line 97 char 1',
|
|
249
278
|
'Bytes<32>',
|
|
250
279
|
requestId_0)
|
|
251
280
|
}
|
|
252
|
-
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.
|
|
253
|
-
__compactRuntime.typeError('
|
|
281
|
+
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.attestationDigest.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.attestationDigest.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.attestationDigest.length === 32 && typeof(respondBidirectionalEvent_0.signature) === 'object' && typeof(respondBidirectionalEvent_0.signature.bigR) === 'object' && respondBidirectionalEvent_0.signature.bigR.x.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.x.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.x.length === 32 && respondBidirectionalEvent_0.signature.bigR.y.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.y.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.y.length === 32 && respondBidirectionalEvent_0.signature.s.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.s.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.s.length === 32 && typeof(respondBidirectionalEvent_0.signature.recoveryId) === 'bigint' && respondBidirectionalEvent_0.signature.recoveryId >= 0n && respondBidirectionalEvent_0.signature.recoveryId <= 255n)) {
|
|
282
|
+
__compactRuntime.typeError('respondBidirectional',
|
|
254
283
|
'argument 2 (argument 3 as invoked from Typescript)',
|
|
255
284
|
'signet-contract.compact line 97 char 1',
|
|
256
|
-
'struct RespondBidirectionalEvent<
|
|
285
|
+
'struct RespondBidirectionalEvent<attestationDigest: Bytes<32>, signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
|
|
257
286
|
respondBidirectionalEvent_0)
|
|
258
287
|
}
|
|
259
288
|
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
260
289
|
const partialProofData = {
|
|
261
290
|
input: {
|
|
262
|
-
value: _descriptor_0.toValue(requestId_0).concat(
|
|
263
|
-
alignment: _descriptor_0.alignment().concat(
|
|
291
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_8.toValue(respondBidirectionalEvent_0)),
|
|
292
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_8.alignment())
|
|
264
293
|
},
|
|
265
294
|
output: undefined,
|
|
266
295
|
publicTranscript: [],
|
|
267
296
|
privateTranscriptOutputs: []
|
|
268
297
|
};
|
|
269
|
-
const result_0 = await this.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
298
|
+
const result_0 = await this._respondBidirectional_0(context,
|
|
299
|
+
partialProofData,
|
|
300
|
+
requestId_0,
|
|
301
|
+
respondBidirectionalEvent_0);
|
|
273
302
|
partialProofData.output = { value: [], alignment: [] };
|
|
274
303
|
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
275
304
|
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
276
305
|
}
|
|
277
306
|
};
|
|
278
307
|
this.impureCircuits = {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
308
|
+
signBidirectional: this.circuits.signBidirectional,
|
|
309
|
+
respond: this.circuits.respond,
|
|
310
|
+
respondBidirectional: this.circuits.respondBidirectional
|
|
282
311
|
};
|
|
283
312
|
this.provableCircuits = {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
313
|
+
signBidirectional: this.circuits.signBidirectional,
|
|
314
|
+
respond: this.circuits.respond,
|
|
315
|
+
respondBidirectional: this.circuits.respondBidirectional
|
|
287
316
|
};
|
|
288
317
|
}
|
|
289
318
|
async initialState(...args_0) {
|
|
@@ -309,9 +338,9 @@ export class Contract {
|
|
|
309
338
|
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
310
339
|
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
311
340
|
state_0.data = new __compactRuntime.ChargedState(stateValue_0);
|
|
312
|
-
state_0.setOperation('
|
|
313
|
-
state_0.setOperation('
|
|
314
|
-
state_0.setOperation('
|
|
341
|
+
state_0.setOperation('signBidirectional', new __compactRuntime.ContractOperation());
|
|
342
|
+
state_0.setOperation('respond', new __compactRuntime.ContractOperation());
|
|
343
|
+
state_0.setOperation('respondBidirectional', new __compactRuntime.ContractOperation());
|
|
315
344
|
const context = __compactRuntime.createCircuitContext('constructor', __compactRuntime.dummyContractAddress(), constructorContext_0.initialZswapLocalState.coinPublicKey, state_0.data, constructorContext_0.initialPrivateState);
|
|
316
345
|
const partialProofData = {
|
|
317
346
|
input: { value: [], alignment: [] },
|
|
@@ -392,10 +421,10 @@ export class Contract {
|
|
|
392
421
|
currentZswapLocalState: context.callContext.currentZswapLocalState
|
|
393
422
|
}
|
|
394
423
|
}
|
|
395
|
-
async
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
424
|
+
async _signBidirectional_0(context,
|
|
425
|
+
partialProofData,
|
|
426
|
+
requestId_0,
|
|
427
|
+
notification_0)
|
|
399
428
|
{
|
|
400
429
|
__compactRuntime.assert(notification_0.version === 1n,
|
|
401
430
|
'only version 1 notification supported');
|
|
@@ -483,16 +512,16 @@ export class Contract {
|
|
|
483
512
|
value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(signBidirectionalEventNotificationMapKey_0),
|
|
484
513
|
alignment: _descriptor_4.alignment() }).encode() } },
|
|
485
514
|
{ push: { storage: true,
|
|
486
|
-
value: __compactRuntime.StateValue.newCell({ value:
|
|
487
|
-
alignment:
|
|
515
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_10.toValue(notification_0),
|
|
516
|
+
alignment: _descriptor_10.alignment() }).encode() } },
|
|
488
517
|
{ ins: { cached: false, n: 1 } },
|
|
489
518
|
{ ins: { cached: true, n: 1 } }]);
|
|
490
519
|
return signBidirectionalEventNotificationMapKey_0;
|
|
491
520
|
}
|
|
492
|
-
async
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
521
|
+
async _respond_0(context,
|
|
522
|
+
partialProofData,
|
|
523
|
+
requestId_0,
|
|
524
|
+
signatureRespondedEvent_0)
|
|
496
525
|
{
|
|
497
526
|
const disclosedRequestId_0 = requestId_0;
|
|
498
527
|
if (!_descriptor_2.fromValue(__compactRuntime.queryLedgerState(context,
|
|
@@ -578,16 +607,16 @@ export class Contract {
|
|
|
578
607
|
value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(tmp_1),
|
|
579
608
|
alignment: _descriptor_4.alignment() }).encode() } },
|
|
580
609
|
{ push: { storage: true,
|
|
581
|
-
value: __compactRuntime.StateValue.newCell({ value:
|
|
582
|
-
alignment:
|
|
610
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_11.toValue(signatureRespondedEvent_0),
|
|
611
|
+
alignment: _descriptor_11.alignment() }).encode() } },
|
|
583
612
|
{ ins: { cached: false, n: 1 } },
|
|
584
613
|
{ ins: { cached: true, n: 1 } }]);
|
|
585
614
|
return [];
|
|
586
615
|
}
|
|
587
|
-
async
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
616
|
+
async _respondBidirectional_0(context,
|
|
617
|
+
partialProofData,
|
|
618
|
+
requestId_0,
|
|
619
|
+
respondBidirectionalEvent_0)
|
|
591
620
|
{
|
|
592
621
|
const disclosedRequestId_0 = requestId_0;
|
|
593
622
|
if (!_descriptor_2.fromValue(__compactRuntime.queryLedgerState(context,
|
|
@@ -673,8 +702,8 @@ export class Contract {
|
|
|
673
702
|
value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(tmp_1),
|
|
674
703
|
alignment: _descriptor_4.alignment() }).encode() } },
|
|
675
704
|
{ push: { storage: true,
|
|
676
|
-
value: __compactRuntime.StateValue.newCell({ value:
|
|
677
|
-
alignment:
|
|
705
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_8.toValue(respondBidirectionalEvent_0),
|
|
706
|
+
alignment: _descriptor_8.alignment() }).encode() } },
|
|
678
707
|
{ ins: { cached: false, n: 1 } },
|
|
679
708
|
{ ins: { cached: true, n: 1 } }]);
|
|
680
709
|
return [];
|
|
@@ -886,34 +915,34 @@ export function ledger(stateOrChargedState) {
|
|
|
886
915
|
'struct SignetMapKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
887
916
|
key_0)
|
|
888
917
|
}
|
|
889
|
-
return
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
918
|
+
return _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
919
|
+
partialProofData,
|
|
920
|
+
[
|
|
921
|
+
{ dup: { n: 0 } },
|
|
922
|
+
{ idx: { cached: false,
|
|
923
|
+
pushPath: false,
|
|
924
|
+
path: [
|
|
925
|
+
{ tag: 'value',
|
|
926
|
+
value: { value: _descriptor_6.toValue(1n),
|
|
927
|
+
alignment: _descriptor_6.alignment() } }] } },
|
|
928
|
+
{ idx: { cached: false,
|
|
929
|
+
pushPath: false,
|
|
930
|
+
path: [
|
|
931
|
+
{ tag: 'value',
|
|
932
|
+
value: { value: _descriptor_4.toValue(key_0),
|
|
933
|
+
alignment: _descriptor_4.alignment() } }] } },
|
|
934
|
+
{ popeq: { cached: false,
|
|
935
|
+
result: undefined } }]).value);
|
|
907
936
|
},
|
|
908
937
|
[Symbol.iterator](...args_0) {
|
|
909
938
|
if (args_0.length !== 0) {
|
|
910
939
|
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
911
940
|
}
|
|
912
941
|
const self_0 = state.asArray()[1];
|
|
913
|
-
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value),
|
|
942
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value), _descriptor_10.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
914
943
|
}
|
|
915
944
|
},
|
|
916
|
-
|
|
945
|
+
respondCounterMap: {
|
|
917
946
|
isEmpty(...args_0) {
|
|
918
947
|
if (args_0.length !== 0) {
|
|
919
948
|
throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
|
|
@@ -1023,7 +1052,7 @@ export function ledger(stateOrChargedState) {
|
|
|
1023
1052
|
}
|
|
1024
1053
|
}
|
|
1025
1054
|
},
|
|
1026
|
-
|
|
1055
|
+
respondMap: {
|
|
1027
1056
|
isEmpty(...args_0) {
|
|
1028
1057
|
if (args_0.length !== 0) {
|
|
1029
1058
|
throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
|
|
@@ -1105,31 +1134,31 @@ export function ledger(stateOrChargedState) {
|
|
|
1105
1134
|
'struct SignetMapKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
1106
1135
|
key_0)
|
|
1107
1136
|
}
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1137
|
+
return _descriptor_11.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1138
|
+
partialProofData,
|
|
1139
|
+
[
|
|
1140
|
+
{ dup: { n: 0 } },
|
|
1141
|
+
{ idx: { cached: false,
|
|
1142
|
+
pushPath: false,
|
|
1143
|
+
path: [
|
|
1144
|
+
{ tag: 'value',
|
|
1145
|
+
value: { value: _descriptor_6.toValue(3n),
|
|
1146
|
+
alignment: _descriptor_6.alignment() } }] } },
|
|
1147
|
+
{ idx: { cached: false,
|
|
1148
|
+
pushPath: false,
|
|
1149
|
+
path: [
|
|
1150
|
+
{ tag: 'value',
|
|
1151
|
+
value: { value: _descriptor_4.toValue(key_0),
|
|
1152
|
+
alignment: _descriptor_4.alignment() } }] } },
|
|
1153
|
+
{ popeq: { cached: false,
|
|
1154
|
+
result: undefined } }]).value);
|
|
1126
1155
|
},
|
|
1127
1156
|
[Symbol.iterator](...args_0) {
|
|
1128
1157
|
if (args_0.length !== 0) {
|
|
1129
1158
|
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
1130
1159
|
}
|
|
1131
1160
|
const self_0 = state.asArray()[3];
|
|
1132
|
-
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value),
|
|
1161
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value), _descriptor_11.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
1133
1162
|
}
|
|
1134
1163
|
},
|
|
1135
1164
|
respondBidirectionalCounterMap: {
|
|
@@ -1324,7 +1353,7 @@ export function ledger(stateOrChargedState) {
|
|
|
1324
1353
|
'struct SignetMapKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
1325
1354
|
key_0)
|
|
1326
1355
|
}
|
|
1327
|
-
return
|
|
1356
|
+
return _descriptor_8.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1328
1357
|
partialProofData,
|
|
1329
1358
|
[
|
|
1330
1359
|
{ dup: { n: 0 } },
|
|
@@ -1348,7 +1377,7 @@ export function ledger(stateOrChargedState) {
|
|
|
1348
1377
|
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
1349
1378
|
}
|
|
1350
1379
|
const self_0 = state.asArray()[5];
|
|
1351
|
-
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value),
|
|
1380
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_4.fromValue(key.value), _descriptor_8.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
1352
1381
|
}
|
|
1353
1382
|
}
|
|
1354
1383
|
};
|
|
@@ -1361,9 +1390,9 @@ export const pureCircuits = {};
|
|
|
1361
1390
|
export const contractReferenceLocations =
|
|
1362
1391
|
{ tag: 'publicLedgerArray', indices: { } };
|
|
1363
1392
|
export const expectedVk = {
|
|
1364
|
-
'
|
|
1365
|
-
'
|
|
1366
|
-
'
|
|
1393
|
+
'respond': '22938eaebc029fd624db271e92857b132977c0373bf2f9ce823e21d011973e0d',
|
|
1394
|
+
'respondBidirectional': 'aa9b1666e95c9d66f4a8333f8cc72697afe7fd6359a850984e88743a6f667798',
|
|
1395
|
+
'signBidirectional': '3e603e64ac930b8e4e1412e0afb5b3769e3d9db62c3a0bace1fe367eb7dc868e',
|
|
1367
1396
|
};
|
|
1368
1397
|
|
|
1369
1398
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"sourceRoot": "../../../",
|
|
5
5
|
"sources": ["src/signet-contract.compact"],
|
|
6
6
|
"names": [],
|
|
7
|
-
"mappings": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MAoCA,AAAA,iBAyBC;;;;;cAxBK,WAAoB;cACpB,cAAgD;;;;;;;;;;;;;;;;;;;;;;;;;yCADhD,WAAo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