@@ -289,14 +289,14 @@ impl FromStr for ChainId {
289
289
pub trait Chain {
290
290
const ID : ChainId ;
291
291
292
- type Address : Debuggable + Clone + Eq + Into < Vec < u8 > > = [ u8 ; 20 ] ;
293
- type Amount : Debuggable + Clone + Eq + Into < AssetAmount > = u128 ;
294
- type CashIndex : Debuggable + Clone + Eq + Into < CashIndex > = u128 ;
295
- type Rate : Debuggable + Clone + Eq + Into < APR > = u128 ;
296
- type Timestamp : Debuggable + Clone + Eq + Into < Timestamp > = u64 ;
297
- type Hash : Debuggable + Clone + Eq = [ u8 ; 32 ] ;
298
- type PublicKey : Debuggable + Clone + Eq = [ u8 ; 64 ] ;
299
- type Signature : Debuggable + Clone + Eq = [ u8 ; 65 ] ; // secp256k1 sign
292
+ type Address : Debuggable + Clone + Eq + Into < Vec < u8 > > ;
293
+ type Amount : Debuggable + Clone + Eq + Into < AssetAmount > ;
294
+ type CashIndex : Debuggable + Clone + Eq + Into < CashIndex > ;
295
+ type Rate : Debuggable + Clone + Eq + Into < APR > ;
296
+ type Timestamp : Debuggable + Clone + Eq + Into < Timestamp > ;
297
+ type Hash : Debuggable + Clone + Eq ;
298
+ type PublicKey : Debuggable + Clone + Eq ;
299
+ type Signature : Debuggable + Clone + Eq ;
300
300
type EventId : Debuggable + Clone + Eq + Ord ;
301
301
type Event : Debuggable + Clone + Eq ;
302
302
@@ -331,7 +331,34 @@ pub struct Tezos {}
331
331
impl Chain for Gateway {
332
332
const ID : ChainId = ChainId :: Gate ;
333
333
334
+ #[ type_alias( "Gateway__Chain__" ) ]
335
+ type Address = [ u8 ; 20 ] ;
336
+
337
+ #[ type_alias( "Gateway__Chain__" ) ]
338
+ type Amount = u128 ;
339
+
340
+ #[ type_alias( "Gateway__Chain__" ) ]
341
+ type CashIndex = u128 ;
342
+
343
+ #[ type_alias( "Gateway__Chain__" ) ]
344
+ type Rate = u128 ;
345
+
346
+ #[ type_alias( "Gateway__Chain__" ) ]
347
+ type Timestamp = u64 ;
348
+
349
+ #[ type_alias( "Gateway__Chain__" ) ]
350
+ type Hash = [ u8 ; 32 ] ;
351
+
352
+ #[ type_alias( "Gateway__Chain__" ) ]
353
+ type PublicKey = [ u8 ; 64 ] ;
354
+
355
+ #[ type_alias( "Gateway__Chain__" ) ]
356
+ type Signature = [ u8 ; 65 ] ;
357
+
358
+ #[ type_alias( "Gateway__Chain__" ) ]
334
359
type EventId = comp:: EventId ;
360
+
361
+ #[ type_alias( "Gateway__Chain__" ) ]
335
362
type Event = comp:: Event ;
336
363
337
364
fn zero_hash ( ) -> Self :: Hash {
@@ -466,7 +493,34 @@ impl Chain for Ethereum {
466
493
impl Chain for Polkadot {
467
494
const ID : ChainId = ChainId :: Dot ;
468
495
496
+ #[ type_alias( "Polkadot__Chain__" ) ]
497
+ type Address = [ u8 ; 20 ] ;
498
+
499
+ #[ type_alias( "Polkadot__Chain__" ) ]
500
+ type Amount = u128 ;
501
+
502
+ #[ type_alias( "Polkadot__Chain__" ) ]
503
+ type CashIndex = u128 ;
504
+
505
+ #[ type_alias( "Polkadot__Chain__" ) ]
506
+ type Rate = u128 ;
507
+
508
+ #[ type_alias( "Polkadot__Chain__" ) ]
509
+ type Timestamp = u64 ;
510
+
511
+ #[ type_alias( "Polkadot__Chain__" ) ]
512
+ type Hash = [ u8 ; 32 ] ;
513
+
514
+ #[ type_alias( "Polkadot__Chain__" ) ]
515
+ type PublicKey = [ u8 ; 64 ] ;
516
+
517
+ #[ type_alias( "Polkadot__Chain__" ) ]
518
+ type Signature = [ u8 ; 65 ] ;
519
+
520
+ #[ type_alias( "Polkadot__Chain__" ) ]
469
521
type EventId = dot:: EventId ;
522
+
523
+ #[ type_alias( "Polkadot__Chain__" ) ]
470
524
type Event = dot:: Event ;
471
525
472
526
fn zero_hash ( ) -> Self :: Hash {
@@ -508,7 +562,34 @@ impl Chain for Polkadot {
508
562
impl Chain for Solana {
509
563
const ID : ChainId = ChainId :: Sol ;
510
564
565
+ #[ type_alias( "Solana__Chain__" ) ]
566
+ type Address = [ u8 ; 20 ] ;
567
+
568
+ #[ type_alias( "Solana__Chain__" ) ]
569
+ type Amount = u128 ;
570
+
571
+ #[ type_alias( "Solana__Chain__" ) ]
572
+ type CashIndex = u128 ;
573
+
574
+ #[ type_alias( "Solana__Chain__" ) ]
575
+ type Rate = u128 ;
576
+
577
+ #[ type_alias( "Solana__Chain__" ) ]
578
+ type Timestamp = u64 ;
579
+
580
+ #[ type_alias( "Solana__Chain__" ) ]
581
+ type Hash = [ u8 ; 32 ] ;
582
+
583
+ #[ type_alias( "Solana__Chain__" ) ]
584
+ type PublicKey = [ u8 ; 64 ] ;
585
+
586
+ #[ type_alias( "Solana__Chain__" ) ]
587
+ type Signature = [ u8 ; 65 ] ;
588
+
589
+ #[ type_alias( "Solana__Chain__" ) ]
511
590
type EventId = sol:: EventId ;
591
+
592
+ #[ type_alias( "Solana__Chain__" ) ]
512
593
type Event = sol:: Event ;
513
594
514
595
fn zero_hash ( ) -> Self :: Hash {
@@ -550,7 +631,34 @@ impl Chain for Solana {
550
631
impl Chain for Tezos {
551
632
const ID : ChainId = ChainId :: Tez ;
552
633
634
+ #[ type_alias( "Tezos__Chain__" ) ]
635
+ type Address = [ u8 ; 20 ] ;
636
+
637
+ #[ type_alias( "Tezos__Chain__" ) ]
638
+ type Amount = u128 ;
639
+
640
+ #[ type_alias( "Tezos__Chain__" ) ]
641
+ type CashIndex = u128 ;
642
+
643
+ #[ type_alias( "Tezos__Chain__" ) ]
644
+ type Rate = u128 ;
645
+
646
+ #[ type_alias( "Tezos__Chain__" ) ]
647
+ type Timestamp = u64 ;
648
+
649
+ #[ type_alias( "Tezos__Chain__" ) ]
650
+ type Hash = [ u8 ; 32 ] ;
651
+
652
+ #[ type_alias( "Tezos__Chain__" ) ]
653
+ type PublicKey = [ u8 ; 64 ] ;
654
+
655
+ #[ type_alias( "Tezos__Chain__" ) ]
656
+ type Signature = [ u8 ; 65 ] ;
657
+
658
+ #[ type_alias( "Tezos__Chain__" ) ]
553
659
type EventId = tez:: EventId ;
660
+
661
+ #[ type_alias( "Tezos__Chain__" ) ]
554
662
type Event = tez:: Event ;
555
663
556
664
fn zero_hash ( ) -> Self :: Hash {
@@ -597,6 +705,9 @@ pub mod comp {
597
705
use codec:: { Decode , Encode } ;
598
706
use our_std:: RuntimeDebug ;
599
707
708
+ use types_derive:: type_alias;
709
+
710
+ #[ type_alias( "comp__" ) ]
600
711
pub type EventId = ( u64 , u64 ) ; // XXX
601
712
602
713
#[ derive( Copy , Clone , Eq , PartialEq , Encode , Decode , RuntimeDebug ) ]
@@ -618,13 +729,13 @@ pub mod eth {
618
729
SignatureRecoveryError ,
619
730
}
620
731
621
- #[ type_alias( "Eth__ " ) ]
732
+ #[ type_alias( "eth__ " ) ]
622
733
pub type BlockNumber = u64 ;
623
734
624
- #[ type_alias( "Eth__ " ) ]
735
+ #[ type_alias( "eth__ " ) ]
625
736
pub type LogIndex = u64 ;
626
737
627
- #[ type_alias( "Eth__ " ) ]
738
+ #[ type_alias( "eth__ " ) ]
628
739
pub type EventId = ( BlockNumber , LogIndex ) ;
629
740
630
741
#[ derive( Clone , Eq , PartialEq , Encode , Decode , RuntimeDebug ) ]
@@ -658,6 +769,9 @@ pub mod dot {
658
769
use codec:: { Decode , Encode } ;
659
770
use our_std:: RuntimeDebug ;
660
771
772
+ use types_derive:: type_alias;
773
+
774
+ #[ type_alias( "dot__" ) ]
661
775
pub type EventId = ( u64 , u64 ) ;
662
776
663
777
#[ derive( Copy , Clone , Eq , PartialEq , Encode , Decode , RuntimeDebug ) ]
@@ -668,6 +782,9 @@ pub mod sol {
668
782
use codec:: { Decode , Encode } ;
669
783
use our_std:: RuntimeDebug ;
670
784
785
+ use types_derive:: type_alias;
786
+
787
+ #[ type_alias( "sol__" ) ]
671
788
pub type EventId = ( u64 , u64 ) ;
672
789
673
790
#[ derive( Copy , Clone , Eq , PartialEq , Encode , Decode , RuntimeDebug ) ]
@@ -678,6 +795,9 @@ pub mod tez {
678
795
use codec:: { Decode , Encode } ;
679
796
use our_std:: RuntimeDebug ;
680
797
798
+ use types_derive:: type_alias;
799
+
800
+ #[ type_alias( "tez__" ) ]
681
801
pub type EventId = ( u128 , u128 ) ;
682
802
683
803
#[ derive( Copy , Clone , Eq , PartialEq , Encode , Decode , RuntimeDebug ) ]
0 commit comments