diff --git a/packages/std/src/errors/std_error.rs b/packages/std/src/errors/std_error.rs index 411709ec21..c270b83579 100644 --- a/packages/std/src/errors/std_error.rs +++ b/packages/std/src/errors/std_error.rs @@ -399,7 +399,7 @@ impl From for StdError { pub type StdResult = core::result::Result; /// Indicates operations that are prone to overflow. /// Used to mark numerical operations where overflow checks are necessary. -enum OverflowOperation { + #[derive(Error, Debug, PartialEq, Eq)] pub enum OverflowOperation { Add, @@ -415,7 +415,7 @@ impl fmt::Display for OverflowOperation { write!(f, "{self:?}") } } -///An error struct used when a numeric operation results in an overflow. +/// An error struct used when a numeric operation results in an overflow. #[derive(Error, Debug, PartialEq, Eq)] #[error("Cannot {operation} with given operands")] pub struct OverflowError { @@ -469,7 +469,7 @@ pub enum DivisionError { Overflow, } /// Errors that occur when multiplying a value by a ratio in a checked manner. -/// Ensures precision and overflow safety in the operation. +/// Ensures overflow safety in the operation. #[derive(Error, Debug, PartialEq, Eq)] pub enum CheckedMultiplyFractionError { #[error("{0}")] diff --git a/packages/std/src/hex_binary.rs b/packages/std/src/hex_binary.rs index 77704711bb..5f6eaab999 100644 --- a/packages/std/src/hex_binary.rs +++ b/packages/std/src/hex_binary.rs @@ -6,13 +6,13 @@ use serde::{de, ser, Deserialize, Deserializer, Serialize}; use crate::{Binary, StdError, StdResult}; +/// A wrapper around a vector (Vec) for hex-encoded binary data, supporting encoding and decoding operations. /// This is a wrapper around Vec to add hex de/serialization /// with serde. It also adds some helper methods to help encode inline. /// /// This is similar to `cosmwasm_std::Binary` but uses hex. /// See also . #[derive(Clone, Default, PartialEq, Eq, Hash, PartialOrd, Ord, JsonSchema)] -///A wrapper around a vector (Vec) for hex-encoded binary data, supporting encoding and decoding operations. pub struct HexBinary(#[schemars(with = "String")] Vec); impl HexBinary { diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index fc48c2879c..170dad3fc6 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -15,7 +15,6 @@ use crate::timestamp::Timestamp; /// Messages pertaining to the IBC lifecycle, specifically for contracts with IBC capabilities. /// Manages cross-chain communications and other IBC protocol interactions. -enum IbcMsg { #[non_exhaustive] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] @@ -414,8 +413,7 @@ impl IbcPacketReceiveMsg { Self { packet, relayer } } } - -/// Message format used when acknowledging the receipt of an IBC packet. +/// Message format used when acknowledging the receipt of an IBC packet. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[non_exhaustive] pub struct IbcPacketAckMsg { @@ -458,9 +456,9 @@ impl IbcPacketTimeoutMsg { /// /// Callbacks that have return values (like receive_packet) /// or that cannot redispatch messages (like the handshake callbacks) -/// will use other Response types +/// will use other Response types. +/// A general response structure for IBC handler operations, used when a specific response format isn't required. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] -///A general response structure for IBC handler operations, used when a specific response format isn't required. #[non_exhaustive] pub struct IbcBasicResponse { /// Optional list of messages to pass. These will be executed in order. diff --git a/packages/std/src/query/mod.rs b/packages/std/src/query/mod.rs index 3158b97470..3bd3461e0d 100644 --- a/packages/std/src/query/mod.rs +++ b/packages/std/src/query/mod.rs @@ -38,7 +38,6 @@ pub use staking::*; pub use wasm::*; /// Enumerates different types of query requests. /// Facilitates data retrieval from various modules or contracts in a structured manner. -enum QueryRequest { #[non_exhaustive] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] @@ -65,7 +64,6 @@ pub enum QueryRequest { Ibc(IbcQuery), Wasm(WasmQuery), } - /// A trait that is required to avoid conflicts with other query types like BankQuery and WasmQuery /// in generic implementations. /// You need to implement it in your custom query type.