Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hirschenberger committed Feb 13, 2023
1 parent 07a330e commit 37d21f9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,10 +1619,13 @@ impl<T: Config> Pallet<T> {
/// it and extracting the runtime version of it. It checks that the runtime version
/// of the old and new runtime has the same spec name and that the spec version is increasing.
pub fn can_set_code(code: &[u8]) -> Result<(), sp_runtime::DispatchError> {
let current_version = T::Version::get();
let new_version = sp_io::misc::runtime_version(code)
.and_then(|v| RuntimeVersion::decode(&mut &v[..]).ok())
.ok_or(Error::<T>::FailedToExtractRuntimeVersion)?;
#[cfg_attr(feature = "runtime-benchmarks", allow(unused_variables))]
let (current_version, new_version) = (
T::Version::get(),
sp_io::misc::runtime_version(code)
.and_then(|v| RuntimeVersion::decode(&mut &v[..]).ok())
.ok_or(Error::<T>::FailedToExtractRuntimeVersion)?,
);

// Disable checks if we are benchmarking `set_code` to make it possible to set arbitrary
// runtimes without modification
Expand Down

0 comments on commit 37d21f9

Please sign in to comment.