2
2
#![ allow( missing_docs) ]
3
3
use alloy_primitives:: { Address , Bytes , FixedBytes , U256 } ;
4
4
use alloy_sol_types:: sol;
5
- use HostOrders :: TokenPermissions ;
6
5
7
6
sol ! (
8
7
#[ sol( rpc) ]
21
20
sol ! (
22
21
#[ sol( rpc) ]
23
22
#[ derive( Debug , PartialEq , Eq , serde:: Serialize , serde:: Deserialize ) ]
24
- HostOrders ,
25
- "abi/HostOrders.json"
26
- ) ;
27
-
28
- sol ! (
29
- #[ sol( rpc) ]
30
- #[ derive( Debug , PartialEq , Eq , serde:: Serialize , serde:: Deserialize ) ]
31
- RollupOrders ,
23
+ Orders ,
32
24
"abi/RollupOrders.json"
33
25
) ;
34
26
46
38
"abi/RollupPassage.json"
47
39
) ;
48
40
41
+ /// Module alias for [`Orders`].
42
+ #[ allow( non_snake_case) ]
43
+ pub mod RollupOrders {
44
+ pub use super :: Orders :: OrdersCalls as RollupOrdersCalls ;
45
+ pub use super :: Orders :: OrdersErrors as RollupOrdersErrors ;
46
+ pub use super :: Orders :: OrdersEvents as RollupOrdersEvents ;
47
+ pub use super :: Orders :: OrdersInstance as RollupOrdersInstance ;
48
+ pub use super :: Orders :: * ;
49
+ }
50
+
51
+ /// Module alias for [`Orders`].
52
+ #[ allow( non_snake_case) ]
53
+ pub mod HostOrders {
54
+ pub use super :: Orders :: OrdersCalls as HostOrdersCalls ;
55
+ pub use super :: Orders :: OrdersErrors as HostOrdersErrors ;
56
+ pub use super :: Orders :: OrdersEvents as HostOrdersEvents ;
57
+ pub use super :: Orders :: OrdersInstance as HostOrdersInstance ;
58
+ pub use super :: Orders :: * ;
59
+ }
60
+
49
61
// Zenith types
50
62
impl Copy for Zenith :: BlockHeader { }
51
63
impl Copy for Zenith :: BlockSubmitted { }
@@ -220,144 +232,29 @@ impl Passage::EnterConfigured {
220
232
}
221
233
}
222
234
223
- // HostOrders types
224
-
225
- impl Copy for HostOrders :: Output { }
226
- impl Copy for HostOrders :: TokenPermissions { }
227
- impl Copy for HostOrders :: AddressEmptyCode { }
228
- impl Copy for HostOrders :: FailedCall { }
229
- impl Copy for HostOrders :: InsufficientBalance { }
230
- impl Copy for HostOrders :: ReentrancyGuardReentrantCall { }
231
- impl Copy for HostOrders :: LengthMismatch { }
232
- impl Copy for HostOrders :: OutputMismatch { }
233
- impl Copy for HostOrders :: SafeERC20FailedOperation { }
234
-
235
- impl Clone for HostOrders :: HostOrdersEvents {
236
- fn clone ( & self ) -> Self {
237
- match self {
238
- HostOrders :: HostOrdersEvents :: Filled ( event) => {
239
- HostOrders :: HostOrdersEvents :: Filled ( event. clone ( ) )
240
- }
241
- }
242
- }
243
- }
244
-
245
- impl HostOrders :: Output {
246
- /// Get the token address of the output.
247
- pub const fn token ( & self ) -> Address {
248
- self . token
249
- }
250
-
251
- /// Get the recipient of the output.
252
- pub const fn recipient ( & self ) -> Address {
253
- self . recipient
254
- }
255
-
256
- /// Get the amount of the output.
257
- pub const fn amount ( & self ) -> U256 {
258
- self . amount
259
- }
260
-
261
- /// Get the chain ID of the output.
262
- pub const fn chain_id ( & self ) -> u32 {
263
- self . chainId
264
- }
265
- }
266
-
267
- impl HostOrders :: TokenPermissions {
268
- /// Get the token address of the output.
269
- pub const fn token ( & self ) -> Address {
270
- self . token
271
- }
272
-
273
- /// Get the amount of the output.
274
- pub const fn amount ( & self ) -> U256 {
275
- self . amount
276
- }
277
- }
278
-
279
- impl HostOrders :: Witness {
280
- /// Get the witness hash of the witness.
281
- pub const fn witness_hash ( & self ) -> FixedBytes < 32 > {
282
- self . witnessHash
283
- }
284
-
285
- /// Get the witness type string.
286
- pub fn witness_type ( & self ) -> String {
287
- self . witnessTypeString . clone ( )
288
- }
289
- }
290
-
291
- impl HostOrders :: Filled {
292
- /// Get the outputs of the filled order.
293
- pub fn outputs ( & self ) -> & [ HostOrders :: Output ] {
294
- & self . outputs
295
- }
296
- }
297
-
298
- impl HostOrders :: PermitBatchTransferFrom {
299
- /// Get the permitted tokens of the batch transfer permit.
300
- pub fn permitted ( & self ) -> & [ TokenPermissions ] {
301
- & self . permitted
302
- }
303
-
304
- /// Get the nonce of the batch transfer permit.
305
- pub const fn nonce ( & self ) -> U256 {
306
- self . nonce
307
- }
308
-
309
- /// Get the deadline of the batch transfer permit.
310
- pub const fn deadline ( & self ) -> U256 {
311
- self . deadline
312
- }
313
- }
314
-
315
- impl HostOrders :: Permit2Batch {
316
- /// Get the permitted tokens of the batch transfer permit.
317
- pub const fn permit ( & self ) -> & HostOrders :: PermitBatchTransferFrom {
318
- & self . permit
319
- }
320
-
321
- /// Get the owner of the permit.
322
- pub const fn owner ( & self ) -> Address {
323
- self . owner
324
- }
325
-
326
- /// Get the signature of the permit.
327
- pub fn signature ( & self ) -> Bytes {
328
- self . signature . clone ( )
329
- }
330
- }
331
-
332
235
// RollupOrders types
333
236
334
- impl Copy for RollupOrders :: Input { }
335
- impl Copy for RollupOrders :: Output { }
336
- impl Copy for RollupOrders :: Sweep { }
337
- impl Copy for RollupOrders :: InsufficientBalance { }
338
- impl Copy for RollupOrders :: AddressEmptyCode { }
339
- impl Copy for RollupOrders :: LengthMismatch { }
340
- impl Copy for RollupOrders :: OrderExpired { }
341
- impl Copy for RollupOrders :: OutputMismatch { }
342
- impl Copy for RollupOrders :: SafeERC20FailedOperation { }
343
-
344
- impl Clone for RollupOrders :: RollupOrdersEvents {
237
+ impl Copy for Orders :: Input { }
238
+ impl Copy for Orders :: Output { }
239
+ impl Copy for Orders :: Sweep { }
240
+ impl Copy for Orders :: InsufficientBalance { }
241
+ impl Copy for Orders :: AddressEmptyCode { }
242
+ impl Copy for Orders :: LengthMismatch { }
243
+ impl Copy for Orders :: OrderExpired { }
244
+ impl Copy for Orders :: OutputMismatch { }
245
+ impl Copy for Orders :: SafeERC20FailedOperation { }
246
+
247
+ impl Clone for Orders :: OrdersEvents {
345
248
fn clone ( & self ) -> Self {
346
249
match self {
347
- RollupOrders :: RollupOrdersEvents :: Order ( event) => {
348
- RollupOrders :: RollupOrdersEvents :: Order ( event. clone ( ) )
349
- }
350
- RollupOrders :: RollupOrdersEvents :: Sweep ( event) => {
351
- RollupOrders :: RollupOrdersEvents :: Sweep ( * event)
352
- }
353
- RollupOrders :: RollupOrdersEvents :: Filled ( event) => {
354
- RollupOrders :: RollupOrdersEvents :: Filled ( event. clone ( ) )
355
- }
250
+ Self :: Order ( event) => Self :: Order ( event. clone ( ) ) ,
251
+ Self :: Sweep ( event) => Self :: Sweep ( * event) ,
252
+ Self :: Filled ( event) => Self :: Filled ( event. clone ( ) ) ,
356
253
}
357
254
}
358
255
}
359
256
360
- impl RollupOrders :: Input {
257
+ impl Orders :: Input {
361
258
pub const fn token ( & self ) -> Address {
362
259
self . token
363
260
}
@@ -367,7 +264,7 @@ impl RollupOrders::Input {
367
264
}
368
265
}
369
266
370
- impl RollupOrders :: Output {
267
+ impl Orders :: Output {
371
268
pub const fn token ( & self ) -> Address {
372
269
self . token
373
270
}
@@ -385,14 +282,14 @@ impl RollupOrders::Output {
385
282
}
386
283
}
387
284
388
- impl RollupOrders :: Order {
285
+ impl Orders :: Order {
389
286
/// Get the inputs of the order.
390
- pub fn inputs ( & self ) -> & [ RollupOrders :: Input ] {
287
+ pub fn inputs ( & self ) -> & [ Orders :: Input ] {
391
288
& self . inputs
392
289
}
393
290
394
291
/// Get the outputs of the order.
395
- pub fn outputs ( & self ) -> & [ RollupOrders :: Output ] {
292
+ pub fn outputs ( & self ) -> & [ Orders :: Output ] {
396
293
& self . outputs
397
294
}
398
295
@@ -402,7 +299,7 @@ impl RollupOrders::Order {
402
299
}
403
300
}
404
301
405
- impl RollupOrders :: Sweep {
302
+ impl Orders :: Sweep {
406
303
pub const fn recipient ( & self ) -> Address {
407
304
self . recipient
408
305
}
@@ -416,8 +313,8 @@ impl RollupOrders::Sweep {
416
313
}
417
314
}
418
315
419
- impl RollupOrders :: Filled {
420
- pub fn outputs ( & self ) -> & [ RollupOrders :: Output ] {
316
+ impl Orders :: Filled {
317
+ pub fn outputs ( & self ) -> & [ Orders :: Output ] {
421
318
self . outputs . as_slice ( )
422
319
}
423
320
}
0 commit comments