Minor documentation update for AuxStore and BlockImportParams.auxiliary (#10428)

This commit is contained in:
Nazar Mokrynskyi authored and GitHub committed 2021-12-06 22:35:45 +00:00
1 parent e65caa56d4
commit 9e9e18b161
2 files changed
+7 -2

No files matched your search

+4
View File
@@ -259,6 +259,10 @@ pub trait Finalizer<Block: BlockT, B: Backend<Block>> {
}
/// Provides access to an auxiliary database.
///
/// This is a simple global database not aware of forks. Can be used for storing auxiliary
/// information like total block weight/difficulty for fork resolution purposes as a common use
/// case.
pub trait AuxStore {
/// Insert auxiliary data into key-value store.
///
@@ -190,8 +190,9 @@ pub struct BlockImportParams<Block: BlockT, Transaction> {
/// rejects block import if there are still intermediate values that remain unhandled.
pub intermediates: HashMap<Cow<'static, [u8]>, Box<dyn Any + Send>>,
/// Auxiliary consensus data produced by the block.
/// Contains a list of key-value pairs. If values are `None`, the keys
/// will be deleted.
/// Contains a list of key-value pairs. If values are `None`, the keys will be deleted. These
/// changes will be applied to `AuxStore` database all as one batch, which is more efficient
/// than updating `AuxStore` directly.
pub auxiliary: Vec<(Vec<u8>, Option<Vec<u8>>)>,
/// Fork choice strategy of this import. This should only be set by a
/// synchronous import, otherwise it may race against other imports.