Skip to content

Commit

Permalink
serde vec int as vec string
Browse files Browse the repository at this point in the history
  • Loading branch information
iboss-ptk committed Sep 25, 2023
1 parent 473d539 commit 0644bb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/osmosis-std/src/serde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod as_str_vec {
.collect()
}

pub fn serialize<S, T>(values: &Vec<T>, serializer: S) -> Result<S::Ok, S::Error>
pub fn serialize<S, T>(values: &[T], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: Display,
Expand Down
8 changes: 8 additions & 0 deletions packages/osmosis-std/src/types/osmosis/poolmanager/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@ pub struct EstimateSwapExactAmountInWithPrimitiveTypesRequest {
pub token_in: ::prost::alloc::string::String,
#[prost(uint64, repeated, packed = "false", tag = "3")]
#[serde(alias = "routes_poolID")]
#[serde(
serialize_with = "crate::serde::as_str_vec::serialize",
deserialize_with = "crate::serde::as_str_vec::deserialize"
)]
pub routes_pool_id: ::prost::alloc::vec::Vec<u64>,
#[prost(string, repeated, tag = "4")]
pub routes_token_out_denom: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
Expand Down Expand Up @@ -721,6 +725,10 @@ pub struct EstimateSwapExactAmountOutWithPrimitiveTypesRequest {
pub pool_id: u64,
#[prost(uint64, repeated, packed = "false", tag = "2")]
#[serde(alias = "routes_poolID")]
#[serde(
serialize_with = "crate::serde::as_str_vec::serialize",
deserialize_with = "crate::serde::as_str_vec::deserialize"
)]
pub routes_pool_id: ::prost::alloc::vec::Vec<u64>,
#[prost(string, repeated, tag = "3")]
pub routes_token_in_denom: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
Expand Down

0 comments on commit 0644bb9

Please sign in to comment.