Skip to content

Commit 8759112

Browse files
committed
Fix deserialisation error on next_key
For queries that return paginated responses the next key value can be null ```json {"positions":[],"pagination":{"next_key":null,"total":"0"}} ``` This leads to a deserialisation error. This fixes the issue by making next_key optional. The issue was first reported by @keyleu with a fix so due credit here. #104 packages/osmosis-std/src/types/cosmos/base/query/v1beta1.rs
1 parent 6ff94c6 commit 8759112

File tree

1 file changed

+2
-6
lines changed
  • packages/osmosis-std/src/types/cosmos/base/query

1 file changed

+2
-6
lines changed

packages/osmosis-std/src/types/cosmos/base/query/v1beta1.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,8 @@ pub struct PageResponse {
8080
/// next_key is the key to be passed to PageRequest.key to
8181
/// query the next page most efficiently. It will be empty if
8282
/// there are no more results.
83-
#[prost(bytes = "vec", tag = "1")]
84-
#[serde(
85-
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
86-
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
87-
)]
88-
pub next_key: ::prost::alloc::vec::Vec<u8>,
83+
#[prost(bytes = "vec", optional, tag = "1")]
84+
pub next_key: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
8985
/// total is total number of results available if PageRequest.count_total
9086
/// was set, its value is undefined otherwise
9187
#[prost(uint64, tag = "2")]

0 commit comments

Comments
 (0)