Skip to content

Commit eeeb907

Browse files
committed
Fixed formatting.
1 parent 72ff7d0 commit eeeb907

File tree

5 files changed

+33
-27
lines changed

5 files changed

+33
-27
lines changed

docs/multi-test/getting-started/counter/implementation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The `lib.rs` file in a Rust project serves as the main entry point for defining
141141
library. In the context of our example **counter** smart contract, the `lib.rs` file is defining and
142142
organizing the modules that make up the contract. Recall the **counter** project file structure:
143143

144-
```text {4,6} title="counter directory content"
144+
```text {4,6} title="counter directory"
145145
.
146146
├── Cargo.toml
147147
└── src
@@ -390,7 +390,7 @@ value that can be incremented, decremented, queried, or reset by the smart contr
390390
about the [Item](../../../storage-plus/containers/item.md) type can be found in
391391
[StoragePlus](../../../storage-plus/introduction.md) documentation.
392392

393-
### _instantiate_ entrypoint
393+
### `instantiate` entrypoint
394394

395395
The `instantiate` function (entry-point) is called during the instantiation of the smart
396396
contract. Depending on the value of the message passed in `msg` argument, the counter will be
@@ -417,7 +417,7 @@ pub fn instantiate(
417417
}
418418
```
419419

420-
### _execute_ entrypoint
420+
### `execute` entrypoint
421421

422422
The `execute` function (entry-point) is called whenever the user wants to interact with the
423423
contract, especially when the value of the counter should be incremented, decremented or reset.
@@ -446,7 +446,7 @@ pub fn execute(
446446
}
447447
```
448448

449-
### _query_ entrypoint
449+
### `query` entrypoint
450450

451451
The `query` function (entry-point) is called whenever the user asks the counter smart
452452
contract for the current value. The counter value is retrieved from the contract's persistent

docs/multi-test/getting-started/counter/introduction.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ library named **counter**.
3636

3737
Change the working directory to your home directory:
3838

39-
```shell
39+
```shell title="terminal"
4040
cd ~
4141
```
4242

4343
Create a dedicated directory to store your example smart contract:
4444

45-
```shell
45+
```shell title="terminal"
4646
mkdir my-contracts
4747
```
4848

4949
Change the working directory to `my-contracts`:
5050

51-
```shell
51+
```shell title="terminal"
5252
cd my-contracts
5353
```
5454

5555
Create a new Rust library named **counter**:
5656

57-
```shell
57+
```shell title="terminal"
5858
cargo init --lib counter
5959
```
6060

6161
Change the working directory to `counter`:
6262

63-
```shell
63+
```shell title="terminal"
6464
cd counter
6565
```
6666

@@ -80,13 +80,13 @@ should be stored in `src` directory.
8080

8181
Let's create an empty **contract.rs** file...
8282

83-
```shell
83+
```shell title="terminal"
8484
touch src/contract.rs
8585
```
8686

8787
...and empty **msg.rs** file:
8888

89-
```shell
89+
```shell title="terminal"
9090
touch src/msg.rs
9191
```
9292

@@ -103,6 +103,6 @@ The final structure of the smart contract project placed in the `counter` direct
103103

104104
## Filling the content
105105

106-
In the previous section you have created a project structure for **counter** smart contract,
106+
In this section you have created a project structure for **counter** smart contract,
107107
but the source files are still empty. In the following chapter, we provide an example
108108
[**implementation**](./implementation.md) of the **counter** smart contract.

docs/multi-test/getting-started/writing-tests/introduction.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Having the **counter** smart contract set up, let's first check if the project compiles:
44

5-
```shell
5+
```shell title="terminal"
66
cargo build
77
```
88

