From 6a4ef5f7aa76ad03f33734a3fd6771c04594bb65 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Fri, 9 Aug 2024 15:02:50 -0500 Subject: [PATCH] Fix clippy warning --- CHANGELOG.md | 105 ++++++++++++++---- .../types/src/client_state.rs | 5 +- 2 files changed, 86 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d5326ac7..fe11cc3bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,70 @@ # CHANGELOG +## v0.54.0 + +*August 9, 2024* + +### BREAKING CHANGES + +- [ibc-primitive] Decouple `Timestamp` definition from `tendermint::Time`. + ([\#180](https://github.com/cosmos/ibc-rs/issues/180)) +- [ics23] Auto-derive `serde::Serialize` for `CommitmentPrefix`. + ([\#1229](https://github.com/cosmos/ibc-rs/issues/1229)) +- [ibc] Bump MSRV version to 1.72.1 + ([\#1276](https://github.com/cosmos/ibc-rs/pull/1276)) +- [ibc-client-cw] Rename `path` to `merkle_path` in `cw-context` for verify + (non)membership ([\#1291](https://github.com/cosmos/ibc-rs/issues/1291)) +- [ibc-core] Separate the packet timeout timestamp from the host `Timestamp` by + defining a new specific `TimeoutTimestamp`. + ([\#1296](https://github.com/cosmos/ibc-rs/issues/1296)) + +### BUG FIXES + +- [ibc-core-client] Prevent expired client creations by ensuring that consensus + state's timestamp is within the trusting period. +- ([\#1088](https://github.com/cosmos/ibc-rs/issues/1088)) +- [ibc-client-tendermint] Expire a client when the elapsed time from a trusted + header equals the trusting period, to stay consistent with the expiry logic in + `tendermint-rs` ([\#1239](https://github.com/cosmos/ibc-rs/issues/1239)) +- [ibc-client-tendermint] Fix client verification panic on upgrades when the + `upgrade_path` size is 1. + ([\#1297](https://github.com/cosmos/ibc-rs/issues/1297)) +- [ibc-client-tendermint] Use the user-defined upgrade path for client upgrades, +instead of defaulting to `UPGRADED_IBC_STATE`. + ([\#1303](https://github.com/cosmos/ibc-rs/issues/1303)) +- [ibc-core] Prevent `Timestamp::nanoseconds` from panicking by disallowing + negative values from `tendermint::Time`. + ([\#1306](https://github.com/cosmos/ibc-rs/issues/1306)) + +### FEATURES + +- [ibc-core-commitment-types] Allow empty `CommitmentPrefix` + ([#1006](https://github.com/cosmos/ibc-rs/issues/1006)). +- Unpack/pack Wasm client/consensus state at `ConnectionOpenTry` and + `ConnectionOpenAck` for host client/consensus state. + ([#1237](https://github.com/cosmos/ibc-rs/issues/1237)). +- [ibc-core-client] Enable proof verification methods to accept custom paths as + bytes by defining a new `serializer_path()` API allowing light client + developers to introduce the path serialization behavior of their system. + ([\#1255](https://github.com/cosmos/ibc-rs/issues/1255)) + +### IMPROVEMENTS + +- Update `ibc-proto` to v0.46.0 and `tendermint` to v0.37.0. + ([\#1264](https://github.com/cosmos/ibc-rs/pull/1264)) +- [ibc-client-cw] Supersede `Bytes` with `cosmwasm::Binary`. + ([\#1271](https://github.com/cosmos/ibc-rs/issues/1271)) +- [ibc-client] Bump cosmwasm version to 2.1.0 + ([\#1276](https://github.com/cosmos/ibc-rs/pull/1276)) +- [ibc-client-cw] Refactor CosmWasm response types to match `08-wasm` client API + ([\#1277](https://github.com/cosmos/ibc-rs/issues/1277)) +- [ibc-client-wasm-type] Remove the `cosmwasm` feature for consistent feature + flags across ibc-rs, and use existing `serde` and `schema` features. + ([\#1283](https://github.com/cosmos/ibc-rs/pull/1283)) +- [cosmwasm] Move CosmWasm implementations to a separate workspace under +`cosmwasm` directory to simplify dependency management and decouple `ibc-rs` +MSRV from `cosmwasm`. ([\#1295](https://github.com/cosmos/ibc-rs/issue/1295)) + ## v0.53.0 *May 13, 2024* @@ -725,7 +790,7 @@ There are consensus-breaking changes. ### BREAKING CHANGES -- Support for upgrade client proposal by featuring helper contexts and domain types +- Support for upgrade client proposal by featuring helper contexts and domain types ([#420](https://github.com/cosmos/ibc-rs/issues/420)) - Remove unused `ClientState` methods ([#681](https://github.com/cosmos/ibc-rs/issues/681)) @@ -848,7 +913,7 @@ There are consensus-breaking changes. ### BREAKING CHANGES -- `ClientState`: Split `check_misbehaviour_and_update_state` +- `ClientState`: Split `check_misbehaviour_and_update_state` and `check_header_and_update_state` ([#535](https://github.com/cosmos/ibc-rs/issues/535)) - Improve MsgTransfer struct @@ -862,12 +927,12 @@ There are consensus-breaking changes. - Disallow creation of new Tendermint client state instance with a frozen height ([#178](https://github.com/cosmos/ibc-rs/issues/178)) - Emit a message event for SendPacket ([#574](https://github.com/cosmos/ibc-rs/issues/574)) -- Properly convert from `Any` to `MsgEnvelope` +- Properly convert from `Any` to `MsgEnvelope` ([#578](https://github.com/cosmos/ibc-rs/issues/578)) -- Tendermint light client: fix missing trusted_validator_set +- Tendermint light client: fix missing trusted_validator_set hash check ([#583](https://github.com/cosmos/ibc-rs/issues/583)) -- Tendermint light client: fix missing `Header.height()` +- Tendermint light client: fix missing `Header.height()` vs `Header.trusted_height` check ([#585](https://github.com/cosmos/ibc-rs/issues/585)) - Tendermint light client: ensure that we use the correct @@ -914,7 +979,7 @@ This is a consensus-breaking change. ### BUG -- Timeout handler returns an error only when both height and timestamp have not reached yet +- Timeout handler returns an error only when both height and timestamp have not reached yet ([#555](https://github.com/cosmos/ibc-rs/issues/555)) ## v0.34.0 @@ -927,7 +992,7 @@ This is a consensus-breaking change. ### BUG -- Fix client IDs for the proof verifications in `ConnectionOpenTry` and `ConnectionOpenAck` +- Fix client IDs for the proof verifications in `ConnectionOpenTry` and `ConnectionOpenAck` ([#550](https://github.com/cosmos/ibc-rs/issues/550)) ## v0.33.0 @@ -949,7 +1014,7 @@ There are no consensus-breaking changes. ### IMPROVEMENT -- Fix `ContextError` Display output +- Fix `ContextError` Display output ([#547](https://github.com/cosmos/ibc-rs/issues/547)) ## v0.32.0 @@ -970,7 +1035,7 @@ There are no consensus-breaking changes. - Refactor and privatize Packet/Ack commitment computations for improved security and modularity. ([#470](https://github.com/cosmos/ibc-rs/issues/470)) -- Allow for non-'static bound Modules +- Allow for non-'static bound Modules [#490](https://github.com/cosmos/ibc-rs/issues/490)) - Separate the validation from the execution process for `send/mint/burn_coins` operations. @@ -1002,12 +1067,12 @@ There are no consensus-breaking changes. - Remove ibc::handler module ([#478](https://github.com/cosmos/ibc-rs/issues/478)) - Discard the `connection-channels` method under `ValidationContext` since it is - no longer used by the core handlers. + no longer used by the core handlers. ([#479](https://github.com/cosmos/ibc-rs/issues/479)) - Remove Send + Sync supertraits on the Module trait ([#480](https://github.com/cosmos/ibc-rs/issues/480)) - Modify `validate_self_client` error type to return `ContextError` instead of - `ConnectionError` + `ConnectionError` ([#482](https://github.com/cosmos/ibc-rs/issues/482)) ### IMPROVEMENTS @@ -1019,7 +1084,7 @@ There are no consensus-breaking changes. *February 24, 2023* This release contains an overhaul of the `send_packet()` and `send_transfer()` architecture. -The main gain is to separate into `send_packet_{validate,execute}()`, and similarly for +The main gain is to separate into `send_packet_{validate,execute}()`, and similarly for `send_transfer()`. There are no consensus-breaking changes. @@ -1103,7 +1168,7 @@ There are consensus-breaking changes. ### FEATURE - Finish implementing `ValidationContext::validate()` and - `ExecutionContext::execute()` + `ExecutionContext::execute()` ([#393](https://github.com/cosmos/ibc-rs/issues/393)) ### IMPROVEMENTS @@ -1140,7 +1205,7 @@ There are no consensus-breaking changes. ([#20](https://github.com/cosmos/ibc-rs/issues/20)) - Simplify Msg trait by removing unnecessary methods. ([#218](https://github.com/cosmos/ibc-rs/issues/218)) -- Refactor proof handlers to conduct proof verifications inline with the process function +- Refactor proof handlers to conduct proof verifications inline with the process function and apply naming conventions to packet messages types ([#230](https://github.com/cosmos/ibc-rs/issues/230)) - The function parameters in the Reader traits now references, @@ -1153,7 +1218,7 @@ There are no consensus-breaking changes. - The function parameters in the `ValidationContext` trait now use references, while the functions in the `ExecutionContext` trait take ownership directly. ([#319](https://github.com/cosmos/ibc-rs/issues/319)) -- Make internal `process()` `pub(crate)` +- Make internal `process()` `pub(crate)` ([#338](https://github.com/cosmos/ibc-rs/issues/338)) ### FEATURES @@ -1273,7 +1338,7 @@ There are consensus-breaking changes in the connection and channel handshakes. H ([#145](https://github.com/cosmos/ibc-rs/issues/145)) - Makes channel/packet events compatible with ibc-go ([#146](https://github.com/cosmos/ibc-rs/issues/146)) -- Remove crossing hellos logic from connection handshake. Breaking changes in +- Remove crossing hellos logic from connection handshake. Breaking changes in connection message types. ([#156](https://github.com/cosmos/ibc-rs/issues/156)). - Remove crossing hellos logic from channel handshake @@ -1338,9 +1403,9 @@ This is a major release, which implemented [ADR 4](https://github.com/cosmos/ibc - Remove `Display` from `IbcEvent` ([#144](https://github.com/cosmos/ibc-rs/issues/144)). - Remove `IbcEvent::Empty` ([#144](https://github.com/cosmos/ibc-rs/issues/144)). - Make `client_state` field required in `MsgConnectionOpenTry` and - `MsgConnectionOpenAck`. Necessary for correctness according to spec. + `MsgConnectionOpenAck`. Necessary for correctness according to spec. ([#159](https://github.com/cosmos/ibc-rs/issues/159)). -- Redesign the API to allow light client implementations to be hosted outside the ibc-rs repository. +- Redesign the API to allow light client implementations to be hosted outside the ibc-rs repository. ([#2483](https://github.com/informalsystems/ibc-rs/pull/2483)). ### BUG FIXES @@ -1352,7 +1417,7 @@ This is a major release, which implemented [ADR 4](https://github.com/cosmos/ibc ### FEATURES -- Public PrefixedDenom inner type and add as_str func for BaseDenom +- Public PrefixedDenom inner type and add as_str func for BaseDenom ([#161](https://github.com/cosmos/ibc-rs/issues/161)) ### IMPROVEMENTS @@ -1466,7 +1531,7 @@ This is a major release, which implemented [ADR 4](https://github.com/cosmos/ibc *May 2nd, 2022* -> This is a legacy version with no ibc crate changes. +> This is a legacy version with no ibc crate changes. ## v0.14.0 diff --git a/ibc-clients/ics07-tendermint/types/src/client_state.rs b/ibc-clients/ics07-tendermint/types/src/client_state.rs index bcd42a525..ee30dbdb0 100644 --- a/ibc-clients/ics07-tendermint/types/src/client_state.rs +++ b/ibc-clients/ics07-tendermint/types/src/client_state.rs @@ -240,10 +240,7 @@ impl TryFrom for ClientState { let chain_id = ChainId::from_str(raw.chain_id.as_str())?; let trust_level = { - let trust_level = raw - .trust_level - .clone() - .ok_or(Error::MissingTrustingPeriod)?; + let trust_level = raw.trust_level.ok_or(Error::MissingTrustingPeriod)?; trust_level .try_into() .map_err(|e| Error::InvalidTrustThreshold {