Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Jul 20, 2023
1 parent 7888b50 commit d376fcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
25 changes: 3 additions & 22 deletions parachain/pallets/inbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub mod pallet {
}

#[pallet::genesis_build]
impl<T: Config> GenesisBuild<T> for GenesisConfig<T> {
impl<T: Config> GenesisBuild<T> for GenesisConfig {
fn build(&self) {
Gateway::<T>::put(self.gateway);
}
Expand Down Expand Up @@ -205,7 +205,7 @@ pub mod pallet {
nonce: envelope.nonce,
result: MessageDispatchResult::InvalidPayload,
});
return Ok(())
return Ok(());
},
};

Expand All @@ -220,7 +220,7 @@ pub mod pallet {
nonce: envelope.nonce,
result: MessageDispatchResult::InvalidPayload,
});
return Ok(())
return Ok(());
},
};

Expand Down Expand Up @@ -267,24 +267,5 @@ pub mod pallet {
) -> DispatchResult {
<Self as OwnedBridgeModule<_>>::set_operating_mode(origin, operating_mode)
}

/// Change `PalletOwner`.
/// May only be called either by root, or by `PalletOwner`.
#[pallet::call_index(3)]
#[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))]
pub fn set_owner(origin: OriginFor<T>, new_owner: Option<T::AccountId>) -> DispatchResult {
<Self as OwnedBridgeModule<_>>::set_owner(origin, new_owner)
}

/// Halt or resume all pallet operations.
/// May only be called either by root, or by `PalletOwner`.
#[pallet::call_index(4)]
#[pallet::weight((T::DbWeight::get().reads_writes(1, 1), DispatchClass::Operational))]
pub fn set_operating_mode(
origin: OriginFor<T>,
operating_mode: BasicOperatingMode,
) -> DispatchResult {
<Self as OwnedBridgeModule<_>>::set_operating_mode(origin, operating_mode)
}
}
}
6 changes: 2 additions & 4 deletions parachain/pallets/inbound-queue/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,10 @@ pub fn new_tester(gateway: H160) -> sp_io::TestExternalities {
new_tester_with_config(inbound_queue::GenesisConfig { gateway })
}

pub fn new_tester_with_config<T: Config>(
config: inbound_queue::GenesisConfig<T>,
) -> sp_io::TestExternalities {
pub fn new_tester_with_config(config: inbound_queue::GenesisConfig) -> sp_io::TestExternalities {
let mut storage = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();

GenesisBuild::<T>::assimilate_storage(&config, &mut storage).unwrap();
GenesisBuild::<Test>::assimilate_storage(&config, &mut storage).unwrap();

let mut ext: sp_io::TestExternalities = storage.into();
ext.execute_with(|| System::set_block_number(1));
Expand Down

0 comments on commit d376fcc

Please sign in to comment.