@@ -101,6 +101,9 @@ pub mod pallet {
101
101
type MaxPeers : Get < u32 > ;
102
102
103
103
type WeightInfo : WeightInfo ;
104
+
105
+ #[ pallet:: constant]
106
+ type ThisNetworkId : Get < GenericNetworkId > ;
104
107
}
105
108
106
109
#[ pallet:: pallet]
@@ -117,16 +120,6 @@ pub mod pallet {
117
120
OptionQuery ,
118
121
> ;
119
122
120
- #[ pallet:: type_value]
121
- pub fn DefaultForThisNetworkId ( ) -> GenericNetworkId {
122
- GenericNetworkId :: Sub ( SubNetworkId :: Mainnet )
123
- }
124
-
125
- #[ pallet:: storage]
126
- #[ pallet:: getter( fn this_network_id) ]
127
- pub type ThisNetworkId < T > =
128
- StorageValue < _ , GenericNetworkId , ValueQuery , DefaultForThisNetworkId > ;
129
-
130
123
#[ pallet:: event]
131
124
#[ pallet:: generate_deposit( pub ( super ) fn deposit_event) ]
132
125
pub enum Event < T : Config > {
@@ -154,28 +147,6 @@ pub mod pallet {
154
147
#[ pallet:: hooks]
155
148
impl < T : Config > Hooks < BlockNumberFor < T > > for Pallet < T > { }
156
149
157
- #[ pallet:: genesis_config]
158
- pub struct GenesisConfig {
159
- /// Network id for current network
160
- pub network_id : GenericNetworkId ,
161
- }
162
-
163
- #[ cfg( feature = "std" ) ]
164
- impl Default for GenesisConfig {
165
- fn default ( ) -> Self {
166
- Self {
167
- network_id : GenericNetworkId :: Sub ( SubNetworkId :: Mainnet ) ,
168
- }
169
- }
170
- }
171
-
172
- #[ pallet:: genesis_build]
173
- impl < T : Config > GenesisBuild < T > for GenesisConfig {
174
- fn build ( & self ) {
175
- ThisNetworkId :: < T > :: put ( self . network_id ) ;
176
- }
177
- }
178
-
179
150
#[ pallet:: call]
180
151
impl < T : Config > Pallet < T > {
181
152
#[ pallet:: call_index( 0 ) ]
@@ -321,7 +292,7 @@ impl<T: Config> bridge_types::traits::Verifier for Pallet<T> {
321
292
commitment_hash : H256 ,
322
293
proof : & Self :: Proof ,
323
294
) -> DispatchResult {
324
- let this_network_id = ThisNetworkId :: < T > :: get ( ) ;
295
+ let this_network_id = T :: ThisNetworkId :: get ( ) ;
325
296
let digest_hash = Keccak256 :: hash_of ( & proof. digest ) ;
326
297
Self :: verify_signatures ( network_id, digest_hash, & proof. proof ) ?;
327
298
let count = proof
0 commit comments