@@ -616,6 +616,41 @@ mod tests {
616
616
assert ! ( !client. account_address( ) . is_empty( ) ) ;
617
617
}
618
618
619
+ #[ tokio:: test]
620
+ async fn test_legacy_identity ( ) {
621
+ let legacy_address = "0x419cb1fa5635b0c6df47c9dc5765c8f1f4dff78e" ;
622
+ let legacy_signed_private_key_proto = vec ! [
623
+ 8 , 128 , 154 , 196 , 133 , 220 , 244 , 197 , 216 , 23 , 18 , 34 , 10 , 32 , 214 , 70 , 104 , 202 , 68 ,
624
+ 204 , 25 , 202 , 197 , 141 , 239 , 159 , 145 , 249 , 55 , 242 , 147 , 126 , 3 , 124 , 159 , 207 , 96 ,
625
+ 135 , 134 , 122 , 60 , 90 , 82 , 171 , 131 , 162 , 26 , 153 , 1 , 10 , 79 , 8 , 128 , 154 , 196 , 133 ,
626
+ 220 , 244 , 197 , 216 , 23 , 26 , 67 , 10 , 65 , 4 , 232 , 32 , 50 , 73 , 113 , 99 , 115 , 168 , 104 ,
627
+ 229 , 206 , 24 , 217 , 132 , 223 , 217 , 91 , 63 , 137 , 136 , 50 , 89 , 82 , 186 , 179 , 150 , 7 , 127 ,
628
+ 140 , 10 , 165 , 117 , 233 , 117 , 196 , 134 , 227 , 143 , 125 , 210 , 187 , 77 , 195 , 169 , 162 , 116 ,
629
+ 34 , 20 , 196 , 145 , 40 , 164 , 246 , 139 , 197 , 154 , 233 , 190 , 148 , 35 , 131 , 240 , 106 , 103 ,
630
+ 18 , 70 , 18 , 68 , 10 , 64 , 90 , 24 , 36 , 99 , 130 , 246 , 134 , 57 , 60 , 34 , 142 , 165 , 221 , 123 ,
631
+ 63 , 27 , 138 , 242 , 195 , 175 , 212 , 146 , 181 , 152 , 89 , 48 , 8 , 70 , 104 , 94 , 163 , 0 , 25 ,
632
+ 196 , 228 , 190 , 49 , 108 , 141 , 60 , 174 , 150 , 177 , 115 , 229 , 138 , 92 , 105 , 170 , 226 , 204 ,
633
+ 249 , 206 , 12 , 37 , 145 , 3 , 35 , 226 , 15 , 49 , 20 , 102 , 60 , 16 , 1 ,
634
+ ] ;
635
+
636
+ let client = create_client (
637
+ Box :: new ( MockLogger { } ) ,
638
+ xmtp_api_grpc:: LOCALHOST_ADDRESS . to_string ( ) ,
639
+ false ,
640
+ Some ( tmp_path ( ) ) ,
641
+ None ,
642
+ legacy_address. to_string ( ) ,
643
+ LegacyIdentitySource :: KeyGenerator ,
644
+ Some ( legacy_signed_private_key_proto) ,
645
+ )
646
+ . await
647
+ . unwrap ( ) ;
648
+
649
+ assert ! ( client. text_to_sign( ) . is_none( ) ) ;
650
+ client. register_identity ( None ) . await . unwrap ( ) ;
651
+ assert_eq ! ( client. account_address( ) , legacy_address) ;
652
+ }
653
+
619
654
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 1 ) ]
620
655
async fn test_create_client_with_storage ( ) {
621
656
let ffi_inbox_owner = LocalWalletInboxOwner :: new ( ) ;
0 commit comments