// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see .
//! Schema for BABE epoch changes in the aux-db.
use log::info;
use codec::{Decode, Encode};
use sc_client_api::backend::AuxStore;
use sp_blockchain::{Result as ClientResult, Error as ClientError};
use sp_runtime::traits::Block as BlockT;
use sp_consensus_babe::BabeBlockWeight;
use super::{epoch_changes::EpochChangesFor, SharedEpochChanges};
const BABE_EPOCH_CHANGES: &[u8] = b"babe_epoch_changes";
fn block_weight_key(block_hash: H) -> Vec {
(b"block_weight", block_hash).encode()
}
fn load_decode(backend: &B, key: &[u8]) -> ClientResult