Skip to content

Improve documentation consistency and fix minor typos in MIGRATING.md and cosmos_msg.rs #2427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ major releases of `cosmwasm`. Note that you can also view the
`stargate` feature instead, since it was previously implied by `ibc3`.

Also remove any uses of the `backtraces` feature. You can use a
`RUST_BACKTRACE=1` env variable for this now.
`RUST_BACKTRACE=1` environment variable for this now.

If you were using `cosmwasm-std` with `default-features = false`, you probably
want to enable the `std` feature now, as we might move certain existing
Expand Down Expand Up @@ -156,10 +156,10 @@ major releases of `cosmwasm`. Note that you can also view the
+StdError::generic_err(msg)
```

- Replace addresses in unit tests with valid bech32 addresses. This has to be
- Replace addresses in unit tests with valid Bech32 addresses. This has to be
done for all addresses that are validated or canonicalized during the test or
within the contract. The easiest way to do this is by using
`MockApi::addr_make`. It generates a bech32 address from any string:
`MockApi::addr_make`. It generates a Bech32 address from any string:

```diff
-let msg = InstantiateMsg {
Expand All @@ -172,10 +172,10 @@ major releases of `cosmwasm`. Note that you can also view the
+};
```

- Replace addresses in integration tests using `cosmwasm-vm` with valid bech32
- Replace addresses in integration tests using `cosmwasm-vm` with valid Bech32
addresses. This has to be done for all addresses that are validated or
canonicalized during the test or within the contract. The easiest way to do
this is by using `MockApi::addr_make`. It generates a bech32 address from any
this is by using `MockApi::addr_make`. It generates a Bech32 address from any
string:

```diff
Expand Down Expand Up @@ -206,9 +206,9 @@ major releases of `cosmwasm`. Note that you can also view the

- If you were using `QueryRequest::Stargate`, you might want to enable the
`cosmwasm_2_0` cargo feature and migrate to `QueryRequest::Grpc` instead.
While the stargate query sometimes returns protobuf encoded data and sometimes
While the stargate query sometimes returns protobuf-encoded data and sometimes
JSON encoded data, depending on the chain, the gRPC query always returns
protobuf encoded data.
protobuf-encoded data.

```diff
-deps.querier.query(&QueryRequest::Stargate {
Expand Down Expand Up @@ -1311,7 +1311,7 @@ arbitrary ones.

The existing `CanonicalAddr` remains unchanged and can be used in cases in
which a compact binary representation is desired. For JSON state this does not
save much data (e.g. the bech32 address
save much data (e.g. the Bech32 address
cosmos1pfq05em6sfkls66ut4m2257p7qwlk448h8mysz takes 45 bytes as direct ASCII
and 28 bytes when its canonical representation is base64 encoded). For
fixed-length database keys `CanonicalAddr` remains handy though.
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/schema/ibc-reflect-send.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"additionalProperties": false
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"additionalProperties": false
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect-send/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
"additionalProperties": false
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
Expand Down
2 changes: 1 addition & 1 deletion contracts/ibc-reflect/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"additionalProperties": false
},
{
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"type": "object",
"required": [
"any"
Expand Down
4 changes: 2 additions & 2 deletions contracts/reflect/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"additionalProperties": false
},
{
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"type": "object",
"required": [
"any"
Expand Down Expand Up @@ -357,7 +357,7 @@
"additionalProperties": false
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
Expand Down
4 changes: 2 additions & 2 deletions contracts/reflect/schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
"additionalProperties": false
},
{
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"description": "`CosmosMsg::Any` replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is supported by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
"type": "object",
"required": [
"any"
Expand Down Expand Up @@ -367,7 +367,7 @@
"additionalProperties": false
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"description": "This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/results/cosmos_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub enum CosmosMsg<T = Empty> {
type_url: String,
value: Binary,
},
/// `CosmosMsg::Any` is the replaces the "stargate message" – a message wrapped
/// `CosmosMsg::Any` replaces the "stargate message" – a message wrapped
/// in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any)
/// that is supported by the chain. It behaves the same as
/// `CosmosMsg::Stargate` but has a better name and slightly improved syntax.
Expand Down Expand Up @@ -176,7 +176,7 @@ pub enum DistributionMsg {
/// The `withdraw_address`
address: String,
},
/// This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).
/// This is translated to a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50).
/// `delegator_address` is automatically filled with the current contract's address.
WithdrawDelegatorReward {
/// The `validator_address`
Expand Down
Loading