Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontier DB block mapping one-to-many #862

Merged
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/cli/src/frontier_db_cmd/mapping_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum MappingKey {
pub struct MappingDb<'a, C, B: BlockT> {
cmd: &'a FrontierDbCmd,
client: Arc<C>,
backend: Arc<fc_db::Backend<B>>,
backend: Arc<fc_db::Backend<B, C>>,
}

impl<'a, C, B: BlockT> MappingDb<'a, C, B>
Expand All @@ -48,7 +48,7 @@ where
C::Api: EthereumRuntimeRPCApi<B>,
C: sp_blockchain::HeaderBackend<B>,
{
pub fn new(cmd: &'a FrontierDbCmd, client: Arc<C>, backend: Arc<fc_db::Backend<B>>) -> Self {
pub fn new(cmd: &'a FrontierDbCmd, client: Arc<C>, backend: Arc<fc_db::Backend<B, C>>) -> Self {
Self {
cmd,
client,
Expand Down
13 changes: 8 additions & 5 deletions client/cli/src/frontier_db_cmd/meta_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ impl FromStr for MetaKey {
}
}

pub struct MetaDb<'a, B: BlockT> {
pub struct MetaDb<'a, B: BlockT, C> {
cmd: &'a FrontierDbCmd,
backend: Arc<fc_db::Backend<B>>,
backend: Arc<fc_db::Backend<B, C>>,
}

impl<'a, B: BlockT> MetaDb<'a, B> {
pub fn new(cmd: &'a FrontierDbCmd, backend: Arc<fc_db::Backend<B>>) -> Self {
impl<'a, B: BlockT, C> MetaDb<'a, B, C>
where
C: sp_blockchain::HeaderBackend<B>,
{
pub fn new(cmd: &'a FrontierDbCmd, backend: Arc<fc_db::Backend<B, C>>) -> Self {
Self { cmd, backend }
}

Expand Down Expand Up @@ -152,4 +155,4 @@ impl<'a, B: BlockT> MetaDb<'a, B> {
}
}

impl<'a, B: BlockT> FrontierDbMessage for MetaDb<'a, B> {}
impl<'a, B: BlockT, C> FrontierDbMessage for MetaDb<'a, B, C> {}
2 changes: 1 addition & 1 deletion client/cli/src/frontier_db_cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl FrontierDbCmd {
pub fn run<C, B: BlockT>(
&self,
client: Arc<C>,
backend: Arc<fc_db::Backend<B>>,
backend: Arc<fc_db::Backend<B, C>>,
) -> sc_cli::Result<()>
where
C: sp_api::ProvideRuntimeApi<B>,
Expand Down
Loading