Migration fix (#5174)

This commit is contained in:
Gavin Wood
2020-03-06 21:23:14 +01:00
committed by GitHub
parent 7177d2fb2b
commit 615dc00702
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 231,
spec_version: 232,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
+3 -2
View File
@@ -74,8 +74,9 @@ fn upgrade_v1_to_v2<T: Trait<I>, I: Instance>() {
// The items in Kusama that would result in a ref count being incremented.
if have_storage_value(b"Democracy", b"Proxy", &hash) { refs += 1 }
// We skip Recovered since it's being replaced anyway.
let mut prefixed_hash = twox_64(&b":session:keys"[..]).to_vec();
prefixed_hash.extend(&b":session:keys"[..]);
let k = b":session:keys".encode();
let mut prefixed_hash = twox_64(&k[..]).to_vec();
prefixed_hash.extend(&k[..]);
prefixed_hash.extend(&hash[..]);
if have_storage_value(b"Session", b"NextKeys", &prefixed_hash) { refs += 1 }
if have_storage_value(b"Staking", b"Bonded", &hash) { refs += 1 }