Skip to content

Commit

Permalink
chore(cw-context)!: renamed 'path' to 'merkle_path' (cosmos#1293)
Browse files Browse the repository at this point in the history
* chore!: renamed 'path' to 'merkle_path'

* chore: add changelog

* nit: fix warnings in cosmwasm readme

---------

Co-authored-by: Farhad Shabani <[email protected]>
  • Loading branch information
srdtrk and Farhad-Shabani authored Aug 7, 2024
1 parent 229add4 commit ccf6ce6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [ibc-client-cw] Rename `path` to `merkle_path` in `cw-context` for verify
(non)membership ([\#1291](https://github.com/cosmos/ibc-rs/issues/1291))
26 changes: 13 additions & 13 deletions cosmwasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ contracts. Currently, the available packages are:

## IBC Clients

- [ibc-client-cw](./cw-context): Provides utilities and a generic `Context` object
- [ibc-client-cw](./ibc-clients/cw-context): Provides utilities and a generic `Context` object
to streamline the implementation of any ibc-rs-powered light clients as
CosmWasm contracts.
- To utilize the CosmWasm contracts developed with this library, hosting
environments must support the CosmWasm module and be using the version of
`ibc-go` that supports the `08-wasm` proxy light client.

> [!CAUTION]
> The `ibc-client-cw` is currently in development and should not be
deployed for production use. Users are advised to exercise caution and test
thoroughly in non-production environments.
> [!CAUTION]
> The `ibc-client-cw` is currently in development and should not be
deployed for production use. Users are advised to exercise caution and test
thoroughly in non-production environments.

- [ibc-client-tendermint-cw](./../cosmwasm/ibc-clients/ics07-tendermint): CosmWasm Contract
- [ibc-client-tendermint-cw](./ibc-clients/ics07-tendermint): CosmWasm Contract

> [!TIP]
> The pre-compiled CosmWasm contract for `ibc-client-tendermint-cw` is available
> as Github workflow artifacts at
> [_Actions_](https://github.com/cosmos/ibc-rs/actions/workflows/upload-cw-clients.yaml)
> tab. They can be downloaded
> [during a Github workflow](https://github.com/cosmos/ibc-rs/blob/1098f252c04152812f026520e28e323f3bc0507e/.github/workflows/upload-cw-clients.yaml#L87-L96)
> using `actions/download-artifact@v4` action.
> [!TIP]
> The pre-compiled CosmWasm contract for `ibc-client-tendermint-cw` is available
> as Github workflow artifacts at
> [_Actions_](https://github.com/cosmos/ibc-rs/actions/workflows/upload-cw-clients.yaml)
> tab. They can be downloaded
> [during a Github workflow](https://github.com/cosmos/ibc-rs/blob/1098f252c04152812f026520e28e323f3bc0507e/.github/workflows/upload-cw-clients.yaml#L87-L96)
> using `actions/download-artifact@v4` action.
14 changes: 7 additions & 7 deletions cosmwasm/ibc-clients/cw-context/src/types/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub struct MerklePath {
#[cw_serde]
pub struct VerifyMembershipMsgRaw {
pub proof: Binary,
pub path: MerklePath,
pub merkle_path: MerklePath,
pub value: Binary,
pub height: RawHeight,
pub delay_block_period: u64,
Expand All @@ -144,8 +144,8 @@ impl TryFrom<VerifyMembershipMsgRaw> for VerifyMembershipMsg {

fn try_from(mut raw: VerifyMembershipMsgRaw) -> Result<Self, Self::Error> {
let proof = CommitmentProofBytes::try_from(raw.proof.to_vec())?;
let prefix = CommitmentPrefix::from_bytes(raw.path.key_path.remove(0));
let path = PathBytes::flatten(raw.path.key_path);
let prefix = CommitmentPrefix::from_bytes(raw.merkle_path.key_path.remove(0));
let path = PathBytes::flatten(raw.merkle_path.key_path);
let height = Height::try_from(raw.height)?;

Ok(Self {
Expand All @@ -163,7 +163,7 @@ impl TryFrom<VerifyMembershipMsgRaw> for VerifyMembershipMsg {
#[cw_serde]
pub struct VerifyNonMembershipMsgRaw {
pub proof: Binary,
pub path: MerklePath,
pub merkle_path: MerklePath,
pub height: RawHeight,
pub delay_block_period: u64,
pub delay_time_period: u64,
Expand All @@ -183,8 +183,8 @@ impl TryFrom<VerifyNonMembershipMsgRaw> for VerifyNonMembershipMsg {

fn try_from(mut raw: VerifyNonMembershipMsgRaw) -> Result<Self, Self::Error> {
let proof = CommitmentProofBytes::try_from(raw.proof.to_vec())?;
let prefix = CommitmentPrefix::from_bytes(raw.path.key_path.remove(0));
let path = PathBytes::flatten(raw.path.key_path);
let prefix = CommitmentPrefix::from_bytes(raw.merkle_path.key_path.remove(0));
let path = PathBytes::flatten(raw.merkle_path.key_path);
let height = raw.height.try_into()?;

Ok(Self {
Expand Down Expand Up @@ -277,7 +277,7 @@ mod test {
"delay_time_period":0,
"delay_block_period":0,
"proof":"CuECCt4CChhjb25uZWN0aW9ucy9jb25uZWN0aW9uLTASWgoPMDctdGVuZGVybWludC0wEiMKATESDU9SREVSX09SREVSRUQSD09SREVSX1VOT1JERVJFRBgCIiAKCTA4LXdhc20tMBIMY29ubmVjdGlvbi0wGgUKA2liYxoLCAEYASABKgMAAkgiKQgBEiUCBHAg3HTYmBAMxlr6u0mv6wCpm3ur2WQc7A3Af6aV7Ye0Fe0gIisIARIEBAZwIBohIHXEkQ9RIH08ZZYBIP6THxOOJiRmjXWGn1G4RCWT3V6rIisIARIEBgxwIBohIEUjGWV7YLPEzdFVLAb0lv4VvP7A+l1TqFkjpx1kDKAPIikIARIlCBhwILWsAKEot+2MknVyn5zcS0qsqVhRj4AHpgDx7fNPbfhtICIpCAESJQxAcCCzyYMGE+CdCltudr1ddHvCJrqv3kl/i7YnMLx3XWJt/yAK/AEK+QEKA2liYxIg2nvqL76rejXXGlX6ng/UKrbw+72C8uKKgM2vP0JKj1QaCQgBGAEgASoBACIlCAESIQEGuZwNgRn/HtvL4WXQ8ZM327wIDmd8iOV6oq52fr8PDyInCAESAQEaIKplBAbqDXbjndQ9LqapHj/aockI/CGnymjl5izIEVY5IiUIARIhAdt4G8DCLINAaaJnhUMIzv74AV3zZiugAyyZ/lWYRv+cIiUIARIhAf+sohoEV+uWeKThAPEbqCUivWT4H8KNT7Giw9//LsyvIicIARIBARogNHO4HC5KxPCwBdQGgBCscVtEKw+YSn2pnf654Y3Oxik=",
"path":{"key_path":["aWJj","Y29ubmVjdGlvbnMvY29ubmVjdGlvbi0w"]},
"merkle_path":{"key_path":["aWJj","Y29ubmVjdGlvbnMvY29ubmVjdGlvbi0w"]},
"value":"Cg8wNy10ZW5kZXJtaW50LTASIwoBMRINT1JERVJfT1JERVJFRBIPT1JERVJfVU5PUkRFUkVEGAIiIAoJMDgtd2FzbS0wEgxjb25uZWN0aW9uLTAaBQoDaWJj"
}
}"#;
Expand Down

0 comments on commit ccf6ce6

Please sign in to comment.