Skip to content

Commit

Permalink
fix try_runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jul 22, 2023
1 parent 6b406e1 commit 7bb71bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ceremonies/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub mod v1 {

impl<T: Config + frame_system::Config> OnRuntimeUpgrade for Migration<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
assert_eq!(StorageVersion::get::<Pallet<T>>(), 0, "can only upgrade from version 0");

let attestations = v0::AttestationRegistry::<T>::iter();
Expand Down Expand Up @@ -60,7 +60,7 @@ pub mod v1 {
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(state: Vec<u8>) -> Result<(), &'static str> {
fn post_upgrade(state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
assert_eq!(StorageVersion::get::<Pallet<T>>(), 1, "must upgrade");

let old_attestation_count: u32 =
Expand Down
4 changes: 2 additions & 2 deletions communities/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub mod v1 {

impl<T: Config + frame_system::Config> OnRuntimeUpgrade for Migration<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
assert_eq!(StorageVersion::get::<Pallet<T>>(), 0, "can only upgrade from version 0");

let cid_count = v0::CommunityIdentifiers::<T>::get().len() as u32;
Expand Down Expand Up @@ -126,7 +126,7 @@ pub mod v1 {
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(state: Vec<u8>) -> Result<(), &'static str> {
fn post_upgrade(state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
assert_eq!(StorageVersion::get::<Pallet<T>>(), 1, "must upgrade");

let (
Expand Down

0 comments on commit 7bb71bf

Please sign in to comment.