From 89713a1ef69d464f5e475404d6512729ac3a321a Mon Sep 17 00:00:00 2001 From: Yasir Shariff Date: Mon, 11 Sep 2023 18:04:39 +0300 Subject: [PATCH 1/2] chore: improve fast_forward docs --- README.md | 3 ++- workspaces/src/worker/impls.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec3cc7cd..3bb8aab0 100644 --- a/README.md +++ b/README.md @@ -289,7 +289,8 @@ Following that we will have to init the contract again with our own metadata. Th ### Time Traveling -`workspaces` testing offers support for forwarding the state of the blockchain to the future. This means contracts which require time sensitive data do not need to sit and wait the same amount of time for blocks on the sandbox to be produced. We can simply just call `worker.fast_forward` to get us further in time: +`workspaces` testing offers support for forwarding the state of the blockchain to the future. This means contracts which require time sensitive data do not need to sit and wait the same amount of time for blocks on the sandbox to be produced. We can simply just call `worker.fast_forward` to get us further in time. +Note: This is not to be confused with speeding up the current in-flight transactions; the state being forwarded in this case refers to time-related state (the block height, timestamp and epoch). ```rust #[tokio::test] diff --git a/workspaces/src/worker/impls.rs b/workspaces/src/worker/impls.rs index 233e8df8..554f350a 100644 --- a/workspaces/src/worker/impls.rs +++ b/workspaces/src/worker/impls.rs @@ -307,6 +307,9 @@ impl Worker { /// /// Estimate as to how long it takes: if our delta_height crosses `X` epochs, then it would /// roughly take `X * 5` seconds for the fast forward request to be processed. + /// + /// Note: This is not to be confused with speeding up the current in-flight transactions; + /// the state being forwarded in this case refers to time-related state (the block height, timestamp and epoch). pub async fn fast_forward(&self, delta_height: u64) -> Result<()> { self.workspace.fast_forward(delta_height).await } From b89694b2673c4edc8809e9c01268a60a32485b16 Mon Sep 17 00:00:00 2001 From: Yasir Shariff Date: Mon, 11 Sep 2023 18:44:38 +0300 Subject: [PATCH 2/2] fmt --- workspaces/src/worker/impls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workspaces/src/worker/impls.rs b/workspaces/src/worker/impls.rs index 554f350a..254294aa 100644 --- a/workspaces/src/worker/impls.rs +++ b/workspaces/src/worker/impls.rs @@ -307,8 +307,8 @@ impl Worker { /// /// Estimate as to how long it takes: if our delta_height crosses `X` epochs, then it would /// roughly take `X * 5` seconds for the fast forward request to be processed. - /// - /// Note: This is not to be confused with speeding up the current in-flight transactions; + /// + /// Note: This is not to be confused with speeding up the current in-flight transactions; /// the state being forwarded in this case refers to time-related state (the block height, timestamp and epoch). pub async fn fast_forward(&self, delta_height: u64) -> Result<()> { self.workspace.fast_forward(delta_height).await