@cofhe/mock-contracts 0.7.1 → 1.0.0-alpha.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.
@@ -0,0 +1,124 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type {
5
+ BaseContract,
6
+ BigNumberish,
7
+ BytesLike,
8
+ FunctionFragment,
9
+ Result,
10
+ Interface,
11
+ EventFragment,
12
+ AddressLike,
13
+ ContractRunner,
14
+ ContractMethod,
15
+ Listener,
16
+ } from 'ethers';
17
+ import type {
18
+ TypedContractEvent,
19
+ TypedDeferredTopicFilter,
20
+ TypedEventLog,
21
+ TypedLogDescription,
22
+ TypedListener,
23
+ TypedContractMethod,
24
+ } from './common';
25
+
26
+ export interface MockCoFHEAddressBookInterface extends Interface {
27
+ getFunction(nameOrSignature: 'exists' | 'getTm' | 'setTm' | 'unsetTm'): FunctionFragment;
28
+
29
+ getEvent(nameOrSignatureOrTopic: 'TaskManagerSet'): EventFragment;
30
+
31
+ encodeFunctionData(functionFragment: 'exists', values?: undefined): string;
32
+ encodeFunctionData(functionFragment: 'getTm', values: [BigNumberish]): string;
33
+ encodeFunctionData(functionFragment: 'setTm', values: [BigNumberish, AddressLike]): string;
34
+ encodeFunctionData(functionFragment: 'unsetTm', values: [BigNumberish]): string;
35
+
36
+ decodeFunctionResult(functionFragment: 'exists', data: BytesLike): Result;
37
+ decodeFunctionResult(functionFragment: 'getTm', data: BytesLike): Result;
38
+ decodeFunctionResult(functionFragment: 'setTm', data: BytesLike): Result;
39
+ decodeFunctionResult(functionFragment: 'unsetTm', data: BytesLike): Result;
40
+ }
41
+
42
+ export namespace TaskManagerSetEvent {
43
+ export type InputTuple = [id: BigNumberish, previous: AddressLike, current: AddressLike];
44
+ export type OutputTuple = [id: bigint, previous: string, current: string];
45
+ export interface OutputObject {
46
+ id: bigint;
47
+ previous: string;
48
+ current: string;
49
+ }
50
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
51
+ export type Filter = TypedDeferredTopicFilter<Event>;
52
+ export type Log = TypedEventLog<Event>;
53
+ export type LogDescription = TypedLogDescription<Event>;
54
+ }
55
+
56
+ export interface MockCoFHEAddressBook extends BaseContract {
57
+ connect(runner?: ContractRunner | null): MockCoFHEAddressBook;
58
+ waitForDeployment(): Promise<this>;
59
+
60
+ interface: MockCoFHEAddressBookInterface;
61
+
62
+ queryFilter<TCEvent extends TypedContractEvent>(
63
+ event: TCEvent,
64
+ fromBlockOrBlockhash?: string | number | undefined,
65
+ toBlock?: string | number | undefined
66
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
67
+ queryFilter<TCEvent extends TypedContractEvent>(
68
+ filter: TypedDeferredTopicFilter<TCEvent>,
69
+ fromBlockOrBlockhash?: string | number | undefined,
70
+ toBlock?: string | number | undefined
71
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
72
+
73
+ on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
74
+ on<TCEvent extends TypedContractEvent>(
75
+ filter: TypedDeferredTopicFilter<TCEvent>,
76
+ listener: TypedListener<TCEvent>
77
+ ): Promise<this>;
78
+
79
+ once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
80
+ once<TCEvent extends TypedContractEvent>(
81
+ filter: TypedDeferredTopicFilter<TCEvent>,
82
+ listener: TypedListener<TCEvent>
83
+ ): Promise<this>;
84
+
85
+ listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
86
+ listeners(eventName?: string): Promise<Array<Listener>>;
87
+ removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
88
+
89
+ exists: TypedContractMethod<[], [boolean], 'view'>;
90
+
91
+ getTm: TypedContractMethod<[id: BigNumberish], [string], 'view'>;
92
+
93
+ setTm: TypedContractMethod<[id: BigNumberish, tm: AddressLike], [void], 'nonpayable'>;
94
+
95
+ unsetTm: TypedContractMethod<[id: BigNumberish], [void], 'nonpayable'>;
96
+
97
+ getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
98
+
99
+ getFunction(nameOrSignature: 'exists'): TypedContractMethod<[], [boolean], 'view'>;
100
+ getFunction(nameOrSignature: 'getTm'): TypedContractMethod<[id: BigNumberish], [string], 'view'>;
101
+ getFunction(nameOrSignature: 'setTm'): TypedContractMethod<[id: BigNumberish, tm: AddressLike], [void], 'nonpayable'>;
102
+ getFunction(nameOrSignature: 'unsetTm'): TypedContractMethod<[id: BigNumberish], [void], 'nonpayable'>;
103
+
104
+ getEvent(
105
+ key: 'TaskManagerSet'
106
+ ): TypedContractEvent<
107
+ TaskManagerSetEvent.InputTuple,
108
+ TaskManagerSetEvent.OutputTuple,
109
+ TaskManagerSetEvent.OutputObject
110
+ >;
111
+
112
+ filters: {
113
+ 'TaskManagerSet(uint256,address,address)': TypedContractEvent<
114
+ TaskManagerSetEvent.InputTuple,
115
+ TaskManagerSetEvent.OutputTuple,
116
+ TaskManagerSetEvent.OutputObject
117
+ >;
118
+ TaskManagerSet: TypedContractEvent<
119
+ TaskManagerSetEvent.InputTuple,
120
+ TaskManagerSetEvent.OutputTuple,
121
+ TaskManagerSetEvent.OutputObject
122
+ >;
123
+ };
124
+ }
@@ -0,0 +1,85 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type {
5
+ BaseContract,
6
+ FunctionFragment,
7
+ Interface,
8
+ EventFragment,
9
+ AddressLike,
10
+ ContractRunner,
11
+ ContractMethod,
12
+ Listener,
13
+ } from 'ethers';
14
+ import type {
15
+ TypedContractEvent,
16
+ TypedDeferredTopicFilter,
17
+ TypedEventLog,
18
+ TypedLogDescription,
19
+ TypedListener,
20
+ } from './common';
21
+
22
+ export interface MockERC1967ProxyInterface extends Interface {
23
+ getEvent(nameOrSignatureOrTopic: 'Upgraded'): EventFragment;
24
+ }
25
+
26
+ export namespace UpgradedEvent {
27
+ export type InputTuple = [implementation: AddressLike];
28
+ export type OutputTuple = [implementation: string];
29
+ export interface OutputObject {
30
+ implementation: string;
31
+ }
32
+ export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
33
+ export type Filter = TypedDeferredTopicFilter<Event>;
34
+ export type Log = TypedEventLog<Event>;
35
+ export type LogDescription = TypedLogDescription<Event>;
36
+ }
37
+
38
+ export interface MockERC1967Proxy extends BaseContract {
39
+ connect(runner?: ContractRunner | null): MockERC1967Proxy;
40
+ waitForDeployment(): Promise<this>;
41
+
42
+ interface: MockERC1967ProxyInterface;
43
+
44
+ queryFilter<TCEvent extends TypedContractEvent>(
45
+ event: TCEvent,
46
+ fromBlockOrBlockhash?: string | number | undefined,
47
+ toBlock?: string | number | undefined
48
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
49
+ queryFilter<TCEvent extends TypedContractEvent>(
50
+ filter: TypedDeferredTopicFilter<TCEvent>,
51
+ fromBlockOrBlockhash?: string | number | undefined,
52
+ toBlock?: string | number | undefined
53
+ ): Promise<Array<TypedEventLog<TCEvent>>>;
54
+
55
+ on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
56
+ on<TCEvent extends TypedContractEvent>(
57
+ filter: TypedDeferredTopicFilter<TCEvent>,
58
+ listener: TypedListener<TCEvent>
59
+ ): Promise<this>;
60
+
61
+ once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
62
+ once<TCEvent extends TypedContractEvent>(
63
+ filter: TypedDeferredTopicFilter<TCEvent>,
64
+ listener: TypedListener<TCEvent>
65
+ ): Promise<this>;
66
+
67
+ listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
68
+ listeners(eventName?: string): Promise<Array<Listener>>;
69
+ removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
70
+
71
+ getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
72
+
73
+ getEvent(
74
+ key: 'Upgraded'
75
+ ): TypedContractEvent<UpgradedEvent.InputTuple, UpgradedEvent.OutputTuple, UpgradedEvent.OutputObject>;
76
+
77
+ filters: {
78
+ 'Upgraded(address)': TypedContractEvent<
79
+ UpgradedEvent.InputTuple,
80
+ UpgradedEvent.OutputTuple,
81
+ UpgradedEvent.OutputObject
82
+ >;
83
+ Upgraded: TypedContractEvent<UpgradedEvent.InputTuple, UpgradedEvent.OutputTuple, UpgradedEvent.OutputObject>;
84
+ };
85
+ }
@@ -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(nameOrSignatureOrTopic: 'DecryptionResult' | 'ProtocolNotification' | 'TaskCreated'): EventFragment;
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,8 @@
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';
8
+ export type { MockERC1967Proxy } from './MockERC1967Proxy';
7
9
  export type { MockTaskManager } from './MockTaskManager';
8
10
  export type { MockThresholdNetwork } from './MockThresholdNetwork';
9
11
  export type { MockZkVerifier } from './MockZkVerifier';