Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 14, 2024
1 parent 2fa197c commit ce3305f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pages/tutorial/cw-contract/query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
We have already created a simple contract reacting to an empty instantiate message. Unfortunately,
it is not very useful. Let's make it a bit interactive.

First, we need to add the [`serde`](https://crates.io/crates/serde) crate to our dependencies. It would
help us with the serialization and deserialization of query messages.
First, we need to add the [`serde`](https://crates.io/crates/serde) crate to our dependencies. It
would help us with the serialization and deserialization of query messages.

```toml {11} copy filename="Cargo.toml"
[package]
Expand Down Expand Up @@ -60,11 +60,11 @@ serializable. We are just deriving the
[`Deserialize`](https://docs.serde.rs/serde/trait.Deserialize.html) traits from `serde` crate.

Then we need to implement our entry point. It is very similar to the `instantiate` one. The first
significant difference is the type of `deps` argument. For `instantiate`, it was a `DepMut`, but here
we went with a [`Deps`](https://docs.rs/cosmwasm-std/latest/cosmwasm_std/struct.Deps.html) object.
That is because the query can never alter the smart contract's internal state. It can only read the
state. It comes with some consequences - for example, it is impossible to implement caching for
future queries (as it would require some data cache to write to).
significant difference is the type of `deps` argument. For `instantiate`, it was a `DepMut`, but
here we went with a [`Deps`](https://docs.rs/cosmwasm-std/latest/cosmwasm_std/struct.Deps.html)
object. That is because the query can never alter the smart contract's internal state. It can only
read the state. It comes with some consequences - for example, it is impossible to implement caching
for future queries (as it would require some data cache to write to).

The other difference is the lack of the `info` argument. The reason here is that the entry point
which performs actions (like instantiation or execution) can differ how an action is performed based
Expand Down

0 comments on commit ce3305f

Please sign in to comment.