Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
fix ci
  • Loading branch information
scf0220 committed Jul 11, 2023
1 parent ac74d35 commit d0ebe40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/std/src/serde_basic_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl SerializeForBasicType for String {
}
}

#[allow(dead_code)]
pub fn serialize_to_bytes<T: SerializeForBasicType>(value: &T) -> Vec<u8> {
let mut buf = Vec::new();
value.serialize(&mut buf);
Expand Down
11 changes: 5 additions & 6 deletions packages/std/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::query::{
};
use crate::results::{ContractResult, Empty, SystemResult};
use crate::serde::{from_binary, to_binary, to_vec};
use crate::serde_basic_type::deserialize_from_bytes;
use crate::serde_basic_type::{deserialize_from_bytes, SerializeForBasicType};
use crate::ContractInfoResponse;
#[cfg(feature = "cosmwasm_1_3")]
use crate::{DenomMetadata, PageRequest};
Expand Down Expand Up @@ -246,18 +246,17 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> {
}
pub fn query_ex<U: SerializeForBasicType>(&self, request: &QueryRequest<C>) -> StdResult<U> {
let raw = to_vec(request).map_err(|serialize_err| {
StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err))
StdError::generic_err(format!("Serializing QueryRequest: {serialize_err}"))
})?;
match self.raw_query(&raw) {
SystemResult::Err(system_err) => Err(StdError::generic_err(format!(
"Querier system error: {}",
system_err
"Querier system error: {system_err}"
))),
SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(
format!("Querier contract error: {}", contract_err),
format!("Querier contract error: {contract_err}"),
)),
SystemResult::Ok(ContractResult::Ok(value)) => {
Ok(deserialize_from_bytes((&value).to_vec()).unwrap())
Ok(deserialize_from_bytes((value).to_vec()).unwrap())
}
}
}
Expand Down

0 comments on commit d0ebe40

Please sign in to comment.