Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszDepta committed Aug 20, 2024
1 parent 1fea527 commit 5d30f1a
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 11 deletions.
7 changes: 7 additions & 0 deletions src/pages/cw-multi-test/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ tags: ["multitest", "API"]

# API

## Initialization with the default API

(some description)

- `App::default(){:rust}`
- `app.api(){:rust}`

```rust
let app = App::default();
app.api();
Expand Down
20 changes: 13 additions & 7 deletions src/pages/cw-multi-test/app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ tags: ["multitest", "App"]

# `App{:rust}`

The `App{:rust}` struct in **`MultiTest`** represents the whole blockchain simulator.

<div
style={{
textAlign: "center",
Expand Down Expand Up @@ -36,14 +34,24 @@ The `App{:rust}` struct in **`MultiTest`** represents the whole blockchain simul
</div>
</div>

```rust showLineNumbers copy
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 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.

```rust copy /default/
let app = App::default();
```

```rust showLineNumbers copy
```rust copy /new/
let app = App::new(no_init);
```

In both cases, the newly created `app{:rust}` object simulates a blockchain with default settings,
as summarized in the following table:

| Feature | Default implementation |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Blocks](blocks) | [`cosmwasm_std::mock_env().block{:rust}`](https://docs.rs/cosmwasm-std/latest/cosmwasm_std/testing/fn.mock_env.html) |
Expand All @@ -56,6 +64,4 @@ let app = App::new(no_init);
| [Stargate](stargate) | [`StargateFailing{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/struct.StargateFailing.html) |
| [Wasm](wasm) | [`WasmKeeper{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/struct.WasmKeeper.html) |
| [Custom](custom) | [`FailingModule<Empty, Empty, Empty>{: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)² |

² IBC support will be documented in version 3.0.0.
| [IBC](ibc) | [`IbcFailingModule{:rust}`](https://docs.rs/cw-multi-test/latest/cw_multi_test/type.IbcFailingModule.html) |
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/bank.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ tags: ["multitest", "bank"]

# Bank

- `BankKeeper{:rust}` (default implementation)

---

- `BankMsg::Send{:rust}`
- `BankMsg::Burn{:rust}`
- `BankQuery::AllBalances{:rust}`
Expand Down
16 changes: 16 additions & 0 deletions src/pages/cw-multi-test/contract-wrapper.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,19 @@ tags: ["multitest", "ContractWrapper"]
---

# `ContractWrapper{:rust}`

## new

## new_with_empty

## with_reply

## with_reply_empty

## with_migrate

## with_migrate_empty

## with_sudo

## with_sudo_empty
2 changes: 2 additions & 0 deletions src/pages/cw-multi-test/custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ tags: ["multitest", "custom"]
---

# Custom

- `FailingModule<Empty, Empty, Empty>{:rust}` (default implementation)
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/distribution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ tags: ["multitest", "distribution"]

# Distribution

- `DistributionKeeper{:rust}` (default implementation)

---

- `DistributionMsg::WithdrawDelegatorReward{:rust}`
- `DistributionMsg::SetWithdrawAddress{:rust}`
2 changes: 1 addition & 1 deletion src/pages/cw-multi-test/governance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags: ["multitest", "governance"]

# Governance

- `GovFailingModule{:rust}` (default)
- `GovFailingModule{:rust}` (default implementation)
- `GovAcceptingModule{:rust}`

---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cw-multi-test/ibc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ tags: ["multitest", "IBC"]

# IBC

- `IbcFailingModule{:rust}` (default implementation)
- `IbcAcceptingModule{:rust}`
- `IbcFailingModule{:rust}`

---

Expand Down
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/staking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ tags: ["multitest", "staking"]

# Staking

- `StakeKeeper{:rust}` (default implementation)

---

- `StakingMsg::Delegate{:rust}`
- `StakingMsg::Undelegate{:rust}`
- `StakingMsg::Redelegate{:rust}`
Expand Down
7 changes: 5 additions & 2 deletions src/pages/cw-multi-test/stargate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ tags: ["multitest", "stargate"]

# Stargate

- `StargateFailing{:rust}` (default implementation)
- `StargateAccepting{:rust}`

---

- Stargate trait
- StargateFailing
- StargateAccepting
8 changes: 8 additions & 0 deletions src/pages/cw-multi-test/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ tags: ["multitest", "storage"]

# Storage

## Initialization with the default storage

(some description)

- `App::default(){:rust}`
- `app.storage(){:rust}`
- `app.storage_mut(){:rust}`

```rust
let app = App::default();
app.storage();
Expand Down
4 changes: 4 additions & 0 deletions src/pages/cw-multi-test/wasm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ tags: ["multitest", "wasm"]

# Wasm

- `WasmKeeper{:rust}` (default implementation)

---

- `WasmMsg::Execute{:rust}`
- `WasmMsg::Instantiate{:rust}`
- `WasmMsg::Instantiate2{:rust}`
Expand Down

0 comments on commit 5d30f1a

Please sign in to comment.