From ffb673909f5f780ad372b01b39317c38a498b89c Mon Sep 17 00:00:00 2001 From: Dariusz Depta Date: Tue, 3 Sep 2024 14:23:42 +0200 Subject: [PATCH] Updates. --- src/pages/cw-multi-test/app.mdx | 34 +++++++++++++++++++++++++----- src/pages/cw-multi-test/blocks.mdx | 15 +++++++++++-- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/pages/cw-multi-test/app.mdx b/src/pages/cw-multi-test/app.mdx index 68a471d9..04d9e38f 100644 --- a/src/pages/cw-multi-test/app.mdx +++ b/src/pages/cw-multi-test/app.mdx @@ -2,7 +2,13 @@ tags: ["multitest", "App"] --- -# `App` +# App + +The `App{:rust}` struct in **`MultiTest`** represents the whole blockchain simulator. When creating +the `App{:rust}`, it simulates the startup of a real-life blockchain within tests that utilize +**`MultiTest`**. + +
-The `App{:rust}` struct in **`MultiTest`** represents the whole blockchain simulator. When creating -the `App{:rust}`, it simulates the startup of a real-life blockchain within tests that utilize -**`MultiTest`**. +## `App::default` The most straightforward way to create the `App{:rust}` is by using the `default` method, which is the equivalent of calling the `new` constructor with an empty initialization callback. @@ -54,7 +58,7 @@ let app = App::new(no_init); ``` In both cases, the newly created `App{:rust}` object simulates a blockchain with the default -settings, as summarized below: +settings, as summarized in the table below: | Feature | Default implementation | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------- | @@ -69,3 +73,23 @@ settings, as summarized below: | [Wasm](wasm) | [`WasmKeeper{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/struct.WasmKeeper.html) | | [Custom](custom) | [`FailingModule{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/struct.FailingModule.html) | | [IBC](ibc) | [`IbcFailingModule{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/type.IbcFailingModule.html) | + +## `App::new` + +(todo) + +## Storing smart contract's code + +(todo) + +## Instantiating smart contract + +(todo) + +## Querying smart contract + +(todo) + +## Executing smart contract's message + +(todo) diff --git a/src/pages/cw-multi-test/blocks.mdx b/src/pages/cw-multi-test/blocks.mdx index 6de07940..11795702 100644 --- a/src/pages/cw-multi-test/blocks.mdx +++ b/src/pages/cw-multi-test/blocks.mdx @@ -2,6 +2,8 @@ tags: ["multitest", "blocks"] --- +import { Callout } from "nextra/components"; + # Blocks There are several cases when testing CosmWasm smart contracts requires simulating delays on the @@ -16,8 +18,17 @@ blockchain, like: ## Operations on blocks -**`MultiTest`** provides several options to initialize and update the current block properties (such -as height and timestamp), to test delays on the blockchain. +**`MultiTest`** provides several operations to initialize and update current block properties, such +as height and timestamp, in order to test delays on the blockchain. + + + Although it is possible to modify only the height or only the timestamp of the block in MultiTest, + this is not possible in a real-life blockchain and may lead to unpredictable test results. + + + + Always increment the height **and** the timestamp of the block in tests. + ## Initialization with the default block