Skip to content

Commit

Permalink
Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Jul 20, 2023
1 parent e3401cf commit 17052d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
3 changes: 2 additions & 1 deletion parachain/pallets/ethereum-beacon-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ pub mod pallet {
BLSPreparePublicKeysFailed,
BLSVerificationFailed(BlsError),
InvalidUpdateSlot,
/// The given update is not in the expected period, or the given next sync committee does not match the next sync committee in storage.
/// The given update is not in the expected period, or the given next sync committee does
/// not match the next sync committee in storage.
InvalidSyncCommitteeUpdate,
ExecutionHeaderTooFarBehind,
ExecutionHeaderSkippedSlot,
Expand Down
2 changes: 1 addition & 1 deletion parachain/pallets/inbound-queue/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod benchmarks {

impl_benchmark_test_suite!(
InboundQueue,
crate::test::new_tester::<crate::test::Test>(crate::H160::default()),
crate::test::new_tester(crate::H160::default()),
crate::test::Test
);
}
21 changes: 1 addition & 20 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 @@ -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 17052d3

Please sign in to comment.