-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pallet account id after runtime upgrade (#345)
- Loading branch information
Showing
15 changed files
with
157 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = 'debio' | ||
version = '2.1.3' | ||
version = '2.1.4' | ||
edition = '2021' | ||
license = 'AGPL-3.0' | ||
authors = ['DeBio Dev Team <[email protected]>'] | ||
|
@@ -77,8 +77,7 @@ beefy-gadget-rpc = { git = 'https://github.com/paritytech/substrate.git', branch | |
|
||
# Octopus Dependencies | ||
## Octopus Pallet Dependencies | ||
pallet-octopus-appchain = { git = "https://github.com/octopus-network/octopus-pallets.git", branch = "release-v0.9.18-2" } | ||
pallet-octopus-lpos = { git = 'https://github.com/octopus-network/octopus-pallets.git', branch = 'release-v0.9.18' } | ||
pallet-octopus-appchain = { git = 'https://github.com/octopus-network/octopus-pallets.git', branch = 'release-v0.9.18-2' } | ||
|
||
# Local Dependencies | ||
# DeBio Runtime Dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use crate::{Config, Pallet, PalletAccount, Weight}; | ||
use frame_support::traits::Get; | ||
|
||
pub fn migrate<T: Config>() -> Weight { | ||
use frame_support::traits::StorageVersion; | ||
|
||
let version = StorageVersion::get::<Pallet<T>>(); | ||
let mut weight: Weight = 0; | ||
|
||
if version < 2 { | ||
weight = weight.saturating_add(v2::migrate::<T>()); | ||
StorageVersion::new(2).put::<Pallet<T>>(); | ||
} | ||
|
||
weight | ||
} | ||
|
||
mod v2 { | ||
use super::*; | ||
|
||
pub fn migrate<T: Config>() -> Weight { | ||
PalletAccount::<T>::put(<Pallet<T>>::account_id()); | ||
|
||
T::DbWeight::get().writes(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.