Skip to content
Snippets Groups Projects
Commit 1864a617 authored by Alexander Theißen's avatar Alexander Theißen Committed by GitHub
Browse files

canvas: Run migrations defined by `pallet-contracts` (#1011)

* Run migrations defined by pallet-contracts

* cargo fmt
parent 20fb7425
Branches
No related merge requests found
...@@ -2,7 +2,11 @@ use crate::{ ...@@ -2,7 +2,11 @@ use crate::{
constants::currency::deposit, Balance, Balances, Call, Event, RandomnessCollectiveFlip, constants::currency::deposit, Balance, Balances, Call, Event, RandomnessCollectiveFlip,
Runtime, RuntimeBlockWeights, Timestamp, Runtime, RuntimeBlockWeights, Timestamp,
}; };
use frame_support::{parameter_types, traits::Nothing, weights::Weight}; use frame_support::{
parameter_types,
traits::{Nothing, OnRuntimeUpgrade},
weights::Weight,
};
use pallet_contracts::{ use pallet_contracts::{
weights::{SubstrateWeight, WeightInfo}, weights::{SubstrateWeight, WeightInfo},
Config, DefaultAddressGenerator, Frame, Schedule, Config, DefaultAddressGenerator, Frame, Schedule,
...@@ -52,3 +56,10 @@ impl Config for Runtime { ...@@ -52,3 +56,10 @@ impl Config for Runtime {
type CallStack = [Frame<Self>; 31]; type CallStack = [Frame<Self>; 31];
type AddressGenerator = DefaultAddressGenerator; type AddressGenerator = DefaultAddressGenerator;
} }
pub struct Migrations;
impl OnRuntimeUpgrade for Migrations {
fn on_runtime_upgrade() -> Weight {
pallet_contracts::migration::migrate::<Runtime>()
}
}
...@@ -97,6 +97,7 @@ pub type Executive = frame_executive::Executive< ...@@ -97,6 +97,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>, frame_system::ChainContext<Runtime>,
Runtime, Runtime,
AllPalletsWithSystem, AllPalletsWithSystem,
contracts::Migrations,
>; >;
impl_opaque_keys! { impl_opaque_keys! {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment