Skip to content

Commit 87c675c

Browse files
committed
fix: lint issues
1 parent b3d3e84 commit 87c675c

File tree

25 files changed

+46
-43
lines changed

25 files changed

+46
-43
lines changed

contracts/cosmwasm-vm/cw-ibc-core/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use cosmwasm_std::{from_slice, to_vec};
1+
use cosmwasm_std::{from_json as from_slice, to_json_vec as to_vec};
22
use serde::{de::DeserializeOwned, Serialize};
33

44
use super::*;

contracts/cosmwasm-vm/cw-ibc-core/src/contract.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::env;
22

33
use super::*;
44

5-
use cosmwasm_std::to_binary;
5+
use cosmwasm_std::to_json_binary as to_binary;
66

77
use cw_common::hex_string::HexString;
88
use cw_common::query_helpers::build_smart_query;
@@ -714,7 +714,7 @@ mod tests {
714714
use super::{instantiate, query, InstantiateMsg, QueryMsg};
715715

716716
use cosmwasm_std::{
717-
from_binary,
717+
from_json as from_binary,
718718
testing::{mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage},
719719
Addr, OwnedDeps,
720720
};

contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/handler.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,14 @@ impl<'a> IbcClient for CwIbcCoreContext<'a> {
550550

551551
#[cfg(test)]
552552
mod tests {
553-
use cosmwasm_std::{from_binary, to_binary};
553+
use cosmwasm_std::{from_json, to_json_binary};
554554
use cw_common::client_response::CreateClientResponse;
555555
#[test]
556556
fn test_binary_conversion() {
557557
let res: CreateClientResponse = CreateClientResponse::default();
558-
let bytes = to_binary(&res).unwrap();
558+
let bytes = to_json_binary(&res).unwrap();
559559
println!("{}", hex::encode(bytes.0.clone()));
560-
let decoded: CreateClientResponse = from_binary(&bytes).unwrap();
560+
let decoded: CreateClientResponse = from_json(&bytes).unwrap();
561561
assert_eq!(res, decoded)
562562
}
563563
}

contracts/cosmwasm-vm/cw-ibc-core/src/ics02_client/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::{
1010
use common::ibc::core::ics24_host::identifier::ClientId;
1111

1212
use cosmwasm_std::{
13-
from_binary, to_binary, to_vec, Addr, CosmosMsg, DepsMut, Event, MessageInfo, Reply, Response,
14-
Storage, SubMsg,
13+
from_json as from_binary, to_json_binary as to_binary, to_json_vec as to_vec, Addr, CosmosMsg,
14+
DepsMut, Event, MessageInfo, Reply, Response, Storage, SubMsg,
1515
};
1616
use cw_common::client_response::{
1717
MisbehaviourResponse, UpdateClientResponse, UpgradeClientResponse,

contracts/cosmwasm-vm/cw-ibc-core/src/ics03_connection/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use cosmwasm_std::DepsMut;
1010
use cosmwasm_std::Event;
1111
use cosmwasm_std::Response;
1212
use cosmwasm_std::Storage;
13-
use cosmwasm_std::{to_vec, MessageInfo};
13+
use cosmwasm_std::{to_json_vec as to_vec, MessageInfo};
1414
use cw_common::client_msg::{
1515
VerifyClientConsensusState, VerifyClientFullState, VerifyConnectionState,
1616
};

contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler/open_ack.rs

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub fn on_chan_open_ack_submessage(
4747
connection_id: &ConnectionId,
4848
) -> Result<cosmwasm_std::IbcChannelConnectMsg, ContractError> {
4949
let port_id = port_id.clone();
50-
let channel_id = channel_id;
5150
let counter_party_port_id = channel_end.counterparty().port_id.clone();
5251
let counter_party_channel = channel_end.counterparty().channel_id().unwrap().clone();
5352
let endpoint = cosmwasm_std::IbcEndpoint {

contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler/open_init.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn on_chan_open_init_submessage(
1616
channel_id: &ChannelId,
1717
connection_id: &ConnectionId,
1818
) -> cosmwasm_std::IbcChannelOpenMsg {
19-
let channel_id = channel_id;
2019
let counter_party_port_id = channel.remote.port_id();
2120
let counter_party_channel = channel
2221
.remote

contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/handler/open_try.rs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub fn on_chan_open_try_submessage(
6262
connection_id: &ConnectionId,
6363
) -> cosmwasm_std::IbcChannelOpenMsg {
6464
let port_id = port_id.clone();
65-
let channel_id = channel_id;
6665
let counter_party_port_id = msg.counterparty().port_id.clone();
6766
let counter_party_channel = msg.counterparty().channel_id().unwrap().clone();
6867
let endpoint = cosmwasm_std::IbcEndpoint {

contracts/cosmwasm-vm/cw-ibc-core/src/ics04_channel/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use cosmwasm_std::Event;
1818
use cosmwasm_std::Reply;
1919
use cosmwasm_std::Storage;
2020
use cosmwasm_std::{
21-
to_binary, to_vec, Binary, CosmosMsg, Empty, MessageInfo, Response, SubMsg, WasmMsg,
21+
to_json_binary as to_binary, to_json_vec as to_vec, Binary, CosmosMsg, Empty, MessageInfo,
22+
Response, SubMsg, WasmMsg,
2223
};
2324
pub use cw_common::client_msg::ExecuteMsg as LightClientMessage;
2425
use cw_common::commitment;

contracts/cosmwasm-vm/cw-ibc-core/src/light_client/light_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use common::consensus_state::IConsensusState;
44
use common::icon::icon::lightclient::v1::{ClientState, ConsensusState};
55
use common::traits::AnyTypes;
66
use cosmwasm_schema::cw_serde;
7-
use cosmwasm_std::{to_binary, Binary, CosmosMsg, Deps, SubMsg};
7+
use cosmwasm_std::{to_json_binary as to_binary, Binary, CosmosMsg, Deps, SubMsg};
88
use cw_common::client_msg::{LightClientPacketMessage, VerifyConnectionState};
99

1010
use cw_common::ibc_types::IbcClientId;

contracts/cosmwasm-vm/cw-icon-light-client/src/contract.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use common::icon::icon::types::v1::{MerkleProofs, SignedHeader};
1313
#[cfg(not(feature = "library"))]
1414
use cosmwasm_std::entry_point;
1515
use cosmwasm_std::{
16-
to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
16+
to_json_binary as to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError,
17+
StdResult,
1718
};
1819
use cw2::set_contract_version;
1920
use cw_common::client_response::{CreateClientResponse, UpdateClientResponse};
@@ -539,7 +540,7 @@ mod tests {
539540
use common::icon::icon::types::v1::{BtpHeader, SignedHeader};
540541
use cosmwasm_std::{
541542
testing::{mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage},
542-
to_binary, Addr, OwnedDeps, Response,
543+
to_json_binary as to_binary, Addr, OwnedDeps, Response,
543544
};
544545
use cw2::get_contract_version;
545546
use cw_common::{client_msg::QueryMsg, raw_types::Any};

contracts/cosmwasm-vm/cw-icon-light-client/src/light_client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ impl<'a> IconClient<'a> {
2626
&self,
2727
client_id: &str,
2828
header: &BtpHeader,
29-
signatures: &Vec<Vec<u8>>,
30-
validators: &Vec<Vec<u8>>,
29+
signatures: &[Vec<u8>],
30+
validators: &[Vec<u8>],
3131
) -> Result<bool, ContractError> {
3232
let mut votes = u64::default();
3333
let state = self.context.get_client_state(client_id)?;

contracts/cosmwasm-vm/cw-mock-ibc-connection/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use crate::{
1616
};
1717
use cosmwasm_schema::cw_serde;
1818
use cosmwasm_std::{
19-
entry_point, to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response,
20-
StdError, StdResult, Storage,
19+
entry_point, to_json_binary as to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply,
20+
Response, StdError, StdResult, Storage,
2121
};
2222
use cw2::set_contract_version;
2323

contracts/cosmwasm-vm/cw-mock-ibc-core/src/contract.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use common::ibc::core::ics04_channel::timeout::TimeoutHeight;
22
#[cfg(not(feature = "library"))]
33
use cosmwasm_std::entry_point;
44
use cosmwasm_std::{
5-
to_binary, Addr, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, Event, IbcEndpoint, IbcPacket,
6-
IbcPacketReceiveMsg, IbcTimeout, IbcTimeoutBlock, MessageInfo, Reply, Response, StdResult,
7-
SubMsg, Timestamp, WasmMsg,
5+
to_json_binary as to_binary, Addr, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, Event,
6+
IbcEndpoint, IbcPacket, IbcPacketReceiveMsg, IbcTimeout, IbcTimeoutBlock, MessageInfo, Reply,
7+
Response, StdResult, SubMsg, Timestamp, WasmMsg,
88
};
99
use cw2::set_contract_version;
1010
use cw_common::hex_string::HexString;

contracts/cosmwasm-vm/cw-mock-ibc-core/src/helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
33

4-
use cosmwasm_std::{to_binary, Addr, CosmosMsg, StdResult, WasmMsg};
4+
use cosmwasm_std::{to_json_binary as to_binary, Addr, CosmosMsg, StdResult, WasmMsg};
55

66
use crate::msg::ExecuteMsg;
77

contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/ibc_host.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use crate::state::IbcConfig;
22
use crate::types::LOG_PREFIX;
3-
use cosmwasm_std::{to_binary, CosmosMsg, Deps, DepsMut, MessageInfo, Storage, SubMsg, WasmMsg};
3+
use cosmwasm_std::{
4+
to_json_binary as to_binary, CosmosMsg, Deps, DepsMut, MessageInfo, Storage, SubMsg, WasmMsg,
5+
};
46
use cw_common::cw_types::CwPacket;
57
use cw_common::query_helpers::build_smart_query;
68
use cw_common::{hex_string::HexString, raw_types::channel::RawPacket, ProstMessage};
@@ -92,7 +94,7 @@ mod tests {
9294
use cosmwasm_std::{
9395
coin,
9496
testing::{mock_dependencies_with_balance, mock_env},
95-
to_binary, Addr, CosmosMsg, MessageInfo, SubMsg, WasmMsg,
97+
to_json_binary as to_binary, Addr, CosmosMsg, MessageInfo, SubMsg, WasmMsg,
9698
};
9799
use cw_common::{hex_string::HexString, raw_types::channel::RawPacket, ProstMessage};
98100

contracts/cosmwasm-vm/cw-mock-ibc-dapp/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use crate::{
2222
};
2323
use cosmwasm_schema::cw_serde;
2424
use cosmwasm_std::{
25-
entry_point, to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Never, Reply, Response,
26-
StdError, StdResult, Storage,
25+
entry_point, to_json_binary as to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Never,
26+
Reply, Response, StdError, StdResult, Storage,
2727
};
2828
#[cfg(feature = "native_ibc")]
2929
use cw_common::cw_types::{CwTimeout, CwTimeoutBlock};

contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::error::ContractError;
2-
use cosmwasm_std::{attr, to_binary, Binary};
2+
use cosmwasm_std::{attr, to_json_binary as to_binary, Binary};
33
use cw_common::cw_types::{CwBasicResponse, CwPacket};
44
use cw_common::types::Ack;
55

contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/ibc_host.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use crate::state::IbcConfig;
22
use crate::types::LOG_PREFIX;
33
use common::ibc::Height;
4-
use cosmwasm_std::{to_binary, CosmosMsg, Deps, DepsMut, Storage, SubMsg, WasmMsg};
4+
use cosmwasm_std::{
5+
to_json_binary as to_binary, CosmosMsg, Deps, DepsMut, Storage, SubMsg, WasmMsg,
6+
};
57
use cw_common::cw_types::CwPacket;
68
use cw_common::query_helpers::build_smart_query;
79
use cw_common::raw_types::channel::RawChannel;
@@ -130,7 +132,7 @@ mod tests {
130132
use cosmwasm_std::{
131133
coin,
132134
testing::{mock_dependencies_with_balance, mock_env},
133-
to_binary, Addr, CosmosMsg, SubMsg, WasmMsg,
135+
to_json_binary as to_binary, Addr, CosmosMsg, SubMsg, WasmMsg,
134136
};
135137
use cw_common::{hex_string::HexString, raw_types::channel::RawPacket, ProstMessage};
136138

contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use crate::{
2626
};
2727
use cosmwasm_schema::cw_serde;
2828
use cosmwasm_std::{
29-
entry_point, to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Never, Reply, Response,
30-
StdError, StdResult, Storage, SubMsg, SubMsgResult,
29+
entry_point, to_json_binary as to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Never,
30+
Reply, Response, StdError, StdResult, Storage, SubMsg, SubMsgResult,
3131
};
3232
#[cfg(feature = "native_ibc")]
3333
use cw_common::cw_types::{CwTimeout, CwTimeoutBlock};

contracts/cosmwasm-vm/cw-xcall-ibc-connection/src/xcall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use cosmwasm_std::{to_binary, CosmosMsg, Empty, Storage, SubMsg, WasmMsg};
1+
use cosmwasm_std::{to_json_binary as to_binary, CosmosMsg, Empty, Storage, SubMsg, WasmMsg};
22
use cw_xcall_lib::network_address::NetId;
33

44
use crate::{

contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/setup.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use cosmwasm_std::{
77
mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage,
88
MOCK_CONTRACT_ADDR,
99
},
10-
to_binary, Addr, BlockInfo, ContractInfo, DepsMut, Empty, Env, Event, IbcChannel, IbcEndpoint,
11-
IbcPacket, IbcTimeout, IbcTimeoutBlock, MessageInfo, OwnedDeps, Storage, SubMsgResponse,
12-
Timestamp, TransactionInfo,
10+
to_json_binary as to_binary, Addr, BlockInfo, ContractInfo, DepsMut, Empty, Env, Event,
11+
IbcChannel, IbcEndpoint, IbcPacket, IbcTimeout, IbcTimeoutBlock, MessageInfo, OwnedDeps,
12+
Storage, SubMsgResponse, Timestamp, TransactionInfo,
1313
};
1414

1515
use cw_xcall_ibc_connection::{

contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pub mod setup;
22

33
use cosmwasm_std::{
4-
to_binary, Addr, Binary, Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcChannelCloseMsg,
5-
IbcChannelConnectMsg, IbcChannelOpenMsg, IbcPacketAckMsg,
4+
to_json_binary as to_binary, Addr, Binary, Ibc3ChannelOpenResponse, IbcAcknowledgement,
5+
IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, IbcPacketAckMsg,
66
};
77

88
use cw_common::types::Ack;

contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_ibc_functions.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::str::FromStr;
33

44
use common::rlp::{self, Nullable};
55
use cosmwasm_std::{
6-
testing::mock_env, to_binary, Addr, Binary, IbcAcknowledgement, IbcChannel,
6+
testing::mock_env, to_json_binary as to_binary, Addr, Binary, IbcAcknowledgement, IbcChannel,
77
IbcChannelConnectMsg::OpenAck, IbcChannelOpenMsg::OpenInit, IbcChannelOpenMsg::OpenTry,
88
IbcEndpoint, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcTimeout, IbcTimeoutBlock,
99
};
@@ -24,7 +24,7 @@ pub mod account;
2424
use account::admin_one;
2525
use account::alice;
2626

27-
use cosmwasm_std::{from_binary, IbcChannelCloseMsg, Reply, SubMsgResult};
27+
use cosmwasm_std::{from_json as from_binary, IbcChannelCloseMsg, Reply, SubMsgResult};
2828
use cw_common::xcall_connection_msg::{ExecuteMsg, QueryMsg};
2929
use cw_xcall::types::message::CSMessage;
3030
use cw_xcall::types::request::CSMessageRequest;
@@ -219,7 +219,6 @@ fn test_query_get_unclaimed_fee() {
219219
#[test]
220220
#[cfg(not(feature = "native_ibc"))]
221221
fn success_on_open_channel_open_try_valid_version() {
222-
use cosmwasm_std::from_binary;
223222
use cw_xcall_lib::network_address::NetId;
224223

225224
let mut deps = deps();

contracts/cosmwasm-vm/cw-xcall-ibc-connection/tests/test_send_message.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ pub mod setup;
22
use std::str::FromStr;
33

44
use cosmwasm_std::{
5-
testing::mock_env, to_binary, Addr, IbcEndpoint, IbcPacket, IbcTimeout, IbcTimeoutBlock,
5+
testing::mock_env, to_json_binary as to_binary, Addr, IbcEndpoint, IbcPacket, IbcTimeout,
6+
IbcTimeoutBlock,
67
};
78

89
use cw_xcall_ibc_connection::types::config::Config;

0 commit comments

Comments
 (0)