mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 20:21:03 +00:00
BEEFY: define on-chain beefy-genesis and use it to coordinate voter initialization (#13215)
* beefy: add support to configure BEEFY genesis * client/beefy: more flexible test runtime api * client/beefy: add tests for custom BEEFY genesis * client/beefy: ignore old state that didn't account for pallet genesis * client/beefy: fix clippy * frame/beefy: default BEEFY-genesis is block One::one() * frame/beefy: add extra doc comments --------- Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -28,7 +28,7 @@ use sp_runtime::traits::Block as BlockT;
|
||||
const VERSION_KEY: &[u8] = b"beefy_auxschema_version";
|
||||
const WORKER_STATE: &[u8] = b"beefy_voter_state";
|
||||
|
||||
const CURRENT_VERSION: u32 = 1;
|
||||
const CURRENT_VERSION: u32 = 2;
|
||||
|
||||
pub(crate) fn write_current_version<B: AuxStore>(backend: &B) -> ClientResult<()> {
|
||||
info!(target: LOG_TARGET, "🥩 write aux schema version {:?}", CURRENT_VERSION);
|
||||
@@ -63,7 +63,8 @@ where
|
||||
|
||||
match version {
|
||||
None => (),
|
||||
Some(1) => return load_decode::<_, PersistedState<B>>(backend, WORKER_STATE),
|
||||
Some(1) => (), // version 1 is totally obsolete and should be simply ignored
|
||||
Some(2) => return load_decode::<_, PersistedState<B>>(backend, WORKER_STATE),
|
||||
other =>
|
||||
return Err(ClientError::Backend(format!("Unsupported BEEFY DB version: {:?}", other))),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user