Skip to content

Commit

Permalink
use DisplayFromStr for cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed Jul 16, 2024
1 parent 0aff23e commit 6780dc2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ itertools = "0.10.0"
hex = "0.4.3"
thiserror = "1.0.46"
serde = "1.0.82"
serde_with = "3.9.0"
tokio = "1.28.1"
sha2 = "0.10.7"
tracing = "0.1.40"
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde_aux::prelude::{
deserialize_default_from_null, deserialize_number_from_string,
deserialize_option_number_from_string,
};
use serde_with::{serde_as, DisplayFromStr};
use stellar_xdr::curr::{
self as xdr, AccountEntry, AccountId, ContractDataEntry, ContractEventType, DiagnosticEvent,
Error as XdrError, Hash, LedgerEntryData, LedgerFootprint, LedgerKey, LedgerKeyAccount,
Expand Down Expand Up @@ -251,8 +252,11 @@ impl TryInto<GetTransactionsResponse> for GetTransactionsResponseRaw {
}
}

#[serde_as]
#[derive(serde::Serialize, Debug, Clone)]
pub struct TransactionsPaginationOptions {
#[serde_as(as = "Option<DisplayFromStr>")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
pub limit: Option<u32>,
}
Expand Down

0 comments on commit 6780dc2

Please sign in to comment.