-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: bump injective version #252
Conversation
WalkthroughThis pull request introduces widespread changes across the Injective Standard Library, focusing on two primary modifications: updating dependency versions and adding the Changes
Poem
Possibly related PRs
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
♻️ Duplicate comments (1)
packages/injective-std/src/types/cosmos/gov/v1.rs (1)
172-172
:⚠️ Potential issueCannot implement Copy trait for structs with non-Copy fields
Same issue as in
distribution/v1beta1.rs
- attempting to deriveCopy
for structs containing non-Copy fields.Also applies to: 880-880
🧰 Tools
🪛 GitHub Check: Lints
[failure] 172-172:
the traitstd::marker::Copy
cannot be implemented for this type🪛 GitHub Actions: Basic
[error] 172-178: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy
🧹 Nitpick comments (1)
packages/injective-std/src/types/cosmos/staking/v1beta1.rs (1)
Line range hint
1-1
: General guidance for implementing theCopy
trait.When implementing the
Copy
trait:
- It's safe and beneficial for zero-sized types (empty structs).
- All fields in the struct must implement
Copy
.- Types like
Option<shim::Duration>
andOption<shim::Timestamp>
don't implementCopy
, so structs containing these fields cannot implementCopy
.Please review all structs and remove the
Copy
trait where fields don't support it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (30)
Cargo.toml
(2 hunks)packages/injective-std-derive/Cargo.toml
(1 hunks)packages/injective-std/Cargo.toml
(1 hunks)packages/injective-std/src/types/cosmos/auth/v1beta1.rs
(7 hunks)packages/injective-std/src/types/cosmos/authz/module/v1.rs
(1 hunks)packages/injective-std/src/types/cosmos/authz/v1beta1.rs
(2 hunks)packages/injective-std/src/types/cosmos/bank/v1beta1.rs
(5 hunks)packages/injective-std/src/types/cosmos/base/node/v1beta1.rs
(2 hunks)packages/injective-std/src/types/cosmos/base/v1beta1.rs
(4 hunks)packages/injective-std/src/types/cosmos/distribution/v1beta1.rs
(7 hunks)packages/injective-std/src/types/cosmos/feegrant/module/v1.rs
(1 hunks)packages/injective-std/src/types/cosmos/feegrant/v1beta1.rs
(3 hunks)packages/injective-std/src/types/cosmos/gov/v1.rs
(11 hunks)packages/injective-std/src/types/cosmos/gov/v1beta1.rs
(7 hunks)packages/injective-std/src/types/cosmos/params/module/v1.rs
(1 hunks)packages/injective-std/src/types/cosmos/params/v1beta1.rs
(1 hunks)packages/injective-std/src/types/cosmos/staking/v1beta1.rs
(6 hunks)packages/injective-std/src/types/cosmwasm/wasm/v1.rs
(18 hunks)packages/injective-std/src/types/injective/auction/mod.rs
(0 hunks)packages/injective-std/src/types/injective/auction/v1beta1.rs
(10 hunks)packages/injective-std/src/types/injective/exchange/mod.rs
(0 hunks)packages/injective-std/src/types/injective/exchange/v1beta1.rs
(54 hunks)packages/injective-std/src/types/injective/insurance/v1beta1.rs
(9 hunks)packages/injective-std/src/types/injective/oracle/v1beta1.rs
(22 hunks)packages/injective-std/src/types/injective/peggy/mod.rs
(0 hunks)packages/injective-std/src/types/injective/peggy/v1.rs
(27 hunks)packages/injective-std/src/types/injective/permissions/v1beta1.rs
(11 hunks)packages/injective-std/src/types/injective/tokenfactory/v1beta1.rs
(7 hunks)packages/injective-std/src/types/injective/wasmx/v1.rs
(7 hunks)packages/injective-testing/Cargo.toml
(1 hunks)
💤 Files with no reviewable changes (3)
- packages/injective-std/src/types/injective/auction/mod.rs
- packages/injective-std/src/types/injective/exchange/mod.rs
- packages/injective-std/src/types/injective/peggy/mod.rs
✅ Files skipped from review due to trivial changes (1)
- packages/injective-std-derive/Cargo.toml
🧰 Additional context used
🪛 GitHub Check: Lints
packages/injective-std/src/types/cosmos/gov/v1.rs
[failure] 172-172:
the trait std::marker::Copy
cannot be implemented for this type
[failure] 880-880:
the trait std::marker::Copy
cannot be implemented for this type
packages/injective-std/src/types/injective/insurance/v1beta1.rs
[failure] 3-3:
the trait std::marker::Copy
cannot be implemented for this type
packages/injective-std/src/types/cosmos/staking/v1beta1.rs
[failure] 598-598:
the trait std::marker::Copy
cannot be implemented for this type
packages/injective-std/src/types/cosmos/gov/v1beta1.rs
[failure] 164-164:
the trait std::marker::Copy
cannot be implemented for this type
🪛 GitHub Actions: Basic
packages/injective-std/src/types/cosmos/gov/v1.rs
[error] 172-178: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy
[error] 880-893: Cannot implement Copy trait for type with field 'canceled_time' because Optionshim::Timestamp does not implement Copy
packages/injective-std/src/types/injective/insurance/v1beta1.rs
[error] 3-10: Cannot implement Copy trait for type with field 'default_redemption_notice_period_duration' because Optionshim::Duration does not implement Copy
packages/injective-std/src/types/cosmos/staking/v1beta1.rs
[error] 598-602: Cannot implement Copy trait for type with field 'completion_time' because Optionshim::Timestamp does not implement Copy
packages/injective-std/src/types/cosmos/gov/v1beta1.rs
[error] 164-169: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy
🔇 Additional comments (28)
packages/injective-std/src/types/cosmos/authz/module/v1.rs (1)
4-4
: LGTM: Safe addition of Copy traitAdding the
Copy
trait to this zero-sized struct is safe and consistent with the module-wide changes.packages/injective-std/src/types/cosmos/params/module/v1.rs (1)
4-4
: LGTM: Safe addition of Copy traitAdding the
Copy
trait to this zero-sized struct is safe and consistent with the module-wide changes.packages/injective-std/src/types/cosmos/feegrant/module/v1.rs (1)
4-4
: LGTM: Safe addition of Copy traitAdding the
Copy
trait to this zero-sized struct is safe and consistent with the module-wide changes.packages/injective-std/src/types/cosmos/base/node/v1beta1.rs (1)
4-4
: LGTM! AddingCopy
trait to zero-sized request types.The addition of the
Copy
trait to these zero-sized request types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.Also applies to: 27-27
packages/injective-std/src/types/cosmos/params/v1beta1.rs (1)
57-57
: LGTM! AddingCopy
trait to zero-sized request type.The addition of the
Copy
trait to this zero-sized request type is appropriate as it is trivially copyable, and it aligns with the PR objective of enhancing struct usability.packages/injective-std/src/types/cosmos/feegrant/v1beta1.rs (1)
179-179
: LGTM! AddingCopy
trait to zero-sized response types.The addition of the
Copy
trait to these zero-sized response types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.Also applies to: 196-196, 214-214
packages/injective-std/src/types/injective/auction/v1beta1.rs (4)
16-18
: LGTM! New field added to control INJ basket cap.The new
inj_basket_max_cap
field is properly tagged and follows consistent type patterns with other string fields in the struct.
179-179
: LGTM! Field names updated to follow Rust naming conventions.The change from camelCase to snake_case improves consistency with Rust naming conventions:
auctionRound
→auction_round
auctionClosingTime
→auction_closing_time
highestBidder
→highest_bidder
highestBidAmount
→highest_bid_amount
Also applies to: 186-186, 189-189, 192-192
138-138
: LGTM! AddingCopy
trait to zero-sized request/response types.The addition of the
Copy
trait to these zero-sized request/response types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.Also applies to: 157-157, 197-197, 214-214, 247-247, 264-264
26-27
: Verify the impact of changing field types from optional Coin to String.The change from
Option<Coin>
toString
for amount fields could be a breaking change that affects serialization/deserialization in existing clients.Run the following script to check for potential impacts:
Also applies to: 37-38, 55-56, 73-74
✅ Verification successful
The type change from
Option<Coin>
toString
is consistent with existing patternsThe change aligns with how amount fields are handled throughout the auction module, where String is consistently used for amount fields in protobuf messages. The proper serialization traits are in place to handle the conversion.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usages of the changed amount fields to assess impact # Search for direct field access patterns rg -A 3 'amount: Option<Coin>' # Search for serialization/deserialization of these types rg -A 3 'serde.*Coin'Length of output: 56
Script:
#!/bin/bash # Search for the file content and related structs echo "=== Searching for auction-related struct definitions ===" rg -p "struct \w+Bid|struct \w+Auction" -A 10 echo "=== Checking for imports and uses of auction types ===" rg -p "use.*auction.*Bid|use.*auction.*Auction" echo "=== Looking for any serialization traits ===" rg -p "impl.*Serialize|impl.*Deserialize|#\[derive\(.*Serialize.*\)\]|#\[derive\(.*Deserialize.*\)\]" --type rust echo "=== Checking git history for these files ===" git log --oneline -- "**/auction/**"Length of output: 69430
packages/injective-std/src/types/cosmos/authz/v1beta1.rs (1)
189-191
: LGTM! AddingCopy
trait to zero-sized response types.The addition of the
Copy
trait toMsgGrantResponse
andMsgRevokeResponse
is appropriate as these are zero-sized types. This change allows for more efficient handling in contexts where copying is preferred over moving, with no performance overhead since zero-sized types are optimized away by the compiler.Also applies to: 230-232
packages/injective-std/src/types/injective/tokenfactory/v1beta1.rs (1)
Line range hint
101-106
: LGTM! Consistent application ofCopy
trait to response types.The addition of the
Copy
trait to all response structs (QueryParamsRequest
,QueryModuleStateRequest
,MsgMintResponse
,MsgBurnResponse
,MsgChangeAdminResponse
,MsgSetDenomMetadataResponse
,MsgUpdateParamsResponse
) is appropriate and consistent. These are all zero-sized types where copying has no performance impact.Also applies to: 166-171, 232-234, 247-249, 266-268, 283-285, 300-302
packages/injective-std/src/types/cosmos/auth/v1beta1.rs (1)
Line range hint
55-82
: LGTM! Well-considered addition ofCopy
trait.The addition of the
Copy
trait is appropriate for all modified structs. Special note onParams
: while it contains actual fields (unlike the empty response types), these are allu64
values which are efficiently copyable, making theCopy
implementation practical and beneficial for parameter handling.Also applies to: 154-159, 163-168, 174-179, 215-220, 284-291, 372-374
packages/injective-std/src/types/injective/permissions/v1beta1.rs (1)
Line range hint
13-21
: LGTM! Comprehensive and consistent addition ofCopy
trait.The addition of the
Copy
trait is well-applied across different types:
- Empty response types (e.g.,
MsgUpdateParamsResponse
,MsgCreateNamespaceResponse
)- Simple message types with boolean fields (e.g.,
MsgSetMintsPaused
,MsgSetSendsPaused
)Params
struct with au64
fieldAll modified types either have no fields or contain only Copy-able primitive types, making this change both safe and beneficial for memory management.
Also applies to: 141-146, 150-155, 160-165, 276-278, 289-291, 302-304, 335-339, 342-346, 349-353, 357-359, 377-379, 394-396, 407-409
packages/injective-std/src/types/injective/wasmx/v1.rs (1)
290-290
: LGTM! TheCopy
trait implementation is appropriate for these response types.The added
Copy
trait implementation is safe and beneficial for these empty response structs as they are zero-sized types. This change will allow for more efficient handling of these types in the codebase.Also applies to: 309-309, 400-400, 414-414, 428-428, 445-445, 458-458
packages/injective-std/src/types/cosmos/bank/v1beta1.rs (1)
388-388
: LGTM! Adding Copy trait to empty response structsAdding the
Copy
trait to these empty response structs is appropriate since they don't contain any fields. This makes them more ergonomic to use while maintaining safety.Also applies to: 604-604, 621-621, 645-645, 676-676
packages/injective-std/src/types/injective/oracle/v1beta1.rs (1)
653-653
: LGTM! Adding Copy trait to response structsAdding the
Copy
trait to these structs is appropriate since they either:
- Are empty response structs with no fields
- Only contain fields that implement
Copy
(like primitive types)This makes them more ergonomic to use while maintaining safety.
Also applies to: 943-943, 962-962, 981-981, 1000-1000, 1019-1019, 1038-1038, 1057-1057, 1076-1076, 1095-1095, 1138-1138, 1180-1180, 1232-1232, 1268-1268, 1359-1359, 1379-1379, 1398-1398, 1415-1415, 1430-1430, 1451-1451, 1466-1466, 1483-1483
packages/injective-std/src/types/injective/peggy/v1.rs (3)
214-214
: LGTM! Adding Copy trait is appropriate here.The struct only contains u64 fields which are Copy-able, making this a safe and ergonomic improvement.
232-232
: LGTM! Adding Copy trait is appropriate here.The struct only contains u64 fields which are Copy-able, making this a safe and ergonomic improvement.
733-733
: LGTM! Adding Copy trait to empty response structs is appropriate.These are all empty response structs with no fields, making Copy trait implementation safe and ergonomic.
Also applies to: 769-769, 798-798, 820-820, 851-851, 889-889, 922-922, 962-962, 983-983, 1001-1001, 1038-1038, 1055-1055, 1074-1074, 1093-1093
packages/injective-std/src/types/cosmwasm/wasm/v1.rs (3)
149-222
: LGTM! Well-structured event definitions for contract lifecycle tracking.The new event structs are well-documented and contain appropriate fields for their respective purposes:
- EventCodeStored: Tracks code storage with code_id, creator, access_config, and checksum
- EventContractInstantiated: Tracks contract instantiation with relevant contract details
- EventContractMigrated: Tracks contract migrations
- EventContractAdminSet: Tracks admin changes
1101-1101
: LGTM! Adding Copy trait to query request structs is appropriate.Both structs are suitable for Copy implementation:
- QueryCodeRequest only contains a u64 field
- QueryParamsRequest is an empty struct
Also applies to: 1197-1197
1478-1478
: LGTM! Adding Copy trait to empty response structs is appropriate.These are all empty response structs with no fields, making Copy trait implementation safe and ergonomic.
Also applies to: 1495-1495, 1520-1520, 1544-1544, 1596-1596, 1619-1619, 1698-1698, 1716-1716, 1783-1783
packages/injective-std/src/types/injective/exchange/v1beta1.rs (2)
332-332
: Field renames follow Rust naming conventions.The field renames from camelCase to snake_case follow Rust naming conventions:
isPerpetual
→is_perpetual
isReduceOnly
→is_reduce_only
isLong
→is_long
isBuy
→is_buy
Also applies to: 816-816, 886-886, 905-905
550-550
: Verify the impact of adding theCopy
trait to message structs.The
Copy
trait has been added to several message structs. While this allows for efficient copying of these structs, we should verify that:
- The structs are small enough that copying is more efficient than referencing
- The addition of
Copy
doesn't break existing code that expects move semanticsAlso applies to: 644-644, 1096-1096, 1905-1905, 1939-1939, 1956-1956, 1977-1977, 1997-1997, 2078-2078, 2147-2147, 2225-2225, 2301-2301, 2424-2424, 2619-2619, 2651-2651, 2715-2715, 2736-2736, 2758-2758, 2778-2778, 2804-2804, 2830-2830, 2869-2869, 2887-2887, 4029-4029, 4073-4073, 5130-5130, 5143-5143, 5161-5161, 5208-5208, 5257-5257, 5306-5306, 5325-5325, 5371-5371, 5406-5406, 5414-5414, 5442-5442
✅ Verification successful
The addition of
Copy
trait is safe and efficient for these message structsThe structs are either empty or contain only primitive numeric types (i64, u32, u64), making them very small (maximum 16 bytes) and efficiently copyable. Their usage patterns in query responses and state tracking are well-suited for copy semantics.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the size of structs and their usage patterns # Find struct sizes ast-grep --pattern 'struct $struct_name { $$$ }' # Find places where these structs are used rg -A 2 "NextFundingTimestamp|SubaccountTradeNonce|FeeDiscountTierTTL|MsgUpdateSpotMarketResponse|MsgUpdateDerivativeMarketResponse|MsgUpdateParamsResponse|MsgDepositResponse|MsgWithdrawResponse|MsgCreateSpotLimitOrderResponse|MsgBatchCreateSpotLimitOrdersResponse|MsgInstantSpotMarketLaunchResponse|MsgInstantPerpetualMarketLaunchResponse|MsgInstantBinaryOptionsMarketLaunchResponse|MsgInstantExpiryFuturesMarketLaunchResponse|MsgCancelSpotOrderResponse|MsgBatchCancelSpotOrdersResponse|MsgBatchCancelBinaryOptionsOrdersResponse|MsgCancelDerivativeOrderResponse|MsgCancelBinaryOptionsOrderResponse|MsgSubaccountTransferResponse|MsgExternalTransferResponse|MsgLiquidatePositionResponse|MsgEmergencySettleMarketResponse|MsgIncreasePositionMarginResponse|MsgDecreasePositionMarginResponse|MsgRewardsOptOutResponse|MsgReclaimLockedFundsResponse|QueryExchangeParamsRequest|QueryExchangeBalancesRequest|QueryPositionsRequest|QueryTradeRewardCampaignRequest|QueryFeeDiscountScheduleRequest|QueryOptedOutOfRewardsAccountsRequest|QueryBalanceWithBalanceHoldsRequest|QueryFeeDiscountTierStatisticsRequest|MitoVaultInfosRequest|TradeHistoryOptions|TierStatistic"Length of output: 52469
packages/injective-std/Cargo.toml (1)
8-8
: Version and dependency updates look good.
- Version bump from 1.13.2 to 1.13.3 is appropriate for the changes
- Dependency path update for injective-std-derive is correct
Also applies to: 15-15
packages/injective-testing/Cargo.toml (1)
15-17
: Dependency configuration simplified correctly.Removing path attributes and relying on workspace resolution is a good practice when the dependencies are properly configured in the workspace.
Cargo.toml (1)
15-15
: Verify compatibility with updated dependencies.The following dependency updates need verification:
- cosmwasm-std: 2.1.0 → 2.2.0
- injective-std: 1.13.2 → 1.13.3
- prost: 0.12.6 → 0.13.4 (added prost-derive feature)
- prost-types: 0.12.6 → 0.13.4
Also applies to: 25-25, 32-33
✅ Verification successful
Dependencies and features verified successfully
The dependency updates are safe to proceed with as:
- All features are properly configured in the workspace
- No breaking changes detected in dependency usage patterns
- Dependencies are properly structured with workspace inheritance
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for breaking changes in dependency updates # Check if any code relies on removed or changed APIs rg "use (cosmwasm_std|prost|prost_types)::\w+::" -A 2 # Look for potential compile errors rg "error\[E\d+\]|warning:"Length of output: 1484
Script:
#!/bin/bash # Search for direct imports and usages rg "use (cosmwasm_std|prost|prost_types)[^:]" -l # Look for derive macros rg "#\[derive\(.*?(Prost|Message).*?\)\]" -A 1 # Find proto-related files fd -e proto # Check feature declarations rg "features\s*=\s*\[" -A 3 Cargo.toml # Look for any potential breaking changes in main files rg "use cosmwasm_std" srcLength of output: 68990
Script:
#!/bin/bash # Check Cargo.toml contents for dependencies and features cat Cargo.toml # Look for any workspace dependencies fd -e toml -x cat {} \; # Check for any dependency version constraints in workspace rg "^\[.*dependencies\]" -A 10 Cargo.tomlLength of output: 18424
@@ -5,7 +5,7 @@ use injective_std_derive::CosmwasmExt; | |||
/// signatures required by gogoproto. | |||
#[allow(clippy::derive_partial_eq_without_eq)] | |||
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |||
#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")] | |||
#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoinCoin")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Breaking changes in Protobuf type URLs
The modifications to type_url values for core Cosmos SDK types will break compatibility:
- Original type URLs are standard across the Cosmos ecosystem
- Modified URLs (repeating type names) will break:
- Deserialization of existing data
- Interoperability with other Cosmos SDK clients
- Communication with blockchain nodes
Revert these changes to maintain the standard type URLs:
-#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoinCoin")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")]
-#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoinDecCoinDecCoin")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoin")]
-#[proto_message(type_url = "/cosmos.base.v1beta1.IntProtoIntProtoIntProto")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.IntProto")]
-#[proto_message(type_url = "/cosmos.base.v1beta1.DecProtoDecProtoDecProto")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.DecProto")]
Also applies to: 21-21, 32-32, 41-41
@@ -1,6 +1,6 @@ | |||
use injective_std_derive::CosmwasmExt; | |||
#[allow(clippy::derive_partial_eq_without_eq)] | |||
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |||
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove invalid Copy
trait implementation.
The Params
struct cannot implement the Copy
trait because it contains a field of type Option<shim::Duration>
which doesn't implement Copy
. This will cause compilation failures.
Apply this diff to fix the issue:
-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
🧰 Tools
🪛 GitHub Check: Lints
[failure] 3-3:
the trait std::marker::Copy
cannot be implemented for this type
🪛 GitHub Actions: Basic
[error] 3-10: Cannot implement Copy trait for type with field 'default_redemption_notice_period_duration' because Optionshim::Duration does not implement Copy
@@ -161,7 +161,7 @@ | |||
} | |||
/// VotingParams defines the params for voting on governance proposals. | |||
#[allow(clippy::derive_partial_eq_without_eq)] | |||
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |||
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove invalid Copy
trait implementation.
The VotingParams
struct cannot implement the Copy
trait because it contains a field of type Option<shim::Duration>
which doesn't implement Copy
. This will cause compilation failures.
Apply this diff to fix the issue:
-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
🧰 Tools
🪛 GitHub Check: Lints
[failure] 164-164:
the trait std::marker::Copy
cannot be implemented for this type
🪛 GitHub Actions: Basic
[error] 164-169: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy
@@ -595,7 +595,7 @@ | |||
} | |||
/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. | |||
#[allow(clippy::derive_partial_eq_without_eq)] | |||
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |||
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove invalid Copy
trait implementation.
The MsgBeginRedelegateResponse
struct cannot implement the Copy
trait because it contains a field of type Option<shim::Timestamp>
which doesn't implement Copy
. This will cause compilation failures.
Apply this diff to fix the issue:
-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
🧰 Tools
🪛 GitHub Check: Lints
[failure] 598-598:
the trait std::marker::Copy
cannot be implemented for this type
🪛 GitHub Actions: Basic
[error] 598-602: Cannot implement Copy trait for type with field 'completion_time' because Optionshim::Timestamp does not implement Copy
@@ -336,7 +336,7 @@ pub struct GenesisState { | |||
} | |||
/// QueryParamsRequest is the request type for the Query/Params RPC method. | |||
#[allow(clippy::derive_partial_eq_without_eq)] | |||
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] | |||
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot implement Copy trait for structs with non-Copy fields
Several structs are attempting to derive Copy
but contain fields that don't implement Copy
:
VotingParams
containsOption<shim::Duration>
MsgCancelProposalResponse
containsOption<shim::Timestamp>
This will cause compilation failures.
Remove the Copy
trait from these structs:
-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ...)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ...)]
Also applies to: 579-579, 610-610, 666-666, 690-690, 715-715, 738-738
Summary by CodeRabbit
Based on the comprehensive summary of changes, here are the release notes:
Dependency Updates
cosmwasm-std
from2.1.0
to2.2.0
injective-std
from1.13.2
to1.13.3
prost
andprost-types
from0.12.6
to0.13.4
Code Improvements
Copy
trait to numerous structs across multiple modules, enhancing performance and memory managementStructural Changes
These changes primarily focus on improving code quality, performance, and maintainability across the Injective Standard library.