From 4a136407653f56f34f303cd1bc316e0cdf1f1af0 Mon Sep 17 00:00:00 2001 From: Kevin Pease Date: Tue, 4 Jun 2024 11:14:41 +0200 Subject: [PATCH 1/2] Add documentation --- .../src/models/response_models.rs | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/stellar_rust_sdk/src/models/response_models.rs b/stellar_rust_sdk/src/models/response_models.rs index 5aa88e4..a151481 100644 --- a/stellar_rust_sdk/src/models/response_models.rs +++ b/stellar_rust_sdk/src/models/response_models.rs @@ -1,6 +1,10 @@ use crate::Getters; use serde::{Deserialize, Serialize}; +/// Represents the navigational links in a response. +/// +/// Contains the links to the current, next, and previous pages of the response. +/// #[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)] pub struct ResponseLinks { #[serde(rename = "self")] @@ -9,22 +13,33 @@ pub struct ResponseLinks { pub prev: Option, } +/// Represents a navigational link in a response. +/// +/// Contains an optional url. +/// #[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)] pub struct Link { pub href: Option, } -#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)] -pub struct Embedded { - pub records: Vec, -} - +/// Represents a navigational link in a response. +/// +/// Contains an optional url, and an optional boolean to indicate whether a link is templated or not. +/// #[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)] pub struct TemplateLink { pub href: Option, pub templated: Option, } +/// Represents a collection of results in a response. +/// +/// Contains a vector, which can hold any type of record returned by the API. +#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)] +pub struct Embedded { + pub records: Vec, +} + /// Represents the authorization and control flags for an asset in the all assets response. /// /// Details the various boolean flags that are @@ -45,4 +60,4 @@ pub struct Flags { /// A `bool` indicating whether the asset supports the clawback operation. /// If `true`, the issuer can claw back the asset from user accounts. auth_clawback_enabled: bool, -} +} \ No newline at end of file From a06c5e22091cb00d4ec849689dd3993ad3a1d7f3 Mon Sep 17 00:00:00 2001 From: Kevin Pease Date: Tue, 4 Jun 2024 11:19:36 +0200 Subject: [PATCH 2/2] Update test values --- stellar_rust_sdk/src/offers/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stellar_rust_sdk/src/offers/mod.rs b/stellar_rust_sdk/src/offers/mod.rs index ff85897..e752283 100644 --- a/stellar_rust_sdk/src/offers/mod.rs +++ b/stellar_rust_sdk/src/offers/mod.rs @@ -190,12 +190,12 @@ pub mod test { const BUYING_ASSET_TYPE: &str = "credit_alphanum12"; const BUYING_ASSET_CODE: &str = "EURCAllow"; const BUYING_ASSET_ISSUER: &str = "GA6HVGLFUF3BHHGR5CMYXIVZ3RYVUH5EUYAOAY4T3OKI5OQVIWVRK24R"; - const AMOUNT: &str = "922278138224.9775807"; + const AMOUNT: &str = "922274722883.0675807"; const PRICE_R_N: &u32 = &1; const PRICE_R_D: &u32 = &1; const PRICE: &str = "1.0000000"; - const LAST_MODIFIED_LEDGER: &u32 = &1762248; - const LAST_MODIFIED_TIME: &str = "2024-05-23T22:12:07Z"; + const LAST_MODIFIED_LEDGER: &u32 = &1938375; + const LAST_MODIFIED_TIME: &str = "2024-06-03T15:21:13Z"; let horizon_client = HorizonClient::new("https://horizon-testnet.stellar.org"