@@ -23,7 +23,7 @@ been built successfully.
2323
It is a very good habit to run [Rust linter](https://doc.rust-lang.org/clippy) after each code
2424
change, so let's run it before we move forward.
2525

26-
```shell
26+
```shell title="terminal"
2727
cargo clippy
2828
```
2929

@@ -72,13 +72,13 @@ Note, that both directories **`src`** and **`tests`** are placed at the root of
7272

7373
Let's begin by creating the `tests` directory:
7474

75-
```shell
75+
```shell title="terminal"
7676
mkdir tests
7777
```
7878

7979
Then create an empty `mod.rs` file inside the `tests` directory:
8080

81-
```shell
81+
```shell title="terminal"
8282
touch tests/mod.rs
8383
```
8484

@@ -91,13 +91,13 @@ mod multitest;
9191
By convention, we place all **MultiTest** test cases under the `multitest` directory, so let's
9292
create it:
9393

94-
```shell
94+
```shell title="terminal"
9595
mkdir tests/multitest
9696
```
9797

9898
Inside the `tests/multitest` directory we should also create an empty file named `mod.rs`:
9999

100-
```shell
100+
```shell title="terminal"
101101
touch tests/multitest/mod.rs
102102
```
103103

@@ -109,7 +109,7 @@ mod test_counter;
109109

110110
Finally, inside the `tests/multitest` directory, we create a file named `test_counter.rs`:
111111

112-
```shell
112+
```shell title="terminal"
113113
touch tests/multitest/test_counter.rs
114114
```
115115

@@ -121,7 +121,7 @@ Now that the directory structure for tests is ready, it's time to run all tests.
121121

122122
Once the directories and files are set up for tests, let's execute them:
123123

124-
```shell
124+
```shell title="terminal"
125125
cargo test
126126
```
127127

@@ -155,7 +155,7 @@ integration tests (**line 12**) and **0** for documentation tests (**line 16**).
155155

156156
Similarly, to execute all tests using [cargo-nextest](https://nexte.st), type:
157157

158-
```shell copy filename="TERMINAL"
158+
```shell title="terminal"
159159
cargo nextest run
160160
```
161161

@@ -180,7 +180,7 @@ quite tedious, so let's prepare a short script to automate this task.
180180

181181
Create an empty file named `coverage.sh` in the `counter` directory:
182182

183-
```shell
183+
```shell title="terminal"
184184
touch coverage.sh
185185
```
186186

@@ -198,7 +198,7 @@ echo "Report: file://$(pwd)/target/coverage-report/tarpaulin-report.html"
198198

199199
Finally, make this file executable:
200200

201-
```shell
201+
```shell title="terminal"
202202
chmod +x coverage.sh
203203
```
204204

@@ -227,7 +227,7 @@ should now look like this:
227227

228228
With the code coverage script at hand, measuring code coverage is now as simple as typing:
229229

230-
```shell
230+
```shell title="terminal"
231231
./coverage.sh
232232
```
233233

@@ -308,4 +308,6 @@ pub fn query(deps: Deps, _env: Env, msg: CounterQueryMsg) -> Result<Binary, StdE
308308

309309
## Writing tests for smart contracts
310310

311-
Now it is time to start implementing tests for the **counter** smart contract.
311+
Now it is time to start implementing tests for the **[counter]** smart contract.
312+
313+
[counter]: ../counter/introduction.md

docs/multi-test/installation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ cw-multi-test = "3"
1919

2020
**MultiTest** is a **TESTING** library and should **ALWAYS** be added to your project
2121
as a **DEVELOPMENT DEPENDENCY** in section **`[dev-dependencies]`** of the **Cargo.toml** file.
22+
23+
:::
2224

23-
**MultiTest** <u>**IS NOT**</u> designed to be used in production code on a real-life blockchain.
25+
:::warning
26+
27+
**MultiTest** <span style={{color:'red'}}>**IS NOT**</span> designed to be used in production code on a real-life blockchain.
2428

2529
:::
2630

docs/multi-test/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ To successfully follow the upcoming chapters, a basic knowledge of [Rust and Car
3737

3838
:::
3939

40-
[Rust and Cargo]: https://www.rust-lang.org/tools/install
40+
[Rust and Cargo]: https://rust-lang.org/learn
4141
[file an issue]: https://github.com/CosmWasm/cw-multi-test/issues

0 commit comments

Comments
 (0)