@@ -127,6 +127,19 @@ pub enum TrustedCall {
127
127
remove_identity( Identity , Identity , Identity , H256 ) ,
128
128
request_vc( Identity , Identity , Assertion , H256 ) ,
129
129
set_identity_networks( Identity , Identity , Identity , Vec < Web3Network > ) ,
130
+ // a hotfix to work around the "too long encoded call size" problem
131
+ // it's similiar to `link_identity`, but with reduced parameters:
132
+ // - the first identity is the prime identity, whose signature is required
133
+ // - the second identity is the to-be-linked identity
134
+ // in this sense, it can only be called via DI
135
+ link_identity_short(
136
+ Identity ,
137
+ Identity ,
138
+ ValidationData ,
139
+ Vec < Web3Network > ,
140
+ UserShieldingKeyNonceType ,
141
+ H256 ,
142
+ ) ,
130
143
set_user_shielding_key_with_networks(
131
144
Identity ,
132
145
Identity ,
@@ -167,6 +180,7 @@ impl TrustedCall {
167
180
TrustedCall :: set_identity_networks( sender_identity, ..) => sender_identity,
168
181
TrustedCall :: set_user_shielding_key_with_networks( sender_identity, ..) =>
169
182
sender_identity,
183
+ TrustedCall :: link_identity_short( sender_identity, ..) => sender_identity,
170
184
TrustedCall :: link_identity_callback( sender_identity, ..) => sender_identity,
171
185
TrustedCall :: request_vc_callback( sender_identity, ..) => sender_identity,
172
186
TrustedCall :: handle_imp_error( sender_identity, ..) => sender_identity,
@@ -564,6 +578,38 @@ where
564
578
}
565
579
Ok ( ( ) )
566
580
} ,
581
+ TrustedCall :: link_identity_short(
582
+ signer,
583
+ identity,
584
+ validation_data,
585
+ web3networks,
586
+ nonce,
587
+ hash,
588
+ ) => {
589
+ debug ! ( "link_identity_short, who: {}" , account_id_to_string( & signer) ) ;
590
+
591
+ if let Err ( e) = Self :: link_identity_internal (
592
+ signer. to_account_id ( ) . ok_or ( Self :: Error :: InvalidAccount ) ?,
593
+ signer. clone ( ) ,
594
+ identity,
595
+ validation_data,
596
+ web3networks,
597
+ nonce,
598
+ hash,
599
+ shard,
600
+ ) {
601
+ add_call_from_imp_error (
602
+ calls,
603
+ node_metadata_repo,
604
+ Some ( SgxParentchainTypeConverter :: convert (
605
+ signer. to_account_id ( ) . ok_or ( Self :: Error :: InvalidAccount ) ?,
606
+ ) ) ,
607
+ e. to_imp_error ( ) ,
608
+ hash,
609
+ ) ;
610
+ }
611
+ Ok ( ( ) )
612
+ } ,
567
613
TrustedCall :: remove_identity( signer, who, identity, hash) => {
568
614
debug ! ( "remove_identity, who: {}" , account_id_to_string( & who) ) ;
569
615
let account = SgxParentchainTypeConverter :: convert (
@@ -778,6 +824,7 @@ where
778
824
TrustedCall :: link_identity_callback( ..) => debug ! ( "No storage updates needed..." ) ,
779
825
TrustedCall :: request_vc_callback( ..) => debug ! ( "No storage updates needed..." ) ,
780
826
TrustedCall :: set_identity_networks( ..) => debug ! ( "No storage updates needed..." ) ,
827
+ TrustedCall :: link_identity_short( ..) => debug ! ( "No storage updates needed..." ) ,
781
828
TrustedCall :: set_user_shielding_key_with_networks( ..) =>
782
829
debug ! ( "No storage updates needed..." ) ,
783
830
TrustedCall :: handle_imp_error( ..) => debug ! ( "No storage updates needed..." ) ,
0 commit comments