mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
Dynamically generate CHT roots on a full client (#6944)
* Generate CHT roots on a full client * add changes_trie_root function * Add a test * Line widths * Fix sc-service-test * Clarify comments * Revert comments
This commit is contained in:
@@ -29,7 +29,7 @@ use sp_blockchain::{
|
||||
};
|
||||
pub use sc_client_api::{
|
||||
backend::{
|
||||
AuxStore, NewBlockState
|
||||
AuxStore, NewBlockState, ProvideChtRoots,
|
||||
},
|
||||
blockchain::{
|
||||
Backend as BlockchainBackend, BlockStatus, Cache as BlockchainCache,
|
||||
@@ -173,3 +173,21 @@ impl<S, Block: BlockT> RemoteBlockchain<Block> for Blockchain<S>
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Storage<Block>, Block: BlockT> ProvideChtRoots<Block> for Blockchain<S> {
|
||||
fn header_cht_root(
|
||||
&self,
|
||||
cht_size: NumberFor<Block>,
|
||||
block: NumberFor<Block>,
|
||||
) -> sp_blockchain::Result<Option<Block::Hash>> {
|
||||
self.storage().header_cht_root(cht_size, block)
|
||||
}
|
||||
|
||||
fn changes_trie_cht_root(
|
||||
&self,
|
||||
cht_size: NumberFor<Block>,
|
||||
block: NumberFor<Block>,
|
||||
) -> sp_blockchain::Result<Option<Block::Hash>> {
|
||||
self.storage().changes_trie_cht_root(cht_size, block)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user