From 6cadb198644cf5e942187896c2e6bb3ecc9edc6e Mon Sep 17 00:00:00 2001 From: apoorvsadana <95699312+apoorvsadana@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:25:14 +0530 Subject: [PATCH] fix: skip serialization of continuation token if `None` (#530) --- starknet-core/src/types/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/starknet-core/src/types/mod.rs b/starknet-core/src/types/mod.rs index 3cef6596..0eac373d 100644 --- a/starknet-core/src/types/mod.rs +++ b/starknet-core/src/types/mod.rs @@ -106,7 +106,9 @@ pub struct EventsPage { /// Matching events pub events: Vec, /// A pointer to the last element of the delivered page, use this token in a subsequent query to - /// obtain the next page + /// obtain the next page. If the value is `None`, don't add it to the response as clients might + /// use `contains_key` as a check for the last page. + #[serde(skip_serializing_if = "Option::is_none")] pub continuation_token: Option, }