@@ -111,54 +111,6 @@ pub mod opaque {
111111 /// Opaque block identifier type.
112112 pub type BlockId = generic:: BlockId < Block > ;
113113
114- pub const CROSS_CHAIN : KeyTypeId = KeyTypeId ( * b"crch" ) ;
115- pub struct CrossChainRuntimeAppPublic ;
116-
117- pub mod cross_chain_app {
118- use super :: CROSS_CHAIN ;
119- use parity_scale_codec:: MaxEncodedLen ;
120- use sidechain_domain:: SidechainPublicKey ;
121- use sp_core:: crypto:: AccountId32 ;
122- use sp_runtime:: MultiSigner ;
123- use sp_runtime:: app_crypto:: { app_crypto, ecdsa} ;
124- use sp_runtime:: traits:: IdentifyAccount ;
125- use sp_std:: vec:: Vec ;
126-
127- app_crypto ! ( ecdsa, CROSS_CHAIN ) ;
128- impl MaxEncodedLen for Signature {
129- fn max_encoded_len ( ) -> usize {
130- ecdsa:: Signature :: max_encoded_len ( )
131- }
132- }
133-
134- impl From < Signature > for Vec < u8 > {
135- fn from ( value : Signature ) -> Self {
136- value. into_inner ( ) . 0 . to_vec ( )
137- }
138- }
139-
140- impl From < Public > for AccountId32 {
141- fn from ( value : Public ) -> Self {
142- MultiSigner :: from ( ecdsa:: Public :: from ( value) ) . into_account ( )
143- }
144- }
145-
146- impl From < Public > for Vec < u8 > {
147- fn from ( value : Public ) -> Self {
148- value. into_inner ( ) . 0 . to_vec ( )
149- }
150- }
151-
152- impl TryFrom < SidechainPublicKey > for Public {
153- type Error = SidechainPublicKey ;
154- fn try_from ( pubkey : SidechainPublicKey ) -> Result < Self , Self :: Error > {
155- let cross_chain_public_key =
156- Public :: try_from ( pubkey. 0 . as_slice ( ) ) . map_err ( |_| pubkey) ?;
157- Ok ( cross_chain_public_key)
158- }
159- }
160- }
161-
162114 impl_opaque_keys ! {
163115 #[ derive( MaxEncodedLen , PartialOrd , Ord ) ]
164116 pub struct SessionKeys {
@@ -181,7 +133,7 @@ pub mod opaque {
181133 }
182134}
183135
184- pub type CrossChainPublic = opaque :: cross_chain_app:: Public ;
136+ pub type CrossChainPublic = sidechain_domain :: cross_chain_app:: Public ;
185137
186138// To learn more about runtime versioning, see:
187139// https://docs.substrate.io/main-docs/build/upgrade#runtime-versioning
@@ -400,7 +352,7 @@ impl pallet_session_validator_management::Config for Runtime {
400352 input : AuthoritySelectionInputs ,
401353 sidechain_epoch : ScEpochNumber ,
402354 ) -> Option < BoundedVec < Self :: CommitteeMember , Self :: MaxValidators > > {
403- select_authorities :: < opaque :: cross_chain_app:: Public , SessionKeys , MaxValidators > (
355+ select_authorities :: < sidechain_domain :: cross_chain_app:: Public , SessionKeys , MaxValidators > (
404356 Sidechain :: genesis_utxo ( ) ,
405357 input,
406358 sidechain_epoch,
0 commit comments