Skip to content

Commit

Permalink
doc edit
Browse files Browse the repository at this point in the history
  • Loading branch information
costa2400 committed Jan 23, 2024
1 parent 04933f0 commit 00b2b16
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/std/src/errors/std_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl From<DivideByZeroError> for StdError {
pub type StdResult<T> = core::result::Result<T, StdError>;
/// 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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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}")]
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/hex_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8> 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 <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.
#[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<u8>);

impl HexBinary {
Expand Down
8 changes: 3 additions & 5 deletions packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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<T = Empty> {
/// Optional list of messages to pass. These will be executed in order.
Expand Down
2 changes: 0 additions & 2 deletions packages/std/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -65,7 +64,6 @@ pub enum QueryRequest<C> {
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.
Expand Down

0 comments on commit 00b2b16

Please sign in to comment.