Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed May 31, 2024
1 parent b459f27 commit a309e54
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion cosmwasm/polytone/contracts/main/note/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_json_binary, Binary, Deps, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo, Response, StdResult,
to_json_binary, Binary, Deps, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo, Response,
StdResult,
};
use cw2::set_contract_version;
use polytone::callbacks::CallbackRequestType;
Expand Down
2 changes: 1 addition & 1 deletion cosmwasm/polytone/contracts/main/note/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ pub enum MigrateMsg {
/// Updates the contract's configuration. To update the config
/// without updating the code, migrate to the same code ID.
WithUpdate { block_max_gas: Uint64 },
}
}
4 changes: 2 additions & 2 deletions cosmwasm/polytone/contracts/main/proxy/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdResult, SubMsg,
to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdResult, SubMsg,
SubMsgResponse, SubMsgResult,
};
use cw2::set_contract_version;
Expand Down Expand Up @@ -65,7 +65,7 @@ pub fn execute(
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::Instantiator {} => to_json_binary(&INSTANTIATOR.load(deps.storage)?),
QueryMsg::Instantiator {} => to_json_binary(&INSTANTIATOR.load(deps.storage)?),
}
}

Expand Down
2 changes: 1 addition & 1 deletion cosmwasm/polytone/contracts/main/voice/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ mod tests {
let four = gen_address("c1", "c1", "c2");
assert!(one != two && two != three && three != four)
}
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/contracts/main/voice/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ pub fn ibc_packet_timeout(
_msg: IbcPacketTimeoutMsg,
) -> Result<IbcBasicResponse, ContractError> {
unreachable!("host will never send a packet")
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/contracts/main/voice/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ pub enum MigrateMsg {
/// The contract address length used by the chain.
contract_addr_len: u8,
},
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/contracts/main/voice/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ pub struct SenderInfo {
pub connection_id: String,
pub remote_port: String,
pub remote_sender: String,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ impl Suite {
let curr = self.query_contract_addr_len();
assert_eq!(curr, val);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ fn test_migrate_validation() {
.unwrap();

assert_eq!(err, ContractError::ContractAddrLenCantBeGreaterThan32);
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/packages/cw-orch-polytone/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ impl<Chain: CwEnv> Polytone<Chain> {

Polytone { note, voice, proxy }
}
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/packages/cw-orch-polytone/src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ impl<Chain: CwEnv> Uploadable for PolytoneNote<Chain> {
.find_wasm_path("polytone_note")
.unwrap()
}
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/packages/cw-orch-polytone/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ impl<Chain: CwEnv> Uploadable for PolytoneProxy<Chain> {
.find_wasm_path("polytone_proxy")
.unwrap()
}
}
}
2 changes: 1 addition & 1 deletion cosmwasm/polytone/packages/cw-orch-polytone/src/voice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ impl<Chain: CwEnv> Uploadable for PolytoneVoice<Chain> {
.find_wasm_path("polytone_voice")
.unwrap()
}
}
}
12 changes: 6 additions & 6 deletions cosmwasm/polytone/packages/polytone/src/ack.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cosmwasm_std::{from_json, to_json_binary, Binary, IbcAcknowledgement, SubMsgResponse, Uint64};
use cosmwasm_std::{from_json, to_json_binary, Binary, IbcAcknowledgement, SubMsgResponse, Uint64};

pub use crate::callbacks::Callback;
use crate::callbacks::{ErrorResponse, ExecutionResponse};
Expand All @@ -12,12 +12,12 @@ pub type Ack = Callback;

/// Serializes an ACK-SUCCESS containing the provided data.
pub fn ack_query_success(result: Vec<Binary>) -> Binary {
to_json_binary(&Callback::Query(Ok(result))).unwrap()
to_json_binary(&Callback::Query(Ok(result))).unwrap()
}

/// Serializes an ACK-SUCCESS for a query that failed.
pub fn ack_query_fail(message_index: Uint64, error: String) -> Binary {
to_json_binary(&Callback::Query(Err(ErrorResponse {
to_json_binary(&Callback::Query(Err(ErrorResponse {
message_index,
error,
})))
Expand All @@ -26,7 +26,7 @@ pub fn ack_query_fail(message_index: Uint64, error: String) -> Binary {

/// Serializes an ACK-SUCCESS for execution that succeeded.
pub fn ack_execute_success(result: Vec<SubMsgResponse>, executed_by: String) -> Binary {
to_json_binary(&Callback::Execute(Ok(ExecutionResponse {
to_json_binary(&Callback::Execute(Ok(ExecutionResponse {
result,
executed_by,
})))
Expand All @@ -35,12 +35,12 @@ pub fn ack_execute_success(result: Vec<SubMsgResponse>, executed_by: String) ->

/// Serializes an ACK-SUCCESS for execution that failed.
pub fn ack_execute_fail(error: String) -> Binary {
to_json_binary(&Callback::Execute(Err(error))).unwrap()
to_json_binary(&Callback::Execute(Err(error))).unwrap()
}

/// Serializes an ACK-FAIL containing the provided error.
pub fn ack_fail(err: String) -> Binary {
to_json_binary(&Callback::FatalError(err)).unwrap()
to_json_binary(&Callback::FatalError(err)).unwrap()
}

/// Unmarshals an ACK from an acknowledgement returned by the SDK. If
Expand Down
4 changes: 2 additions & 2 deletions cosmwasm/polytone/packages/polytone/src/callbacks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{
to_json_binary, Addr, Api, Binary, CosmosMsg, IbcPacketAckMsg, IbcPacketTimeoutMsg, StdResult,
to_json_binary, Addr, Api, Binary, CosmosMsg, IbcPacketAckMsg, IbcPacketTimeoutMsg, StdResult,
Storage, SubMsgResponse, Uint64, WasmMsg,
};
use cw_storage_plus::Map;
Expand Down Expand Up @@ -178,7 +178,7 @@ fn callback_message(request: PendingCallback, result: Callback) -> CosmosMsg {
}
WasmMsg::Execute {
contract_addr: request.receiver.into_string(),
msg: to_json_binary(&C::Callback(CallbackMessage {
msg: to_json_binary(&C::Callback(CallbackMessage {
initiator: request.initiator,
initiator_msg: request.initiator_msg,
result,
Expand Down
4 changes: 2 additions & 2 deletions cosmwasm/polytone/packages/polytone/src/handshake/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_std::{
to_json_binary, Ibc3ChannelOpenResponse, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcOrder,
to_json_binary, Ibc3ChannelOpenResponse, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcOrder,
};

use error::HandshakeError;
Expand Down Expand Up @@ -59,7 +59,7 @@ fn open(
Err(HandshakeError::ExpectUnordered)
} else {
Ok(Some(Ibc3ChannelOpenResponse {
version: to_json_binary(extensions).unwrap().to_base64(),
version: to_json_binary(extensions).unwrap().to_base64(),
}))
}
}
Expand Down

0 comments on commit a309e54

Please sign in to comment.