Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Do Not Merge)Iso/remove contracts storage #811

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions pallets/sponsorship/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

use frame_support::pallet_prelude::{ensure, Decode, Encode, MaxEncodedLen, PhantomData, RuntimeDebug, TypeInfo};
use frame_support::traits::StorageVersion;
use frame_support::{
dispatch::{DispatchInfo, DispatchResult, Dispatchable, GetDispatchInfo, Pays, PostDispatchInfo},
traits::{
Expand All @@ -30,7 +31,7 @@
use pallet_transaction_payment::OnChargeTransaction;
use sp_io::hashing::blake2_256;
#[cfg(feature = "try-runtime")]
use sp_runtime::TryRuntimeError;

Check warning on line 34 in pallets/sponsorship/src/lib.rs

View workflow job for this annotation

GitHub Actions / lints

unused import: `sp_runtime::TryRuntimeError`

warning: unused import: `sp_runtime::TryRuntimeError` --> pallets/sponsorship/src/lib.rs:34:5 | 34 | use sp_runtime::TryRuntimeError; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default

Check warning on line 34 in pallets/sponsorship/src/lib.rs

View workflow job for this annotation

GitHub Actions / try-runtime-prepare

unused import: `sp_runtime::TryRuntimeError`
use sp_runtime::{
traits::{DispatchInfoOf, One, PostDispatchInfoOf, SignedExtension, TrailingZeroInput, Zero},
transaction_validity::{InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction},
Expand All @@ -43,7 +44,7 @@
};
use support::LimitedBalance;

pub use migration::STORAGE_VERSION;
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
pub use pallet::*;

#[cfg(test)]
Expand All @@ -55,7 +56,6 @@
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;

pub(crate) mod migration;
pub mod weights;
pub use weights::*;

Expand Down Expand Up @@ -122,7 +122,7 @@
use scale_info::prelude::boxed::Box;

#[pallet::pallet]
#[pallet::storage_version(migration::STORAGE_VERSION)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);

Expand Down Expand Up @@ -567,26 +567,6 @@
Ok(())
}
}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(n: BlockNumberFor<T>) -> Weight {
migration::on_initialize::<T>(n)
}

fn on_runtime_upgrade() -> Weight {
migration::on_runtime_upgrade::<T>()
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
migration::pre_upgrade::<T>()
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
migration::post_upgrade::<T>(_state)
}
}
}

/// The pre-sponsor call preps are the details returned from `pre_sponsor_for` that are needed
Expand Down
Loading
Loading