@cofhe/mock-contracts 0.7.1 → 0.8.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/CHANGELOG.md +12 -0
- package/README.md +10 -0
- package/contracts/MockACL.sol +33 -15
- package/contracts/MockCoFHE.sol +165 -74
- package/contracts/MockCoFHEAddressBook.sol +64 -0
- package/contracts/MockTaskManager.sol +74 -24
- package/contracts/MockZkVerifier.sol +2 -2
- package/dist/index.d.mts +291 -20
- package/dist/index.d.ts +291 -20
- package/dist/index.js +224 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +224 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/MockACL.ts +37 -13
- package/src/MockCoFHEAddressBook.ts +114 -0
- package/src/MockTaskManager.ts +73 -1
- package/src/index.ts +2 -0
- package/src/typechain-types/MockACL.ts +38 -6
- package/src/typechain-types/MockCoFHEAddressBook.ts +124 -0
- package/src/typechain-types/MockTaskManager.ts +66 -1
- package/src/typechain-types/index.ts +1 -0
|
@@ -78,6 +78,7 @@ export type ACPStructOutput = [
|
|
|
78
78
|
export interface MockTaskManagerInterface extends Interface {
|
|
79
79
|
getFunction(
|
|
80
80
|
nameOrSignature:
|
|
81
|
+
| 'MOCK_dispatchOperation'
|
|
81
82
|
| 'MOCK_logAllow'
|
|
82
83
|
| 'MOCK_setInEuintKey'
|
|
83
84
|
| 'acl'
|
|
@@ -103,6 +104,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
103
104
|
| 'isInitialized'
|
|
104
105
|
| 'isPubliclyAllowed'
|
|
105
106
|
| 'logOps'
|
|
107
|
+
| 'mockGasExcluded'
|
|
106
108
|
| 'mockStorage'
|
|
107
109
|
| 'publishDecryptResult'
|
|
108
110
|
| 'publishDecryptResultBatch'
|
|
@@ -112,6 +114,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
112
114
|
| 'setAggregator'
|
|
113
115
|
| 'setDecryptResultSigner'
|
|
114
116
|
| 'setLogOps'
|
|
117
|
+
| 'setMockGasExcluded'
|
|
115
118
|
| 'setSecurityZoneMax'
|
|
116
119
|
| 'setSecurityZoneMin'
|
|
117
120
|
| 'setSecurityZones'
|
|
@@ -124,8 +127,14 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
124
127
|
| 'verifyDecryptResultSafe'
|
|
125
128
|
): FunctionFragment;
|
|
126
129
|
|
|
127
|
-
getEvent(
|
|
130
|
+
getEvent(
|
|
131
|
+
nameOrSignatureOrTopic: 'DecryptionResult' | 'MockGasConsumed' | 'ProtocolNotification' | 'TaskCreated'
|
|
132
|
+
): EventFragment;
|
|
128
133
|
|
|
134
|
+
encodeFunctionData(
|
|
135
|
+
functionFragment: 'MOCK_dispatchOperation',
|
|
136
|
+
values: [BigNumberish, BigNumberish, BigNumberish[], BigNumberish]
|
|
137
|
+
): string;
|
|
129
138
|
encodeFunctionData(functionFragment: 'MOCK_logAllow', values: [string, BigNumberish, AddressLike]): string;
|
|
130
139
|
encodeFunctionData(functionFragment: 'MOCK_setInEuintKey', values: [BigNumberish, BigNumberish]): string;
|
|
131
140
|
encodeFunctionData(functionFragment: 'acl', values?: undefined): string;
|
|
@@ -160,6 +169,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
160
169
|
encodeFunctionData(functionFragment: 'isInitialized', values?: undefined): string;
|
|
161
170
|
encodeFunctionData(functionFragment: 'isPubliclyAllowed', values: [BigNumberish]): string;
|
|
162
171
|
encodeFunctionData(functionFragment: 'logOps', values?: undefined): string;
|
|
172
|
+
encodeFunctionData(functionFragment: 'mockGasExcluded', values?: undefined): string;
|
|
163
173
|
encodeFunctionData(functionFragment: 'mockStorage', values: [BigNumberish]): string;
|
|
164
174
|
encodeFunctionData(functionFragment: 'publishDecryptResult', values: [BigNumberish, BigNumberish, BytesLike]): string;
|
|
165
175
|
encodeFunctionData(
|
|
@@ -172,6 +182,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
172
182
|
encodeFunctionData(functionFragment: 'setAggregator', values: [AddressLike]): string;
|
|
173
183
|
encodeFunctionData(functionFragment: 'setDecryptResultSigner', values: [AddressLike]): string;
|
|
174
184
|
encodeFunctionData(functionFragment: 'setLogOps', values: [boolean]): string;
|
|
185
|
+
encodeFunctionData(functionFragment: 'setMockGasExcluded', values: [boolean]): string;
|
|
175
186
|
encodeFunctionData(functionFragment: 'setSecurityZoneMax', values: [BigNumberish]): string;
|
|
176
187
|
encodeFunctionData(functionFragment: 'setSecurityZoneMin', values: [BigNumberish]): string;
|
|
177
188
|
encodeFunctionData(functionFragment: 'setSecurityZones', values: [BigNumberish, BigNumberish]): string;
|
|
@@ -192,6 +203,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
192
203
|
values: [BigNumberish, BigNumberish, BytesLike]
|
|
193
204
|
): string;
|
|
194
205
|
|
|
206
|
+
decodeFunctionResult(functionFragment: 'MOCK_dispatchOperation', data: BytesLike): Result;
|
|
195
207
|
decodeFunctionResult(functionFragment: 'MOCK_logAllow', data: BytesLike): Result;
|
|
196
208
|
decodeFunctionResult(functionFragment: 'MOCK_setInEuintKey', data: BytesLike): Result;
|
|
197
209
|
decodeFunctionResult(functionFragment: 'acl', data: BytesLike): Result;
|
|
@@ -217,6 +229,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
217
229
|
decodeFunctionResult(functionFragment: 'isInitialized', data: BytesLike): Result;
|
|
218
230
|
decodeFunctionResult(functionFragment: 'isPubliclyAllowed', data: BytesLike): Result;
|
|
219
231
|
decodeFunctionResult(functionFragment: 'logOps', data: BytesLike): Result;
|
|
232
|
+
decodeFunctionResult(functionFragment: 'mockGasExcluded', data: BytesLike): Result;
|
|
220
233
|
decodeFunctionResult(functionFragment: 'mockStorage', data: BytesLike): Result;
|
|
221
234
|
decodeFunctionResult(functionFragment: 'publishDecryptResult', data: BytesLike): Result;
|
|
222
235
|
decodeFunctionResult(functionFragment: 'publishDecryptResultBatch', data: BytesLike): Result;
|
|
@@ -226,6 +239,7 @@ export interface MockTaskManagerInterface extends Interface {
|
|
|
226
239
|
decodeFunctionResult(functionFragment: 'setAggregator', data: BytesLike): Result;
|
|
227
240
|
decodeFunctionResult(functionFragment: 'setDecryptResultSigner', data: BytesLike): Result;
|
|
228
241
|
decodeFunctionResult(functionFragment: 'setLogOps', data: BytesLike): Result;
|
|
242
|
+
decodeFunctionResult(functionFragment: 'setMockGasExcluded', data: BytesLike): Result;
|
|
229
243
|
decodeFunctionResult(functionFragment: 'setSecurityZoneMax', data: BytesLike): Result;
|
|
230
244
|
decodeFunctionResult(functionFragment: 'setSecurityZoneMin', data: BytesLike): Result;
|
|
231
245
|
decodeFunctionResult(functionFragment: 'setSecurityZones', data: BytesLike): Result;
|
|
@@ -252,6 +266,18 @@ export namespace DecryptionResultEvent {
|
|
|
252
266
|
export type LogDescription = TypedLogDescription<Event>;
|
|
253
267
|
}
|
|
254
268
|
|
|
269
|
+
export namespace MockGasConsumedEvent {
|
|
270
|
+
export type InputTuple = [gas: BigNumberish];
|
|
271
|
+
export type OutputTuple = [gas: bigint];
|
|
272
|
+
export interface OutputObject {
|
|
273
|
+
gas: bigint;
|
|
274
|
+
}
|
|
275
|
+
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
276
|
+
export type Filter = TypedDeferredTopicFilter<Event>;
|
|
277
|
+
export type Log = TypedEventLog<Event>;
|
|
278
|
+
export type LogDescription = TypedLogDescription<Event>;
|
|
279
|
+
}
|
|
280
|
+
|
|
255
281
|
export namespace ProtocolNotificationEvent {
|
|
256
282
|
export type InputTuple = [ctHash: BigNumberish, operation: string, errorMessage: string];
|
|
257
283
|
export type OutputTuple = [ctHash: bigint, operation: string, errorMessage: string];
|
|
@@ -321,6 +347,12 @@ export interface MockTaskManager extends BaseContract {
|
|
|
321
347
|
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
322
348
|
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
323
349
|
|
|
350
|
+
MOCK_dispatchOperation: TypedContractMethod<
|
|
351
|
+
[ctHash: BigNumberish, funcId: BigNumberish, inputs: BigNumberish[], arity: BigNumberish],
|
|
352
|
+
[void],
|
|
353
|
+
'nonpayable'
|
|
354
|
+
>;
|
|
355
|
+
|
|
324
356
|
MOCK_logAllow: TypedContractMethod<[operation: string, ctHash: BigNumberish, account: AddressLike], [void], 'view'>;
|
|
325
357
|
|
|
326
358
|
MOCK_setInEuintKey: TypedContractMethod<[ctHash: BigNumberish, value: BigNumberish], [void], 'nonpayable'>;
|
|
@@ -395,6 +427,8 @@ export interface MockTaskManager extends BaseContract {
|
|
|
395
427
|
|
|
396
428
|
logOps: TypedContractMethod<[], [boolean], 'view'>;
|
|
397
429
|
|
|
430
|
+
mockGasExcluded: TypedContractMethod<[], [boolean], 'view'>;
|
|
431
|
+
|
|
398
432
|
mockStorage: TypedContractMethod<[arg0: BigNumberish], [bigint], 'view'>;
|
|
399
433
|
|
|
400
434
|
publishDecryptResult: TypedContractMethod<
|
|
@@ -421,6 +455,8 @@ export interface MockTaskManager extends BaseContract {
|
|
|
421
455
|
|
|
422
456
|
setLogOps: TypedContractMethod<[_logOps: boolean], [void], 'nonpayable'>;
|
|
423
457
|
|
|
458
|
+
setMockGasExcluded: TypedContractMethod<[_mockGasExcluded: boolean], [void], 'nonpayable'>;
|
|
459
|
+
|
|
424
460
|
setSecurityZoneMax: TypedContractMethod<[securityZone: BigNumberish], [void], 'nonpayable'>;
|
|
425
461
|
|
|
426
462
|
setSecurityZoneMin: TypedContractMethod<[securityZone: BigNumberish], [void], 'nonpayable'>;
|
|
@@ -459,6 +495,13 @@ export interface MockTaskManager extends BaseContract {
|
|
|
459
495
|
|
|
460
496
|
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
461
497
|
|
|
498
|
+
getFunction(
|
|
499
|
+
nameOrSignature: 'MOCK_dispatchOperation'
|
|
500
|
+
): TypedContractMethod<
|
|
501
|
+
[ctHash: BigNumberish, funcId: BigNumberish, inputs: BigNumberish[], arity: BigNumberish],
|
|
502
|
+
[void],
|
|
503
|
+
'nonpayable'
|
|
504
|
+
>;
|
|
462
505
|
getFunction(
|
|
463
506
|
nameOrSignature: 'MOCK_logAllow'
|
|
464
507
|
): TypedContractMethod<[operation: string, ctHash: BigNumberish, account: AddressLike], [void], 'view'>;
|
|
@@ -522,6 +565,7 @@ export interface MockTaskManager extends BaseContract {
|
|
|
522
565
|
getFunction(nameOrSignature: 'isInitialized'): TypedContractMethod<[], [boolean], 'view'>;
|
|
523
566
|
getFunction(nameOrSignature: 'isPubliclyAllowed'): TypedContractMethod<[ctHash: BigNumberish], [boolean], 'view'>;
|
|
524
567
|
getFunction(nameOrSignature: 'logOps'): TypedContractMethod<[], [boolean], 'view'>;
|
|
568
|
+
getFunction(nameOrSignature: 'mockGasExcluded'): TypedContractMethod<[], [boolean], 'view'>;
|
|
525
569
|
getFunction(nameOrSignature: 'mockStorage'): TypedContractMethod<[arg0: BigNumberish], [bigint], 'view'>;
|
|
526
570
|
getFunction(
|
|
527
571
|
nameOrSignature: 'publishDecryptResult'
|
|
@@ -545,6 +589,9 @@ export interface MockTaskManager extends BaseContract {
|
|
|
545
589
|
nameOrSignature: 'setDecryptResultSigner'
|
|
546
590
|
): TypedContractMethod<[signer: AddressLike], [void], 'nonpayable'>;
|
|
547
591
|
getFunction(nameOrSignature: 'setLogOps'): TypedContractMethod<[_logOps: boolean], [void], 'nonpayable'>;
|
|
592
|
+
getFunction(
|
|
593
|
+
nameOrSignature: 'setMockGasExcluded'
|
|
594
|
+
): TypedContractMethod<[_mockGasExcluded: boolean], [void], 'nonpayable'>;
|
|
548
595
|
getFunction(
|
|
549
596
|
nameOrSignature: 'setSecurityZoneMax'
|
|
550
597
|
): TypedContractMethod<[securityZone: BigNumberish], [void], 'nonpayable'>;
|
|
@@ -589,6 +636,13 @@ export interface MockTaskManager extends BaseContract {
|
|
|
589
636
|
DecryptionResultEvent.OutputTuple,
|
|
590
637
|
DecryptionResultEvent.OutputObject
|
|
591
638
|
>;
|
|
639
|
+
getEvent(
|
|
640
|
+
key: 'MockGasConsumed'
|
|
641
|
+
): TypedContractEvent<
|
|
642
|
+
MockGasConsumedEvent.InputTuple,
|
|
643
|
+
MockGasConsumedEvent.OutputTuple,
|
|
644
|
+
MockGasConsumedEvent.OutputObject
|
|
645
|
+
>;
|
|
592
646
|
getEvent(
|
|
593
647
|
key: 'ProtocolNotification'
|
|
594
648
|
): TypedContractEvent<
|
|
@@ -612,6 +666,17 @@ export interface MockTaskManager extends BaseContract {
|
|
|
612
666
|
DecryptionResultEvent.OutputObject
|
|
613
667
|
>;
|
|
614
668
|
|
|
669
|
+
'MockGasConsumed(uint256)': TypedContractEvent<
|
|
670
|
+
MockGasConsumedEvent.InputTuple,
|
|
671
|
+
MockGasConsumedEvent.OutputTuple,
|
|
672
|
+
MockGasConsumedEvent.OutputObject
|
|
673
|
+
>;
|
|
674
|
+
MockGasConsumed: TypedContractEvent<
|
|
675
|
+
MockGasConsumedEvent.InputTuple,
|
|
676
|
+
MockGasConsumedEvent.OutputTuple,
|
|
677
|
+
MockGasConsumedEvent.OutputObject
|
|
678
|
+
>;
|
|
679
|
+
|
|
615
680
|
'ProtocolNotification(uint256,string,string)': TypedContractEvent<
|
|
616
681
|
ProtocolNotificationEvent.InputTuple,
|
|
617
682
|
ProtocolNotificationEvent.OutputTuple,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export type { ACPShareRegistry } from './ACPShareRegistry';
|
|
5
5
|
export type { ACPTimestampRevoker } from './ACPTimestampRevoker';
|
|
6
6
|
export type { MockACL } from './MockACL';
|
|
7
|
+
export type { MockCoFHEAddressBook } from './MockCoFHEAddressBook';
|
|
7
8
|
export type { MockTaskManager } from './MockTaskManager';
|
|
8
9
|
export type { MockThresholdNetwork } from './MockThresholdNetwork';
|
|
9
10
|
export type { MockZkVerifier } from './MockZkVerifier';
|