Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into bkchr-pov-recovery
  • Loading branch information
bkchr committed May 8, 2021
commit 9a2dcd8ecf06071cbee669c98b9078b690425e16
22 changes: 22 additions & 0 deletions test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ pub struct TestNodeBuilder {
parachain_nodes_exclusive: bool,
relay_chain_nodes: Vec<MultiaddrWithPeerId>,
wrap_announce_block: Option<Box<dyn FnOnce(AnnounceBlockFn) -> AnnounceBlockFn>>,
storage_update_func_parachain: Option<Box<dyn Fn()>>,
storage_update_func_relay_chain: Option<Box<dyn Fn()>>,
}

impl TestNodeBuilder {
Expand All @@ -327,6 +329,8 @@ impl TestNodeBuilder {
parachain_nodes_exclusive: false,
relay_chain_nodes: Vec::new(),
wrap_announce_block: None,
storage_update_func_parachain: None,
storage_update_func_relay_chain: None,
}
}

Expand Down Expand Up @@ -400,6 +404,24 @@ impl TestNodeBuilder {
self
}

/// Allows accessing the parachain storage before the test node is built.
pub fn update_storage_parachain(
mut self,
updater: impl Fn() + 'static,
) -> Self {
self.storage_update_func_parachain = Some(Box::new(updater));
self
}

/// Allows accessing the relay chain storage before the test node is built.
pub fn update_storage_relay_chain(
mut self,
updater: impl Fn() + 'static,
) -> Self {
self.storage_update_func_relay_chain = Some(Box::new(updater));
self
}

/// Build the [`TestNode`].
pub async fn build(self) -> TestNode {
let parachain_config = node_config(
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.