diff --git a/src/curr/generated.rs b/src/curr/generated.rs index a2b875c7..677a9bfe 100644 --- a/src/curr/generated.rs +++ b/src/curr/generated.rs @@ -46,11 +46,11 @@ pub const XDR_FILES_SHA256: [(&str, &str); 12] = [ ), ( "xdr/curr/Stellar-ledger-entries.x", - "77dc7062ae6d0812136333e12e35b2294d7c2896a536be9c811eb0ed2abbbccb", + "03e8be938bace784410b0e837ed6496ff66dc0d1e70fc6e4f0d006566a344879", ), ( "xdr/curr/Stellar-ledger.x", - "88b6fac00398f1f943533efb3be8fb60ae3a1076661799c581c214d7db0f25a5", + "c2ac5bde5da28d4d02e2ea455f3bc5d5133adf271d374010cebe4e314c8504e8", ), ( "xdr/curr/Stellar-overlay.x", @@ -58,7 +58,7 @@ pub const XDR_FILES_SHA256: [(&str, &str); 12] = [ ), ( "xdr/curr/Stellar-transaction.x", - "747639c267aa298c01e5c026a776679454171d717207ef60aed158c5dedae957", + "de99d77ac03c5f2e656b534d41957a1434d03525f249a93dd64c57de0d30057b", ), ( "xdr/curr/Stellar-types.x", @@ -17461,119 +17461,131 @@ impl WriteXdr for EnvelopeType { } } -/// UpgradeType is an XDR Typedef defines as: +/// BucketListType is an XDR Enum defines as: /// /// ```text -/// typedef opaque UpgradeType<128>; +/// enum BucketListType +/// { +/// LIVE = 0, +/// HOT_ARCHIVE = 1, +/// COLD_ARCHIVE = 2 +/// }; /// ``` /// -#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[derive(Default)] #[cfg_attr( all(feature = "serde", feature = "alloc"), derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[derive(Debug)] -pub struct UpgradeType(pub BytesM<128>); - -impl From for BytesM<128> { - #[must_use] - fn from(x: UpgradeType) -> Self { - x.0 - } +#[repr(i32)] +pub enum BucketListType { + Live = 0, + HotArchive = 1, + ColdArchive = 2, } -impl From> for UpgradeType { +impl BucketListType { + pub const VARIANTS: [BucketListType; 3] = [ + BucketListType::Live, + BucketListType::HotArchive, + BucketListType::ColdArchive, + ]; + pub const VARIANTS_STR: [&'static str; 3] = ["Live", "HotArchive", "ColdArchive"]; + #[must_use] - fn from(x: BytesM<128>) -> Self { - UpgradeType(x) + pub const fn name(&self) -> &'static str { + match self { + Self::Live => "Live", + Self::HotArchive => "HotArchive", + Self::ColdArchive => "ColdArchive", + } } -} -impl AsRef> for UpgradeType { #[must_use] - fn as_ref(&self) -> &BytesM<128> { - &self.0 + pub const fn variants() -> [BucketListType; 3] { + Self::VARIANTS } } -impl ReadXdr for UpgradeType { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - let i = BytesM::<128>::read_xdr(r)?; - let v = UpgradeType(i); - Ok(v) - }) +impl Name for BucketListType { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) } } -impl WriteXdr for UpgradeType { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| self.0.write_xdr(w)) +impl Variants for BucketListType { + fn variants() -> slice::Iter<'static, BucketListType> { + Self::VARIANTS.iter() } } -impl Deref for UpgradeType { - type Target = BytesM<128>; - fn deref(&self) -> &Self::Target { - &self.0 - } -} +impl Enum for BucketListType {} -impl From for Vec { - #[must_use] - fn from(x: UpgradeType) -> Self { - x.0 .0 +impl fmt::Display for BucketListType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) } } -impl TryFrom> for UpgradeType { +impl TryFrom for BucketListType { type Error = Error; - fn try_from(x: Vec) -> Result { - Ok(UpgradeType(x.try_into()?)) - } -} -#[cfg(feature = "alloc")] -impl TryFrom<&Vec> for UpgradeType { - type Error = Error; - fn try_from(x: &Vec) -> Result { - Ok(UpgradeType(x.try_into()?)) + fn try_from(i: i32) -> Result { + let e = match i { + 0 => BucketListType::Live, + 1 => BucketListType::HotArchive, + 2 => BucketListType::ColdArchive, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) } } -impl AsRef> for UpgradeType { +impl From for i32 { #[must_use] - fn as_ref(&self) -> &Vec { - &self.0 .0 + fn from(e: BucketListType) -> Self { + e as Self } } -impl AsRef<[u8]> for UpgradeType { - #[cfg(feature = "alloc")] - #[must_use] - fn as_ref(&self) -> &[u8] { - &self.0 .0 +impl ReadXdr for BucketListType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) + }) } - #[cfg(not(feature = "alloc"))] - #[must_use] - fn as_ref(&self) -> &[u8] { - self.0 .0 +} + +impl WriteXdr for BucketListType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + let i: i32 = (*self).into(); + i.write_xdr(w) + }) } } -/// StellarValueType is an XDR Enum defines as: +/// BucketEntryType is an XDR Enum defines as: /// /// ```text -/// enum StellarValueType +/// enum BucketEntryType /// { -/// STELLAR_VALUE_BASIC = 0, -/// STELLAR_VALUE_SIGNED = 1 +/// METAENTRY = +/// -1, // At-and-after protocol 11: bucket metadata, should come first. +/// LIVEENTRY = 0, // Before protocol 11: created-or-updated; +/// // At-and-after protocol 11: only updated. +/// DEADENTRY = 1, +/// INITENTRY = 2 // At-and-after protocol 11: only created. /// }; /// ``` /// @@ -17587,57 +17599,69 @@ impl AsRef<[u8]> for UpgradeType { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum StellarValueType { - Basic = 0, - Signed = 1, +pub enum BucketEntryType { + Metaentry = -1, + Liveentry = 0, + Deadentry = 1, + Initentry = 2, } -impl StellarValueType { - pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; - pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; +impl BucketEntryType { + pub const VARIANTS: [BucketEntryType; 4] = [ + BucketEntryType::Metaentry, + BucketEntryType::Liveentry, + BucketEntryType::Deadentry, + BucketEntryType::Initentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = + ["Metaentry", "Liveentry", "Deadentry", "Initentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Basic => "Basic", - Self::Signed => "Signed", + Self::Metaentry => "Metaentry", + Self::Liveentry => "Liveentry", + Self::Deadentry => "Deadentry", + Self::Initentry => "Initentry", } } #[must_use] - pub const fn variants() -> [StellarValueType; 2] { + pub const fn variants() -> [BucketEntryType; 4] { Self::VARIANTS } } -impl Name for StellarValueType { +impl Name for BucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for StellarValueType { - fn variants() -> slice::Iter<'static, StellarValueType> { +impl Variants for BucketEntryType { + fn variants() -> slice::Iter<'static, BucketEntryType> { Self::VARIANTS.iter() } } -impl Enum for StellarValueType {} +impl Enum for BucketEntryType {} -impl fmt::Display for StellarValueType { +impl fmt::Display for BucketEntryType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for StellarValueType { +impl TryFrom for BucketEntryType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 0 => StellarValueType::Basic, - 1 => StellarValueType::Signed, + -1 => BucketEntryType::Metaentry, + 0 => BucketEntryType::Liveentry, + 1 => BucketEntryType::Deadentry, + 2 => BucketEntryType::Initentry, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -17645,14 +17669,14 @@ impl TryFrom for StellarValueType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: StellarValueType) -> Self { + fn from(e: BucketEntryType) -> Self { e as Self } } -impl ReadXdr for StellarValueType { +impl ReadXdr for BucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -17663,7 +17687,7 @@ impl ReadXdr for StellarValueType { } } -impl WriteXdr for StellarValueType { +impl WriteXdr for BucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -17673,66 +17697,22 @@ impl WriteXdr for StellarValueType { } } -/// LedgerCloseValueSignature is an XDR Struct defines as: +/// HotArchiveBucketEntryType is an XDR Enum defines as: /// /// ```text -/// struct LedgerCloseValueSignature +/// enum HotArchiveBucketEntryType /// { -/// NodeID nodeID; // which node introduced the value -/// Signature signature; // nodeID's signature +/// HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. +/// HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived +/// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but +/// // has been added back to the live BucketList. +/// // Does not need to be persisted. +/// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) /// }; /// ``` /// -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[cfg_attr( - all(feature = "serde", feature = "alloc"), - derive(serde::Serialize, serde::Deserialize), - serde(rename_all = "snake_case") -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerCloseValueSignature { - pub node_id: NodeId, - pub signature: Signature, -} - -impl ReadXdr for LedgerCloseValueSignature { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - Ok(Self { - node_id: NodeId::read_xdr(r)?, - signature: Signature::read_xdr(r)?, - }) - }) - } -} - -impl WriteXdr for LedgerCloseValueSignature { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| { - self.node_id.write_xdr(w)?; - self.signature.write_xdr(w)?; - Ok(()) - }) - } -} - -/// StellarValueExt is an XDR NestedUnion defines as: -/// -/// ```text -/// union switch (StellarValueType v) -/// { -/// case STELLAR_VALUE_BASIC: -/// void; -/// case STELLAR_VALUE_SIGNED: -/// LedgerCloseValueSignature lcValueSignature; -/// } -/// ``` -/// -// union with discriminant StellarValueType -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -17740,178 +17720,114 @@ impl WriteXdr for LedgerCloseValueSignature { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[allow(clippy::large_enum_variant)] -pub enum StellarValueExt { - Basic, - Signed(LedgerCloseValueSignature), +#[repr(i32)] +pub enum HotArchiveBucketEntryType { + Metaentry = -1, + Archived = 0, + Live = 1, + Deleted = 2, } -impl StellarValueExt { - pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; - pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; +impl HotArchiveBucketEntryType { + pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ + HotArchiveBucketEntryType::Metaentry, + HotArchiveBucketEntryType::Archived, + HotArchiveBucketEntryType::Live, + HotArchiveBucketEntryType::Deleted, + ]; + pub const VARIANTS_STR: [&'static str; 4] = ["Metaentry", "Archived", "Live", "Deleted"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Basic => "Basic", - Self::Signed(_) => "Signed", - } - } - - #[must_use] - pub const fn discriminant(&self) -> StellarValueType { - #[allow(clippy::match_same_arms)] - match self { - Self::Basic => StellarValueType::Basic, - Self::Signed(_) => StellarValueType::Signed, + Self::Metaentry => "Metaentry", + Self::Archived => "Archived", + Self::Live => "Live", + Self::Deleted => "Deleted", } } #[must_use] - pub const fn variants() -> [StellarValueType; 2] { + pub const fn variants() -> [HotArchiveBucketEntryType; 4] { Self::VARIANTS } } -impl Name for StellarValueExt { +impl Name for HotArchiveBucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for StellarValueExt { - #[must_use] - fn discriminant(&self) -> StellarValueType { - Self::discriminant(self) - } -} - -impl Variants for StellarValueExt { - fn variants() -> slice::Iter<'static, StellarValueType> { +impl Variants for HotArchiveBucketEntryType { + fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { Self::VARIANTS.iter() } } -impl Union for StellarValueExt {} +impl Enum for HotArchiveBucketEntryType {} -impl ReadXdr for StellarValueExt { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - let dv: StellarValueType = ::read_xdr(r)?; - #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] - let v = match dv { - StellarValueType::Basic => Self::Basic, - StellarValueType::Signed => Self::Signed(LedgerCloseValueSignature::read_xdr(r)?), - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(v) - }) +impl fmt::Display for HotArchiveBucketEntryType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) } } -impl WriteXdr for StellarValueExt { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| { - self.discriminant().write_xdr(w)?; - #[allow(clippy::match_same_arms)] - match self { - Self::Basic => ().write_xdr(w)?, - Self::Signed(v) => v.write_xdr(w)?, - }; - Ok(()) - }) +impl TryFrom for HotArchiveBucketEntryType { + type Error = Error; + + fn try_from(i: i32) -> Result { + let e = match i { + -1 => HotArchiveBucketEntryType::Metaentry, + 0 => HotArchiveBucketEntryType::Archived, + 1 => HotArchiveBucketEntryType::Live, + 2 => HotArchiveBucketEntryType::Deleted, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) } } -/// StellarValue is an XDR Struct defines as: -/// -/// ```text -/// struct StellarValue -/// { -/// Hash txSetHash; // transaction set to apply to previous ledger -/// TimePoint closeTime; // network close time -/// -/// // upgrades to apply to the previous ledger (usually empty) -/// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop -/// // unknown steps during consensus if needed. -/// // see notes below on 'LedgerUpgrade' for more detail -/// // max size is dictated by number of upgrade types (+ room for future) -/// UpgradeType upgrades<6>; -/// -/// // reserved for future use -/// union switch (StellarValueType v) -/// { -/// case STELLAR_VALUE_BASIC: -/// void; -/// case STELLAR_VALUE_SIGNED: -/// LedgerCloseValueSignature lcValueSignature; -/// } -/// ext; -/// }; -/// ``` -/// -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[cfg_attr( - all(feature = "serde", feature = "alloc"), - derive(serde::Serialize, serde::Deserialize), - serde(rename_all = "snake_case") -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct StellarValue { - pub tx_set_hash: Hash, - pub close_time: TimePoint, - pub upgrades: VecM, - pub ext: StellarValueExt, +impl From for i32 { + #[must_use] + fn from(e: HotArchiveBucketEntryType) -> Self { + e as Self + } } -impl ReadXdr for StellarValue { +impl ReadXdr for HotArchiveBucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - Ok(Self { - tx_set_hash: Hash::read_xdr(r)?, - close_time: TimePoint::read_xdr(r)?, - upgrades: VecM::::read_xdr(r)?, - ext: StellarValueExt::read_xdr(r)?, - }) + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) }) } } -impl WriteXdr for StellarValue { +impl WriteXdr for HotArchiveBucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.tx_set_hash.write_xdr(w)?; - self.close_time.write_xdr(w)?; - self.upgrades.write_xdr(w)?; - self.ext.write_xdr(w)?; - Ok(()) + let i: i32 = (*self).into(); + i.write_xdr(w) }) } } -/// MaskLedgerHeaderFlags is an XDR Const defines as: -/// -/// ```text -/// const MASK_LEDGER_HEADER_FLAGS = 0x7; -/// ``` -/// -pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; - -/// LedgerHeaderFlags is an XDR Enum defines as: +/// ColdArchiveBucketEntryType is an XDR Enum defines as: /// /// ```text -/// enum LedgerHeaderFlags +/// enum ColdArchiveBucketEntryType /// { -/// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, -/// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, -/// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 +/// COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. +/// COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch +/// COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch +/// COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound +/// COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry /// }; /// ``` /// @@ -17925,64 +17841,78 @@ pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum LedgerHeaderFlags { - TradingFlag = 1, - DepositFlag = 2, - WithdrawalFlag = 4, +pub enum ColdArchiveBucketEntryType { + Metaentry = -1, + ArchivedLeaf = 0, + DeletedLeaf = 1, + BoundaryLeaf = 2, + Hash = 3, } -impl LedgerHeaderFlags { - pub const VARIANTS: [LedgerHeaderFlags; 3] = [ - LedgerHeaderFlags::TradingFlag, - LedgerHeaderFlags::DepositFlag, - LedgerHeaderFlags::WithdrawalFlag, +impl ColdArchiveBucketEntryType { + pub const VARIANTS: [ColdArchiveBucketEntryType; 5] = [ + ColdArchiveBucketEntryType::Metaentry, + ColdArchiveBucketEntryType::ArchivedLeaf, + ColdArchiveBucketEntryType::DeletedLeaf, + ColdArchiveBucketEntryType::BoundaryLeaf, + ColdArchiveBucketEntryType::Hash, + ]; + pub const VARIANTS_STR: [&'static str; 5] = [ + "Metaentry", + "ArchivedLeaf", + "DeletedLeaf", + "BoundaryLeaf", + "Hash", ]; - pub const VARIANTS_STR: [&'static str; 3] = ["TradingFlag", "DepositFlag", "WithdrawalFlag"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::TradingFlag => "TradingFlag", - Self::DepositFlag => "DepositFlag", - Self::WithdrawalFlag => "WithdrawalFlag", + Self::Metaentry => "Metaentry", + Self::ArchivedLeaf => "ArchivedLeaf", + Self::DeletedLeaf => "DeletedLeaf", + Self::BoundaryLeaf => "BoundaryLeaf", + Self::Hash => "Hash", } } #[must_use] - pub const fn variants() -> [LedgerHeaderFlags; 3] { + pub const fn variants() -> [ColdArchiveBucketEntryType; 5] { Self::VARIANTS } } -impl Name for LedgerHeaderFlags { +impl Name for ColdArchiveBucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for LedgerHeaderFlags { - fn variants() -> slice::Iter<'static, LedgerHeaderFlags> { +impl Variants for ColdArchiveBucketEntryType { + fn variants() -> slice::Iter<'static, ColdArchiveBucketEntryType> { Self::VARIANTS.iter() } } -impl Enum for LedgerHeaderFlags {} +impl Enum for ColdArchiveBucketEntryType {} -impl fmt::Display for LedgerHeaderFlags { +impl fmt::Display for ColdArchiveBucketEntryType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for LedgerHeaderFlags { +impl TryFrom for ColdArchiveBucketEntryType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 1 => LedgerHeaderFlags::TradingFlag, - 2 => LedgerHeaderFlags::DepositFlag, - 4 => LedgerHeaderFlags::WithdrawalFlag, + -1 => ColdArchiveBucketEntryType::Metaentry, + 0 => ColdArchiveBucketEntryType::ArchivedLeaf, + 1 => ColdArchiveBucketEntryType::DeletedLeaf, + 2 => ColdArchiveBucketEntryType::BoundaryLeaf, + 3 => ColdArchiveBucketEntryType::Hash, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -17990,14 +17920,14 @@ impl TryFrom for LedgerHeaderFlags { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: LedgerHeaderFlags) -> Self { + fn from(e: ColdArchiveBucketEntryType) -> Self { e as Self } } -impl ReadXdr for LedgerHeaderFlags { +impl ReadXdr for ColdArchiveBucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18008,7 +17938,7 @@ impl ReadXdr for LedgerHeaderFlags { } } -impl WriteXdr for LedgerHeaderFlags { +impl WriteXdr for ColdArchiveBucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18018,13 +17948,15 @@ impl WriteXdr for LedgerHeaderFlags { } } -/// LedgerHeaderExtensionV1Ext is an XDR NestedUnion defines as: +/// BucketMetadataExt is an XDR NestedUnion defines as: /// /// ```text /// union switch (int v) /// { /// case 0: /// void; +/// case 1: +/// BucketListType bucketListType; /// } /// ``` /// @@ -18038,18 +17970,20 @@ impl WriteXdr for LedgerHeaderFlags { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerHeaderExtensionV1Ext { +pub enum BucketMetadataExt { V0, + V1(BucketListType), } -impl LedgerHeaderExtensionV1Ext { - pub const VARIANTS: [i32; 1] = [0]; - pub const VARIANTS_STR: [&'static str; 1] = ["V0"]; +impl BucketMetadataExt { + pub const VARIANTS: [i32; 2] = [0, 1]; + pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; #[must_use] pub const fn name(&self) -> &'static str { match self { Self::V0 => "V0", + Self::V1(_) => "V1", } } @@ -18058,38 +17992,39 @@ impl LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms)] match self { Self::V0 => 0, + Self::V1(_) => 1, } } #[must_use] - pub const fn variants() -> [i32; 1] { + pub const fn variants() -> [i32; 2] { Self::VARIANTS } } -impl Name for LedgerHeaderExtensionV1Ext { +impl Name for BucketMetadataExt { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerHeaderExtensionV1Ext { +impl Discriminant for BucketMetadataExt { #[must_use] fn discriminant(&self) -> i32 { Self::discriminant(self) } } -impl Variants for LedgerHeaderExtensionV1Ext { +impl Variants for BucketMetadataExt { fn variants() -> slice::Iter<'static, i32> { Self::VARIANTS.iter() } } -impl Union for LedgerHeaderExtensionV1Ext {} +impl Union for BucketMetadataExt {} -impl ReadXdr for LedgerHeaderExtensionV1Ext { +impl ReadXdr for BucketMetadataExt { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18097,6 +18032,7 @@ impl ReadXdr for LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { 0 => Self::V0, + 1 => Self::V1(BucketListType::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18105,7 +18041,7 @@ impl ReadXdr for LedgerHeaderExtensionV1Ext { } } -impl WriteXdr for LedgerHeaderExtensionV1Ext { +impl WriteXdr for BucketMetadataExt { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18113,23 +18049,28 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms)] match self { Self::V0 => ().write_xdr(w)?, + Self::V1(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// LedgerHeaderExtensionV1 is an XDR Struct defines as: +/// BucketMetadata is an XDR Struct defines as: /// /// ```text -/// struct LedgerHeaderExtensionV1 +/// struct BucketMetadata /// { -/// uint32 flags; // LedgerHeaderFlags +/// // Indicates the protocol version used to create / merge this bucket. +/// uint32 ledgerVersion; /// +/// // reserved for future use /// union switch (int v) /// { /// case 0: /// void; +/// case 1: +/// BucketListType bucketListType; /// } /// ext; /// }; @@ -18143,47 +18084,51 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerHeaderExtensionV1 { - pub flags: u32, - pub ext: LedgerHeaderExtensionV1Ext, +pub struct BucketMetadata { + pub ledger_version: u32, + pub ext: BucketMetadataExt, } -impl ReadXdr for LedgerHeaderExtensionV1 { +impl ReadXdr for BucketMetadata { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - flags: u32::read_xdr(r)?, - ext: LedgerHeaderExtensionV1Ext::read_xdr(r)?, + ledger_version: u32::read_xdr(r)?, + ext: BucketMetadataExt::read_xdr(r)?, }) }) } } -impl WriteXdr for LedgerHeaderExtensionV1 { +impl WriteXdr for BucketMetadata { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.flags.write_xdr(w)?; + self.ledger_version.write_xdr(w)?; self.ext.write_xdr(w)?; Ok(()) }) } } -/// LedgerHeaderExt is an XDR NestedUnion defines as: +/// BucketEntry is an XDR Union defines as: /// /// ```text -/// union switch (int v) -/// { -/// case 0: -/// void; -/// case 1: -/// LedgerHeaderExtensionV1 v1; -/// } +/// union BucketEntry switch (BucketEntryType type) +/// { +/// case LIVEENTRY: +/// case INITENTRY: +/// LedgerEntry liveEntry; +/// +/// case DEADENTRY: +/// LedgerKey deadEntry; +/// case METAENTRY: +/// BucketMetadata metaEntry; +/// }; /// ``` /// -// union with discriminant i32 +// union with discriminant BucketEntryType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -18193,69 +18138,83 @@ impl WriteXdr for LedgerHeaderExtensionV1 { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerHeaderExt { - V0, - V1(LedgerHeaderExtensionV1), +pub enum BucketEntry { + Liveentry(LedgerEntry), + Initentry(LedgerEntry), + Deadentry(LedgerKey), + Metaentry(BucketMetadata), } -impl LedgerHeaderExt { - pub const VARIANTS: [i32; 2] = [0, 1]; - pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; +impl BucketEntry { + pub const VARIANTS: [BucketEntryType; 4] = [ + BucketEntryType::Liveentry, + BucketEntryType::Initentry, + BucketEntryType::Deadentry, + BucketEntryType::Metaentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = + ["Liveentry", "Initentry", "Deadentry", "Metaentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::V0 => "V0", - Self::V1(_) => "V1", + Self::Liveentry(_) => "Liveentry", + Self::Initentry(_) => "Initentry", + Self::Deadentry(_) => "Deadentry", + Self::Metaentry(_) => "Metaentry", } } #[must_use] - pub const fn discriminant(&self) -> i32 { + pub const fn discriminant(&self) -> BucketEntryType { #[allow(clippy::match_same_arms)] match self { - Self::V0 => 0, - Self::V1(_) => 1, + Self::Liveentry(_) => BucketEntryType::Liveentry, + Self::Initentry(_) => BucketEntryType::Initentry, + Self::Deadentry(_) => BucketEntryType::Deadentry, + Self::Metaentry(_) => BucketEntryType::Metaentry, } } #[must_use] - pub const fn variants() -> [i32; 2] { + pub const fn variants() -> [BucketEntryType; 4] { Self::VARIANTS } } -impl Name for LedgerHeaderExt { +impl Name for BucketEntry { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerHeaderExt { +impl Discriminant for BucketEntry { #[must_use] - fn discriminant(&self) -> i32 { + fn discriminant(&self) -> BucketEntryType { Self::discriminant(self) } } -impl Variants for LedgerHeaderExt { - fn variants() -> slice::Iter<'static, i32> { +impl Variants for BucketEntry { + fn variants() -> slice::Iter<'static, BucketEntryType> { Self::VARIANTS.iter() } } -impl Union for LedgerHeaderExt {} +impl Union for BucketEntry {} -impl ReadXdr for LedgerHeaderExt { +impl ReadXdr for BucketEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: i32 = ::read_xdr(r)?; + let dv: BucketEntryType = ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - 0 => Self::V0, - 1 => Self::V1(LedgerHeaderExtensionV1::read_xdr(r)?), + BucketEntryType::Liveentry => Self::Liveentry(LedgerEntry::read_xdr(r)?), + BucketEntryType::Initentry => Self::Initentry(LedgerEntry::read_xdr(r)?), + BucketEntryType::Deadentry => Self::Deadentry(LedgerKey::read_xdr(r)?), + BucketEntryType::Metaentry => Self::Metaentry(BucketMetadata::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18264,65 +18223,40 @@ impl ReadXdr for LedgerHeaderExt { } } -impl WriteXdr for LedgerHeaderExt { +impl WriteXdr for BucketEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::V0 => ().write_xdr(w)?, - Self::V1(v) => v.write_xdr(w)?, + Self::Liveentry(v) => v.write_xdr(w)?, + Self::Initentry(v) => v.write_xdr(w)?, + Self::Deadentry(v) => v.write_xdr(w)?, + Self::Metaentry(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// LedgerHeader is an XDR Struct defines as: +/// HotArchiveBucketEntry is an XDR Union defines as: /// /// ```text -/// struct LedgerHeader +/// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) /// { -/// uint32 ledgerVersion; // the protocol version of the ledger -/// Hash previousLedgerHash; // hash of the previous ledger header -/// StellarValue scpValue; // what consensus agreed to -/// Hash txSetResultHash; // the TransactionResultSet that led to this ledger -/// Hash bucketListHash; // hash of the ledger state -/// -/// uint32 ledgerSeq; // sequence number of this ledger -/// -/// int64 totalCoins; // total number of stroops in existence. -/// // 10,000,000 stroops in 1 XLM -/// -/// int64 feePool; // fees burned since last inflation run -/// uint32 inflationSeq; // inflation sequence number -/// -/// uint64 idPool; // last used global ID, used for generating objects -/// -/// uint32 baseFee; // base fee per operation in stroops -/// uint32 baseReserve; // account base reserve in stroops -/// -/// uint32 maxTxSetSize; // maximum size a transaction set can be -/// -/// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back -/// // in time without walking the chain back ledger by ledger -/// // each slot contains the oldest ledger that is mod of -/// // either 50 5000 50000 or 500000 depending on index -/// // skipList[0] mod(50), skipList[1] mod(5000), etc +/// case HOT_ARCHIVE_ARCHIVED: +/// LedgerEntry archivedEntry; /// -/// // reserved for future use -/// union switch (int v) -/// { -/// case 0: -/// void; -/// case 1: -/// LedgerHeaderExtensionV1 v1; -/// } -/// ext; +/// case HOT_ARCHIVE_LIVE: +/// case HOT_ARCHIVE_DELETED: +/// LedgerKey key; +/// case HOT_ARCHIVE_METAENTRY: +/// BucketMetadata metaEntry; /// }; /// ``` /// +// union with discriminant HotArchiveBucketEntryType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -18331,90 +18265,122 @@ impl WriteXdr for LedgerHeaderExt { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerHeader { - pub ledger_version: u32, - pub previous_ledger_hash: Hash, - pub scp_value: StellarValue, - pub tx_set_result_hash: Hash, - pub bucket_list_hash: Hash, - pub ledger_seq: u32, - pub total_coins: i64, - pub fee_pool: i64, - pub inflation_seq: u32, - pub id_pool: u64, - pub base_fee: u32, - pub base_reserve: u32, - pub max_tx_set_size: u32, - pub skip_list: [Hash; 4], - pub ext: LedgerHeaderExt, +#[allow(clippy::large_enum_variant)] +pub enum HotArchiveBucketEntry { + Archived(LedgerEntry), + Live(LedgerKey), + Deleted(LedgerKey), + Metaentry(BucketMetadata), } -impl ReadXdr for LedgerHeader { +impl HotArchiveBucketEntry { + pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ + HotArchiveBucketEntryType::Archived, + HotArchiveBucketEntryType::Live, + HotArchiveBucketEntryType::Deleted, + HotArchiveBucketEntryType::Metaentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = ["Archived", "Live", "Deleted", "Metaentry"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Archived(_) => "Archived", + Self::Live(_) => "Live", + Self::Deleted(_) => "Deleted", + Self::Metaentry(_) => "Metaentry", + } + } + + #[must_use] + pub const fn discriminant(&self) -> HotArchiveBucketEntryType { + #[allow(clippy::match_same_arms)] + match self { + Self::Archived(_) => HotArchiveBucketEntryType::Archived, + Self::Live(_) => HotArchiveBucketEntryType::Live, + Self::Deleted(_) => HotArchiveBucketEntryType::Deleted, + Self::Metaentry(_) => HotArchiveBucketEntryType::Metaentry, + } + } + + #[must_use] + pub const fn variants() -> [HotArchiveBucketEntryType; 4] { + Self::VARIANTS + } +} + +impl Name for HotArchiveBucketEntry { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Discriminant for HotArchiveBucketEntry { + #[must_use] + fn discriminant(&self) -> HotArchiveBucketEntryType { + Self::discriminant(self) + } +} + +impl Variants for HotArchiveBucketEntry { + fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { + Self::VARIANTS.iter() + } +} + +impl Union for HotArchiveBucketEntry {} + +impl ReadXdr for HotArchiveBucketEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - Ok(Self { - ledger_version: u32::read_xdr(r)?, - previous_ledger_hash: Hash::read_xdr(r)?, - scp_value: StellarValue::read_xdr(r)?, - tx_set_result_hash: Hash::read_xdr(r)?, - bucket_list_hash: Hash::read_xdr(r)?, - ledger_seq: u32::read_xdr(r)?, - total_coins: i64::read_xdr(r)?, - fee_pool: i64::read_xdr(r)?, - inflation_seq: u32::read_xdr(r)?, - id_pool: u64::read_xdr(r)?, - base_fee: u32::read_xdr(r)?, - base_reserve: u32::read_xdr(r)?, - max_tx_set_size: u32::read_xdr(r)?, - skip_list: <[Hash; 4]>::read_xdr(r)?, - ext: LedgerHeaderExt::read_xdr(r)?, - }) + let dv: HotArchiveBucketEntryType = + ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + HotArchiveBucketEntryType::Archived => Self::Archived(LedgerEntry::read_xdr(r)?), + HotArchiveBucketEntryType::Live => Self::Live(LedgerKey::read_xdr(r)?), + HotArchiveBucketEntryType::Deleted => Self::Deleted(LedgerKey::read_xdr(r)?), + HotArchiveBucketEntryType::Metaentry => { + Self::Metaentry(BucketMetadata::read_xdr(r)?) + } + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) }) } } -impl WriteXdr for LedgerHeader { +impl WriteXdr for HotArchiveBucketEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.ledger_version.write_xdr(w)?; - self.previous_ledger_hash.write_xdr(w)?; - self.scp_value.write_xdr(w)?; - self.tx_set_result_hash.write_xdr(w)?; - self.bucket_list_hash.write_xdr(w)?; - self.ledger_seq.write_xdr(w)?; - self.total_coins.write_xdr(w)?; - self.fee_pool.write_xdr(w)?; - self.inflation_seq.write_xdr(w)?; - self.id_pool.write_xdr(w)?; - self.base_fee.write_xdr(w)?; - self.base_reserve.write_xdr(w)?; - self.max_tx_set_size.write_xdr(w)?; - self.skip_list.write_xdr(w)?; - self.ext.write_xdr(w)?; + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::Archived(v) => v.write_xdr(w)?, + Self::Live(v) => v.write_xdr(w)?, + Self::Deleted(v) => v.write_xdr(w)?, + Self::Metaentry(v) => v.write_xdr(w)?, + }; Ok(()) }) } } -/// LedgerUpgradeType is an XDR Enum defines as: +/// ColdArchiveArchivedLeaf is an XDR Struct defines as: /// /// ```text -/// enum LedgerUpgradeType +/// struct ColdArchiveArchivedLeaf /// { -/// LEDGER_UPGRADE_VERSION = 1, -/// LEDGER_UPGRADE_BASE_FEE = 2, -/// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, -/// LEDGER_UPGRADE_BASE_RESERVE = 4, -/// LEDGER_UPGRADE_FLAGS = 5, -/// LEDGER_UPGRADE_CONFIG = 6, -/// LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 +/// uint32 index; +/// LedgerEntry archivedEntry; /// }; /// ``` /// -// enum -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -18422,130 +18388,134 @@ impl WriteXdr for LedgerHeader { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[repr(i32)] -pub enum LedgerUpgradeType { - Version = 1, - BaseFee = 2, - MaxTxSetSize = 3, - BaseReserve = 4, - Flags = 5, - Config = 6, - MaxSorobanTxSetSize = 7, +pub struct ColdArchiveArchivedLeaf { + pub index: u32, + pub archived_entry: LedgerEntry, } -impl LedgerUpgradeType { - pub const VARIANTS: [LedgerUpgradeType; 7] = [ - LedgerUpgradeType::Version, - LedgerUpgradeType::BaseFee, - LedgerUpgradeType::MaxTxSetSize, - LedgerUpgradeType::BaseReserve, - LedgerUpgradeType::Flags, - LedgerUpgradeType::Config, - LedgerUpgradeType::MaxSorobanTxSetSize, - ]; - pub const VARIANTS_STR: [&'static str; 7] = [ - "Version", - "BaseFee", - "MaxTxSetSize", - "BaseReserve", - "Flags", - "Config", - "MaxSorobanTxSetSize", - ]; - - #[must_use] - pub const fn name(&self) -> &'static str { - match self { - Self::Version => "Version", - Self::BaseFee => "BaseFee", - Self::MaxTxSetSize => "MaxTxSetSize", - Self::BaseReserve => "BaseReserve", - Self::Flags => "Flags", - Self::Config => "Config", - Self::MaxSorobanTxSetSize => "MaxSorobanTxSetSize", - } - } - - #[must_use] - pub const fn variants() -> [LedgerUpgradeType; 7] { - Self::VARIANTS +impl ReadXdr for ColdArchiveArchivedLeaf { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + archived_entry: LedgerEntry::read_xdr(r)?, + }) + }) } } -impl Name for LedgerUpgradeType { - #[must_use] - fn name(&self) -> &'static str { - Self::name(self) +impl WriteXdr for ColdArchiveArchivedLeaf { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.archived_entry.write_xdr(w)?; + Ok(()) + }) } } -impl Variants for LedgerUpgradeType { - fn variants() -> slice::Iter<'static, LedgerUpgradeType> { - Self::VARIANTS.iter() - } +/// ColdArchiveDeletedLeaf is an XDR Struct defines as: +/// +/// ```text +/// struct ColdArchiveDeletedLeaf +/// { +/// uint32 index; +/// LedgerKey deletedKey; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ColdArchiveDeletedLeaf { + pub index: u32, + pub deleted_key: LedgerKey, } -impl Enum for LedgerUpgradeType {} - -impl fmt::Display for LedgerUpgradeType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.name()) +impl ReadXdr for ColdArchiveDeletedLeaf { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + deleted_key: LedgerKey::read_xdr(r)?, + }) + }) } } -impl TryFrom for LedgerUpgradeType { - type Error = Error; - - fn try_from(i: i32) -> Result { - let e = match i { - 1 => LedgerUpgradeType::Version, - 2 => LedgerUpgradeType::BaseFee, - 3 => LedgerUpgradeType::MaxTxSetSize, - 4 => LedgerUpgradeType::BaseReserve, - 5 => LedgerUpgradeType::Flags, - 6 => LedgerUpgradeType::Config, - 7 => LedgerUpgradeType::MaxSorobanTxSetSize, - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(e) +impl WriteXdr for ColdArchiveDeletedLeaf { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.deleted_key.write_xdr(w)?; + Ok(()) + }) } } -impl From for i32 { - #[must_use] - fn from(e: LedgerUpgradeType) -> Self { - e as Self - } +/// ColdArchiveBoundaryLeaf is an XDR Struct defines as: +/// +/// ```text +/// struct ColdArchiveBoundaryLeaf +/// { +/// uint32 index; +/// bool isLowerBound; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ColdArchiveBoundaryLeaf { + pub index: u32, + pub is_lower_bound: bool, } -impl ReadXdr for LedgerUpgradeType { +impl ReadXdr for ColdArchiveBoundaryLeaf { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let e = i32::read_xdr(r)?; - let v: Self = e.try_into()?; - Ok(v) + Ok(Self { + index: u32::read_xdr(r)?, + is_lower_bound: bool::read_xdr(r)?, + }) }) } } -impl WriteXdr for LedgerUpgradeType { +impl WriteXdr for ColdArchiveBoundaryLeaf { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - let i: i32 = (*self).into(); - i.write_xdr(w) + self.index.write_xdr(w)?; + self.is_lower_bound.write_xdr(w)?; + Ok(()) }) } } -/// ConfigUpgradeSetKey is an XDR Struct defines as: +/// ColdArchiveHashEntry is an XDR Struct defines as: /// /// ```text -/// struct ConfigUpgradeSetKey { -/// Hash contractID; -/// Hash contentHash; +/// struct ColdArchiveHashEntry +/// { +/// uint32 index; +/// uint32 level; +/// Hash hash; /// }; /// ``` /// @@ -18557,60 +18527,56 @@ impl WriteXdr for LedgerUpgradeType { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct ConfigUpgradeSetKey { - pub contract_id: Hash, - pub content_hash: Hash, +pub struct ColdArchiveHashEntry { + pub index: u32, + pub level: u32, + pub hash: Hash, } -impl ReadXdr for ConfigUpgradeSetKey { +impl ReadXdr for ColdArchiveHashEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - contract_id: Hash::read_xdr(r)?, - content_hash: Hash::read_xdr(r)?, + index: u32::read_xdr(r)?, + level: u32::read_xdr(r)?, + hash: Hash::read_xdr(r)?, }) }) } } -impl WriteXdr for ConfigUpgradeSetKey { +impl WriteXdr for ColdArchiveHashEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.contract_id.write_xdr(w)?; - self.content_hash.write_xdr(w)?; + self.index.write_xdr(w)?; + self.level.write_xdr(w)?; + self.hash.write_xdr(w)?; Ok(()) }) } } -/// LedgerUpgrade is an XDR Union defines as: +/// ColdArchiveBucketEntry is an XDR Union defines as: /// /// ```text -/// union LedgerUpgrade switch (LedgerUpgradeType type) +/// union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) /// { -/// case LEDGER_UPGRADE_VERSION: -/// uint32 newLedgerVersion; // update ledgerVersion -/// case LEDGER_UPGRADE_BASE_FEE: -/// uint32 newBaseFee; // update baseFee -/// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: -/// uint32 newMaxTxSetSize; // update maxTxSetSize -/// case LEDGER_UPGRADE_BASE_RESERVE: -/// uint32 newBaseReserve; // update baseReserve -/// case LEDGER_UPGRADE_FLAGS: -/// uint32 newFlags; // update flags -/// case LEDGER_UPGRADE_CONFIG: -/// // Update arbitrary `ConfigSetting` entries identified by the key. -/// ConfigUpgradeSetKey newConfig; -/// case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: -/// // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without -/// // using `LEDGER_UPGRADE_CONFIG`. -/// uint32 newMaxSorobanTxSetSize; +/// case COLD_ARCHIVE_METAENTRY: +/// BucketMetadata metaEntry; +/// case COLD_ARCHIVE_ARCHIVED_LEAF: +/// ColdArchiveArchivedLeaf archivedLeaf; +/// case COLD_ARCHIVE_DELETED_LEAF: +/// ColdArchiveDeletedLeaf deletedLeaf; +/// case COLD_ARCHIVE_BOUNDARY_LEAF: +/// ColdArchiveBoundaryLeaf boundaryLeaf; +/// case COLD_ARCHIVE_HASH: +/// ColdArchiveHashEntry hashEntry; /// }; /// ``` /// -// union with discriminant LedgerUpgradeType +// union with discriminant ColdArchiveBucketEntryType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -18620,107 +18586,102 @@ impl WriteXdr for ConfigUpgradeSetKey { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerUpgrade { - Version(u32), - BaseFee(u32), - MaxTxSetSize(u32), - BaseReserve(u32), - Flags(u32), - Config(ConfigUpgradeSetKey), - MaxSorobanTxSetSize(u32), -} - -impl LedgerUpgrade { - pub const VARIANTS: [LedgerUpgradeType; 7] = [ - LedgerUpgradeType::Version, - LedgerUpgradeType::BaseFee, - LedgerUpgradeType::MaxTxSetSize, - LedgerUpgradeType::BaseReserve, - LedgerUpgradeType::Flags, - LedgerUpgradeType::Config, - LedgerUpgradeType::MaxSorobanTxSetSize, +pub enum ColdArchiveBucketEntry { + Metaentry(BucketMetadata), + ArchivedLeaf(ColdArchiveArchivedLeaf), + DeletedLeaf(ColdArchiveDeletedLeaf), + BoundaryLeaf(ColdArchiveBoundaryLeaf), + Hash(ColdArchiveHashEntry), +} + +impl ColdArchiveBucketEntry { + pub const VARIANTS: [ColdArchiveBucketEntryType; 5] = [ + ColdArchiveBucketEntryType::Metaentry, + ColdArchiveBucketEntryType::ArchivedLeaf, + ColdArchiveBucketEntryType::DeletedLeaf, + ColdArchiveBucketEntryType::BoundaryLeaf, + ColdArchiveBucketEntryType::Hash, ]; - pub const VARIANTS_STR: [&'static str; 7] = [ - "Version", - "BaseFee", - "MaxTxSetSize", - "BaseReserve", - "Flags", - "Config", - "MaxSorobanTxSetSize", + pub const VARIANTS_STR: [&'static str; 5] = [ + "Metaentry", + "ArchivedLeaf", + "DeletedLeaf", + "BoundaryLeaf", + "Hash", ]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Version(_) => "Version", - Self::BaseFee(_) => "BaseFee", - Self::MaxTxSetSize(_) => "MaxTxSetSize", - Self::BaseReserve(_) => "BaseReserve", - Self::Flags(_) => "Flags", - Self::Config(_) => "Config", - Self::MaxSorobanTxSetSize(_) => "MaxSorobanTxSetSize", + Self::Metaentry(_) => "Metaentry", + Self::ArchivedLeaf(_) => "ArchivedLeaf", + Self::DeletedLeaf(_) => "DeletedLeaf", + Self::BoundaryLeaf(_) => "BoundaryLeaf", + Self::Hash(_) => "Hash", } } #[must_use] - pub const fn discriminant(&self) -> LedgerUpgradeType { + pub const fn discriminant(&self) -> ColdArchiveBucketEntryType { #[allow(clippy::match_same_arms)] match self { - Self::Version(_) => LedgerUpgradeType::Version, - Self::BaseFee(_) => LedgerUpgradeType::BaseFee, - Self::MaxTxSetSize(_) => LedgerUpgradeType::MaxTxSetSize, - Self::BaseReserve(_) => LedgerUpgradeType::BaseReserve, - Self::Flags(_) => LedgerUpgradeType::Flags, - Self::Config(_) => LedgerUpgradeType::Config, - Self::MaxSorobanTxSetSize(_) => LedgerUpgradeType::MaxSorobanTxSetSize, + Self::Metaentry(_) => ColdArchiveBucketEntryType::Metaentry, + Self::ArchivedLeaf(_) => ColdArchiveBucketEntryType::ArchivedLeaf, + Self::DeletedLeaf(_) => ColdArchiveBucketEntryType::DeletedLeaf, + Self::BoundaryLeaf(_) => ColdArchiveBucketEntryType::BoundaryLeaf, + Self::Hash(_) => ColdArchiveBucketEntryType::Hash, } } #[must_use] - pub const fn variants() -> [LedgerUpgradeType; 7] { + pub const fn variants() -> [ColdArchiveBucketEntryType; 5] { Self::VARIANTS } } -impl Name for LedgerUpgrade { +impl Name for ColdArchiveBucketEntry { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerUpgrade { +impl Discriminant for ColdArchiveBucketEntry { #[must_use] - fn discriminant(&self) -> LedgerUpgradeType { + fn discriminant(&self) -> ColdArchiveBucketEntryType { Self::discriminant(self) } } -impl Variants for LedgerUpgrade { - fn variants() -> slice::Iter<'static, LedgerUpgradeType> { +impl Variants for ColdArchiveBucketEntry { + fn variants() -> slice::Iter<'static, ColdArchiveBucketEntryType> { Self::VARIANTS.iter() } } -impl Union for LedgerUpgrade {} +impl Union for ColdArchiveBucketEntry {} -impl ReadXdr for LedgerUpgrade { +impl ReadXdr for ColdArchiveBucketEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: LedgerUpgradeType = ::read_xdr(r)?; + let dv: ColdArchiveBucketEntryType = + ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - LedgerUpgradeType::Version => Self::Version(u32::read_xdr(r)?), - LedgerUpgradeType::BaseFee => Self::BaseFee(u32::read_xdr(r)?), - LedgerUpgradeType::MaxTxSetSize => Self::MaxTxSetSize(u32::read_xdr(r)?), - LedgerUpgradeType::BaseReserve => Self::BaseReserve(u32::read_xdr(r)?), - LedgerUpgradeType::Flags => Self::Flags(u32::read_xdr(r)?), - LedgerUpgradeType::Config => Self::Config(ConfigUpgradeSetKey::read_xdr(r)?), - LedgerUpgradeType::MaxSorobanTxSetSize => { - Self::MaxSorobanTxSetSize(u32::read_xdr(r)?) + ColdArchiveBucketEntryType::Metaentry => { + Self::Metaentry(BucketMetadata::read_xdr(r)?) + } + ColdArchiveBucketEntryType::ArchivedLeaf => { + Self::ArchivedLeaf(ColdArchiveArchivedLeaf::read_xdr(r)?) + } + ColdArchiveBucketEntryType::DeletedLeaf => { + Self::DeletedLeaf(ColdArchiveDeletedLeaf::read_xdr(r)?) + } + ColdArchiveBucketEntryType::BoundaryLeaf => { + Self::BoundaryLeaf(ColdArchiveBoundaryLeaf::read_xdr(r)?) } + ColdArchiveBucketEntryType::Hash => Self::Hash(ColdArchiveHashEntry::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18729,75 +18690,137 @@ impl ReadXdr for LedgerUpgrade { } } -impl WriteXdr for LedgerUpgrade { +impl WriteXdr for ColdArchiveBucketEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::Version(v) => v.write_xdr(w)?, - Self::BaseFee(v) => v.write_xdr(w)?, - Self::MaxTxSetSize(v) => v.write_xdr(w)?, - Self::BaseReserve(v) => v.write_xdr(w)?, - Self::Flags(v) => v.write_xdr(w)?, - Self::Config(v) => v.write_xdr(w)?, - Self::MaxSorobanTxSetSize(v) => v.write_xdr(w)?, + Self::Metaentry(v) => v.write_xdr(w)?, + Self::ArchivedLeaf(v) => v.write_xdr(w)?, + Self::DeletedLeaf(v) => v.write_xdr(w)?, + Self::BoundaryLeaf(v) => v.write_xdr(w)?, + Self::Hash(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// ConfigUpgradeSet is an XDR Struct defines as: +/// UpgradeType is an XDR Typedef defines as: /// /// ```text -/// struct ConfigUpgradeSet { -/// ConfigSettingEntry updatedEntry<>; -/// }; +/// typedef opaque UpgradeType<128>; /// ``` /// -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[derive(Default)] #[cfg_attr( all(feature = "serde", feature = "alloc"), derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct ConfigUpgradeSet { - pub updated_entry: VecM, +#[derive(Debug)] +pub struct UpgradeType(pub BytesM<128>); + +impl From for BytesM<128> { + #[must_use] + fn from(x: UpgradeType) -> Self { + x.0 + } } -impl ReadXdr for ConfigUpgradeSet { +impl From> for UpgradeType { + #[must_use] + fn from(x: BytesM<128>) -> Self { + UpgradeType(x) + } +} + +impl AsRef> for UpgradeType { + #[must_use] + fn as_ref(&self) -> &BytesM<128> { + &self.0 + } +} + +impl ReadXdr for UpgradeType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - Ok(Self { - updated_entry: VecM::::read_xdr(r)?, - }) + let i = BytesM::<128>::read_xdr(r)?; + let v = UpgradeType(i); + Ok(v) }) } } -impl WriteXdr for ConfigUpgradeSet { +impl WriteXdr for UpgradeType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| { - self.updated_entry.write_xdr(w)?; - Ok(()) - }) + w.with_limited_depth(|w| self.0.write_xdr(w)) } } -/// BucketListType is an XDR Enum defines as: +impl Deref for UpgradeType { + type Target = BytesM<128>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From for Vec { + #[must_use] + fn from(x: UpgradeType) -> Self { + x.0 .0 + } +} + +impl TryFrom> for UpgradeType { + type Error = Error; + fn try_from(x: Vec) -> Result { + Ok(UpgradeType(x.try_into()?)) + } +} + +#[cfg(feature = "alloc")] +impl TryFrom<&Vec> for UpgradeType { + type Error = Error; + fn try_from(x: &Vec) -> Result { + Ok(UpgradeType(x.try_into()?)) + } +} + +impl AsRef> for UpgradeType { + #[must_use] + fn as_ref(&self) -> &Vec { + &self.0 .0 + } +} + +impl AsRef<[u8]> for UpgradeType { + #[cfg(feature = "alloc")] + #[must_use] + fn as_ref(&self) -> &[u8] { + &self.0 .0 + } + #[cfg(not(feature = "alloc"))] + #[must_use] + fn as_ref(&self) -> &[u8] { + self.0 .0 + } +} + +/// StellarValueType is an XDR Enum defines as: /// /// ```text -/// enum BucketListType +/// enum StellarValueType /// { -/// LIVE = 0, -/// HOT_ARCHIVE = 1, -/// COLD_ARCHIVE = 2 +/// STELLAR_VALUE_BASIC = 0, +/// STELLAR_VALUE_SIGNED = 1 /// }; /// ``` /// @@ -18811,64 +18834,57 @@ impl WriteXdr for ConfigUpgradeSet { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum BucketListType { - Live = 0, - HotArchive = 1, - ColdArchive = 2, +pub enum StellarValueType { + Basic = 0, + Signed = 1, } -impl BucketListType { - pub const VARIANTS: [BucketListType; 3] = [ - BucketListType::Live, - BucketListType::HotArchive, - BucketListType::ColdArchive, - ]; - pub const VARIANTS_STR: [&'static str; 3] = ["Live", "HotArchive", "ColdArchive"]; +impl StellarValueType { + pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; + pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Live => "Live", - Self::HotArchive => "HotArchive", - Self::ColdArchive => "ColdArchive", + Self::Basic => "Basic", + Self::Signed => "Signed", } } #[must_use] - pub const fn variants() -> [BucketListType; 3] { + pub const fn variants() -> [StellarValueType; 2] { Self::VARIANTS } } -impl Name for BucketListType { +impl Name for StellarValueType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for BucketListType { - fn variants() -> slice::Iter<'static, BucketListType> { +impl Variants for StellarValueType { + fn variants() -> slice::Iter<'static, StellarValueType> { Self::VARIANTS.iter() } } -impl Enum for BucketListType {} +impl Enum for StellarValueType {} -impl fmt::Display for BucketListType { +impl fmt::Display for StellarValueType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for BucketListType { +impl TryFrom for StellarValueType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 0 => BucketListType::Live, - 1 => BucketListType::HotArchive, - 2 => BucketListType::ColdArchive, + 0 => StellarValueType::Basic, + 1 => StellarValueType::Signed, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18876,14 +18892,14 @@ impl TryFrom for BucketListType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: BucketListType) -> Self { + fn from(e: StellarValueType) -> Self { e as Self } } -impl ReadXdr for BucketListType { +impl ReadXdr for StellarValueType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18894,7 +18910,7 @@ impl ReadXdr for BucketListType { } } -impl WriteXdr for BucketListType { +impl WriteXdr for StellarValueType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18904,17 +18920,245 @@ impl WriteXdr for BucketListType { } } -/// BucketEntryType is an XDR Enum defines as: +/// LedgerCloseValueSignature is an XDR Struct defines as: /// /// ```text -/// enum BucketEntryType +/// struct LedgerCloseValueSignature /// { -/// METAENTRY = -/// -1, // At-and-after protocol 11: bucket metadata, should come first. -/// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -/// // At-and-after protocol 11: only updated. -/// DEADENTRY = 1, -/// INITENTRY = 2 // At-and-after protocol 11: only created. +/// NodeID nodeID; // which node introduced the value +/// Signature signature; // nodeID's signature +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct LedgerCloseValueSignature { + pub node_id: NodeId, + pub signature: Signature, +} + +impl ReadXdr for LedgerCloseValueSignature { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + node_id: NodeId::read_xdr(r)?, + signature: Signature::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for LedgerCloseValueSignature { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.node_id.write_xdr(w)?; + self.signature.write_xdr(w)?; + Ok(()) + }) + } +} + +/// StellarValueExt is an XDR NestedUnion defines as: +/// +/// ```text +/// union switch (StellarValueType v) +/// { +/// case STELLAR_VALUE_BASIC: +/// void; +/// case STELLAR_VALUE_SIGNED: +/// LedgerCloseValueSignature lcValueSignature; +/// } +/// ``` +/// +// union with discriminant StellarValueType +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[allow(clippy::large_enum_variant)] +pub enum StellarValueExt { + Basic, + Signed(LedgerCloseValueSignature), +} + +impl StellarValueExt { + pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; + pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Basic => "Basic", + Self::Signed(_) => "Signed", + } + } + + #[must_use] + pub const fn discriminant(&self) -> StellarValueType { + #[allow(clippy::match_same_arms)] + match self { + Self::Basic => StellarValueType::Basic, + Self::Signed(_) => StellarValueType::Signed, + } + } + + #[must_use] + pub const fn variants() -> [StellarValueType; 2] { + Self::VARIANTS + } +} + +impl Name for StellarValueExt { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Discriminant for StellarValueExt { + #[must_use] + fn discriminant(&self) -> StellarValueType { + Self::discriminant(self) + } +} + +impl Variants for StellarValueExt { + fn variants() -> slice::Iter<'static, StellarValueType> { + Self::VARIANTS.iter() + } +} + +impl Union for StellarValueExt {} + +impl ReadXdr for StellarValueExt { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let dv: StellarValueType = ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + StellarValueType::Basic => Self::Basic, + StellarValueType::Signed => Self::Signed(LedgerCloseValueSignature::read_xdr(r)?), + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) + }) + } +} + +impl WriteXdr for StellarValueExt { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::Basic => ().write_xdr(w)?, + Self::Signed(v) => v.write_xdr(w)?, + }; + Ok(()) + }) + } +} + +/// StellarValue is an XDR Struct defines as: +/// +/// ```text +/// struct StellarValue +/// { +/// Hash txSetHash; // transaction set to apply to previous ledger +/// TimePoint closeTime; // network close time +/// +/// // upgrades to apply to the previous ledger (usually empty) +/// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop +/// // unknown steps during consensus if needed. +/// // see notes below on 'LedgerUpgrade' for more detail +/// // max size is dictated by number of upgrade types (+ room for future) +/// UpgradeType upgrades<6>; +/// +/// // reserved for future use +/// union switch (StellarValueType v) +/// { +/// case STELLAR_VALUE_BASIC: +/// void; +/// case STELLAR_VALUE_SIGNED: +/// LedgerCloseValueSignature lcValueSignature; +/// } +/// ext; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct StellarValue { + pub tx_set_hash: Hash, + pub close_time: TimePoint, + pub upgrades: VecM, + pub ext: StellarValueExt, +} + +impl ReadXdr for StellarValue { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + tx_set_hash: Hash::read_xdr(r)?, + close_time: TimePoint::read_xdr(r)?, + upgrades: VecM::::read_xdr(r)?, + ext: StellarValueExt::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for StellarValue { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.tx_set_hash.write_xdr(w)?; + self.close_time.write_xdr(w)?; + self.upgrades.write_xdr(w)?; + self.ext.write_xdr(w)?; + Ok(()) + }) + } +} + +/// MaskLedgerHeaderFlags is an XDR Const defines as: +/// +/// ```text +/// const MASK_LEDGER_HEADER_FLAGS = 0x7; +/// ``` +/// +pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; + +/// LedgerHeaderFlags is an XDR Enum defines as: +/// +/// ```text +/// enum LedgerHeaderFlags +/// { +/// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, +/// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, +/// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 /// }; /// ``` /// @@ -18928,69 +19172,64 @@ impl WriteXdr for BucketListType { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum BucketEntryType { - Metaentry = -1, - Liveentry = 0, - Deadentry = 1, - Initentry = 2, +pub enum LedgerHeaderFlags { + TradingFlag = 1, + DepositFlag = 2, + WithdrawalFlag = 4, } -impl BucketEntryType { - pub const VARIANTS: [BucketEntryType; 4] = [ - BucketEntryType::Metaentry, - BucketEntryType::Liveentry, - BucketEntryType::Deadentry, - BucketEntryType::Initentry, +impl LedgerHeaderFlags { + pub const VARIANTS: [LedgerHeaderFlags; 3] = [ + LedgerHeaderFlags::TradingFlag, + LedgerHeaderFlags::DepositFlag, + LedgerHeaderFlags::WithdrawalFlag, ]; - pub const VARIANTS_STR: [&'static str; 4] = - ["Metaentry", "Liveentry", "Deadentry", "Initentry"]; + pub const VARIANTS_STR: [&'static str; 3] = ["TradingFlag", "DepositFlag", "WithdrawalFlag"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Metaentry => "Metaentry", - Self::Liveentry => "Liveentry", - Self::Deadentry => "Deadentry", - Self::Initentry => "Initentry", + Self::TradingFlag => "TradingFlag", + Self::DepositFlag => "DepositFlag", + Self::WithdrawalFlag => "WithdrawalFlag", } } #[must_use] - pub const fn variants() -> [BucketEntryType; 4] { + pub const fn variants() -> [LedgerHeaderFlags; 3] { Self::VARIANTS } } -impl Name for BucketEntryType { +impl Name for LedgerHeaderFlags { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for BucketEntryType { - fn variants() -> slice::Iter<'static, BucketEntryType> { +impl Variants for LedgerHeaderFlags { + fn variants() -> slice::Iter<'static, LedgerHeaderFlags> { Self::VARIANTS.iter() } } -impl Enum for BucketEntryType {} +impl Enum for LedgerHeaderFlags {} -impl fmt::Display for BucketEntryType { +impl fmt::Display for LedgerHeaderFlags { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for BucketEntryType { +impl TryFrom for LedgerHeaderFlags { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - -1 => BucketEntryType::Metaentry, - 0 => BucketEntryType::Liveentry, - 1 => BucketEntryType::Deadentry, - 2 => BucketEntryType::Initentry, + 1 => LedgerHeaderFlags::TradingFlag, + 2 => LedgerHeaderFlags::DepositFlag, + 4 => LedgerHeaderFlags::WithdrawalFlag, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18998,14 +19237,14 @@ impl TryFrom for BucketEntryType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: BucketEntryType) -> Self { + fn from(e: LedgerHeaderFlags) -> Self { e as Self } } -impl ReadXdr for BucketEntryType { +impl ReadXdr for LedgerHeaderFlags { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -19016,7 +19255,7 @@ impl ReadXdr for BucketEntryType { } } -impl WriteXdr for BucketEntryType { +impl WriteXdr for LedgerHeaderFlags { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -19026,22 +19265,18 @@ impl WriteXdr for BucketEntryType { } } -/// HotArchiveBucketEntryType is an XDR Enum defines as: +/// LedgerHeaderExtensionV1Ext is an XDR NestedUnion defines as: /// /// ```text -/// enum HotArchiveBucketEntryType -/// { -/// HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. -/// HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived -/// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but -/// // has been added back to the live BucketList. -/// // Does not need to be persisted. -/// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) -/// }; +/// union switch (int v) +/// { +/// case 0: +/// void; +/// } /// ``` /// -// enum -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +// union with discriminant i32 +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -19049,105 +19284,141 @@ impl WriteXdr for BucketEntryType { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[repr(i32)] -pub enum HotArchiveBucketEntryType { - Metaentry = -1, - Archived = 0, - Live = 1, - Deleted = 2, +#[allow(clippy::large_enum_variant)] +pub enum LedgerHeaderExtensionV1Ext { + V0, } -impl HotArchiveBucketEntryType { - pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ - HotArchiveBucketEntryType::Metaentry, - HotArchiveBucketEntryType::Archived, - HotArchiveBucketEntryType::Live, - HotArchiveBucketEntryType::Deleted, - ]; - pub const VARIANTS_STR: [&'static str; 4] = ["Metaentry", "Archived", "Live", "Deleted"]; +impl LedgerHeaderExtensionV1Ext { + pub const VARIANTS: [i32; 1] = [0]; + pub const VARIANTS_STR: [&'static str; 1] = ["V0"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Metaentry => "Metaentry", - Self::Archived => "Archived", - Self::Live => "Live", - Self::Deleted => "Deleted", + Self::V0 => "V0", } } #[must_use] - pub const fn variants() -> [HotArchiveBucketEntryType; 4] { + pub const fn discriminant(&self) -> i32 { + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => 0, + } + } + + #[must_use] + pub const fn variants() -> [i32; 1] { Self::VARIANTS } } -impl Name for HotArchiveBucketEntryType { +impl Name for LedgerHeaderExtensionV1Ext { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for HotArchiveBucketEntryType { - fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { - Self::VARIANTS.iter() +impl Discriminant for LedgerHeaderExtensionV1Ext { + #[must_use] + fn discriminant(&self) -> i32 { + Self::discriminant(self) } } -impl Enum for HotArchiveBucketEntryType {} - -impl fmt::Display for HotArchiveBucketEntryType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.name()) +impl Variants for LedgerHeaderExtensionV1Ext { + fn variants() -> slice::Iter<'static, i32> { + Self::VARIANTS.iter() } } -impl TryFrom for HotArchiveBucketEntryType { - type Error = Error; +impl Union for LedgerHeaderExtensionV1Ext {} - fn try_from(i: i32) -> Result { - let e = match i { - -1 => HotArchiveBucketEntryType::Metaentry, - 0 => HotArchiveBucketEntryType::Archived, - 1 => HotArchiveBucketEntryType::Live, - 2 => HotArchiveBucketEntryType::Deleted, - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(e) +impl ReadXdr for LedgerHeaderExtensionV1Ext { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let dv: i32 = ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + 0 => Self::V0, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) + }) } } -impl From for i32 { - #[must_use] - fn from(e: HotArchiveBucketEntryType) -> Self { - e as Self +impl WriteXdr for LedgerHeaderExtensionV1Ext { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => ().write_xdr(w)?, + }; + Ok(()) + }) } } -impl ReadXdr for HotArchiveBucketEntryType { +/// LedgerHeaderExtensionV1 is an XDR Struct defines as: +/// +/// ```text +/// struct LedgerHeaderExtensionV1 +/// { +/// uint32 flags; // LedgerHeaderFlags +/// +/// union switch (int v) +/// { +/// case 0: +/// void; +/// } +/// ext; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct LedgerHeaderExtensionV1 { + pub flags: u32, + pub ext: LedgerHeaderExtensionV1Ext, +} + +impl ReadXdr for LedgerHeaderExtensionV1 { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let e = i32::read_xdr(r)?; - let v: Self = e.try_into()?; - Ok(v) + Ok(Self { + flags: u32::read_xdr(r)?, + ext: LedgerHeaderExtensionV1Ext::read_xdr(r)?, + }) }) } } -impl WriteXdr for HotArchiveBucketEntryType { +impl WriteXdr for LedgerHeaderExtensionV1 { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - let i: i32 = (*self).into(); - i.write_xdr(w) + self.flags.write_xdr(w)?; + self.ext.write_xdr(w)?; + Ok(()) }) } } -/// BucketMetadataExt is an XDR NestedUnion defines as: +/// LedgerHeaderExt is an XDR NestedUnion defines as: /// /// ```text /// union switch (int v) @@ -19155,7 +19426,7 @@ impl WriteXdr for HotArchiveBucketEntryType { /// case 0: /// void; /// case 1: -/// BucketListType bucketListType; +/// LedgerHeaderExtensionV1 v1; /// } /// ``` /// @@ -19169,12 +19440,12 @@ impl WriteXdr for HotArchiveBucketEntryType { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum BucketMetadataExt { +pub enum LedgerHeaderExt { V0, - V1(BucketListType), + V1(LedgerHeaderExtensionV1), } -impl BucketMetadataExt { +impl LedgerHeaderExt { pub const VARIANTS: [i32; 2] = [0, 1]; pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; @@ -19201,29 +19472,29 @@ impl BucketMetadataExt { } } -impl Name for BucketMetadataExt { +impl Name for LedgerHeaderExt { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for BucketMetadataExt { +impl Discriminant for LedgerHeaderExt { #[must_use] fn discriminant(&self) -> i32 { Self::discriminant(self) } } -impl Variants for BucketMetadataExt { +impl Variants for LedgerHeaderExt { fn variants() -> slice::Iter<'static, i32> { Self::VARIANTS.iter() } } -impl Union for BucketMetadataExt {} +impl Union for LedgerHeaderExt {} -impl ReadXdr for BucketMetadataExt { +impl ReadXdr for LedgerHeaderExt { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -19231,7 +19502,7 @@ impl ReadXdr for BucketMetadataExt { #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { 0 => Self::V0, - 1 => Self::V1(BucketListType::read_xdr(r)?), + 1 => Self::V1(LedgerHeaderExtensionV1::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -19240,7 +19511,7 @@ impl ReadXdr for BucketMetadataExt { } } -impl WriteXdr for BucketMetadataExt { +impl WriteXdr for LedgerHeaderExt { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -19255,13 +19526,37 @@ impl WriteXdr for BucketMetadataExt { } } -/// BucketMetadata is an XDR Struct defines as: +/// LedgerHeader is an XDR Struct defines as: /// /// ```text -/// struct BucketMetadata +/// struct LedgerHeader /// { -/// // Indicates the protocol version used to create / merge this bucket. -/// uint32 ledgerVersion; +/// uint32 ledgerVersion; // the protocol version of the ledger +/// Hash previousLedgerHash; // hash of the previous ledger header +/// StellarValue scpValue; // what consensus agreed to +/// Hash txSetResultHash; // the TransactionResultSet that led to this ledger +/// Hash bucketListHash; // hash of the ledger state +/// +/// uint32 ledgerSeq; // sequence number of this ledger +/// +/// int64 totalCoins; // total number of stroops in existence. +/// // 10,000,000 stroops in 1 XLM +/// +/// int64 feePool; // fees burned since last inflation run +/// uint32 inflationSeq; // inflation sequence number +/// +/// uint64 idPool; // last used global ID, used for generating objects +/// +/// uint32 baseFee; // base fee per operation in stroops +/// uint32 baseReserve; // account base reserve in stroops +/// +/// uint32 maxTxSetSize; // maximum size a transaction set can be +/// +/// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back +/// // in time without walking the chain back ledger by ledger +/// // each slot contains the oldest ledger that is mod of +/// // either 50 5000 50000 or 500000 depending on index +/// // skipList[0] mod(50), skipList[1] mod(5000), etc /// /// // reserved for future use /// union switch (int v) @@ -19269,7 +19564,7 @@ impl WriteXdr for BucketMetadataExt { /// case 0: /// void; /// case 1: -/// BucketListType bucketListType; +/// LedgerHeaderExtensionV1 v1; /// } /// ext; /// }; @@ -19283,51 +19578,286 @@ impl WriteXdr for BucketMetadataExt { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct BucketMetadata { +pub struct LedgerHeader { pub ledger_version: u32, - pub ext: BucketMetadataExt, + pub previous_ledger_hash: Hash, + pub scp_value: StellarValue, + pub tx_set_result_hash: Hash, + pub bucket_list_hash: Hash, + pub ledger_seq: u32, + pub total_coins: i64, + pub fee_pool: i64, + pub inflation_seq: u32, + pub id_pool: u64, + pub base_fee: u32, + pub base_reserve: u32, + pub max_tx_set_size: u32, + pub skip_list: [Hash; 4], + pub ext: LedgerHeaderExt, } -impl ReadXdr for BucketMetadata { +impl ReadXdr for LedgerHeader { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + ledger_version: u32::read_xdr(r)?, + previous_ledger_hash: Hash::read_xdr(r)?, + scp_value: StellarValue::read_xdr(r)?, + tx_set_result_hash: Hash::read_xdr(r)?, + bucket_list_hash: Hash::read_xdr(r)?, + ledger_seq: u32::read_xdr(r)?, + total_coins: i64::read_xdr(r)?, + fee_pool: i64::read_xdr(r)?, + inflation_seq: u32::read_xdr(r)?, + id_pool: u64::read_xdr(r)?, + base_fee: u32::read_xdr(r)?, + base_reserve: u32::read_xdr(r)?, + max_tx_set_size: u32::read_xdr(r)?, + skip_list: <[Hash; 4]>::read_xdr(r)?, + ext: LedgerHeaderExt::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for LedgerHeader { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.ledger_version.write_xdr(w)?; + self.previous_ledger_hash.write_xdr(w)?; + self.scp_value.write_xdr(w)?; + self.tx_set_result_hash.write_xdr(w)?; + self.bucket_list_hash.write_xdr(w)?; + self.ledger_seq.write_xdr(w)?; + self.total_coins.write_xdr(w)?; + self.fee_pool.write_xdr(w)?; + self.inflation_seq.write_xdr(w)?; + self.id_pool.write_xdr(w)?; + self.base_fee.write_xdr(w)?; + self.base_reserve.write_xdr(w)?; + self.max_tx_set_size.write_xdr(w)?; + self.skip_list.write_xdr(w)?; + self.ext.write_xdr(w)?; + Ok(()) + }) + } +} + +/// LedgerUpgradeType is an XDR Enum defines as: +/// +/// ```text +/// enum LedgerUpgradeType +/// { +/// LEDGER_UPGRADE_VERSION = 1, +/// LEDGER_UPGRADE_BASE_FEE = 2, +/// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, +/// LEDGER_UPGRADE_BASE_RESERVE = 4, +/// LEDGER_UPGRADE_FLAGS = 5, +/// LEDGER_UPGRADE_CONFIG = 6, +/// LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 +/// }; +/// ``` +/// +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[repr(i32)] +pub enum LedgerUpgradeType { + Version = 1, + BaseFee = 2, + MaxTxSetSize = 3, + BaseReserve = 4, + Flags = 5, + Config = 6, + MaxSorobanTxSetSize = 7, +} + +impl LedgerUpgradeType { + pub const VARIANTS: [LedgerUpgradeType; 7] = [ + LedgerUpgradeType::Version, + LedgerUpgradeType::BaseFee, + LedgerUpgradeType::MaxTxSetSize, + LedgerUpgradeType::BaseReserve, + LedgerUpgradeType::Flags, + LedgerUpgradeType::Config, + LedgerUpgradeType::MaxSorobanTxSetSize, + ]; + pub const VARIANTS_STR: [&'static str; 7] = [ + "Version", + "BaseFee", + "MaxTxSetSize", + "BaseReserve", + "Flags", + "Config", + "MaxSorobanTxSetSize", + ]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Version => "Version", + Self::BaseFee => "BaseFee", + Self::MaxTxSetSize => "MaxTxSetSize", + Self::BaseReserve => "BaseReserve", + Self::Flags => "Flags", + Self::Config => "Config", + Self::MaxSorobanTxSetSize => "MaxSorobanTxSetSize", + } + } + + #[must_use] + pub const fn variants() -> [LedgerUpgradeType; 7] { + Self::VARIANTS + } +} + +impl Name for LedgerUpgradeType { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Variants for LedgerUpgradeType { + fn variants() -> slice::Iter<'static, LedgerUpgradeType> { + Self::VARIANTS.iter() + } +} + +impl Enum for LedgerUpgradeType {} + +impl fmt::Display for LedgerUpgradeType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) + } +} + +impl TryFrom for LedgerUpgradeType { + type Error = Error; + + fn try_from(i: i32) -> Result { + let e = match i { + 1 => LedgerUpgradeType::Version, + 2 => LedgerUpgradeType::BaseFee, + 3 => LedgerUpgradeType::MaxTxSetSize, + 4 => LedgerUpgradeType::BaseReserve, + 5 => LedgerUpgradeType::Flags, + 6 => LedgerUpgradeType::Config, + 7 => LedgerUpgradeType::MaxSorobanTxSetSize, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) + } +} + +impl From for i32 { + #[must_use] + fn from(e: LedgerUpgradeType) -> Self { + e as Self + } +} + +impl ReadXdr for LedgerUpgradeType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) + }) + } +} + +impl WriteXdr for LedgerUpgradeType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + let i: i32 = (*self).into(); + i.write_xdr(w) + }) + } +} + +/// ConfigUpgradeSetKey is an XDR Struct defines as: +/// +/// ```text +/// struct ConfigUpgradeSetKey { +/// Hash contractID; +/// Hash contentHash; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ConfigUpgradeSetKey { + pub contract_id: Hash, + pub content_hash: Hash, +} + +impl ReadXdr for ConfigUpgradeSetKey { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - ledger_version: u32::read_xdr(r)?, - ext: BucketMetadataExt::read_xdr(r)?, + contract_id: Hash::read_xdr(r)?, + content_hash: Hash::read_xdr(r)?, }) }) } } -impl WriteXdr for BucketMetadata { +impl WriteXdr for ConfigUpgradeSetKey { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.ledger_version.write_xdr(w)?; - self.ext.write_xdr(w)?; + self.contract_id.write_xdr(w)?; + self.content_hash.write_xdr(w)?; Ok(()) }) } } -/// BucketEntry is an XDR Union defines as: +/// LedgerUpgrade is an XDR Union defines as: /// /// ```text -/// union BucketEntry switch (BucketEntryType type) +/// union LedgerUpgrade switch (LedgerUpgradeType type) /// { -/// case LIVEENTRY: -/// case INITENTRY: -/// LedgerEntry liveEntry; -/// -/// case DEADENTRY: -/// LedgerKey deadEntry; -/// case METAENTRY: -/// BucketMetadata metaEntry; +/// case LEDGER_UPGRADE_VERSION: +/// uint32 newLedgerVersion; // update ledgerVersion +/// case LEDGER_UPGRADE_BASE_FEE: +/// uint32 newBaseFee; // update baseFee +/// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: +/// uint32 newMaxTxSetSize; // update maxTxSetSize +/// case LEDGER_UPGRADE_BASE_RESERVE: +/// uint32 newBaseReserve; // update baseReserve +/// case LEDGER_UPGRADE_FLAGS: +/// uint32 newFlags; // update flags +/// case LEDGER_UPGRADE_CONFIG: +/// // Update arbitrary `ConfigSetting` entries identified by the key. +/// ConfigUpgradeSetKey newConfig; +/// case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: +/// // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without +/// // using `LEDGER_UPGRADE_CONFIG`. +/// uint32 newMaxSorobanTxSetSize; /// }; /// ``` /// -// union with discriminant BucketEntryType +// union with discriminant LedgerUpgradeType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -19337,83 +19867,107 @@ impl WriteXdr for BucketMetadata { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum BucketEntry { - Liveentry(LedgerEntry), - Initentry(LedgerEntry), - Deadentry(LedgerKey), - Metaentry(BucketMetadata), +pub enum LedgerUpgrade { + Version(u32), + BaseFee(u32), + MaxTxSetSize(u32), + BaseReserve(u32), + Flags(u32), + Config(ConfigUpgradeSetKey), + MaxSorobanTxSetSize(u32), } -impl BucketEntry { - pub const VARIANTS: [BucketEntryType; 4] = [ - BucketEntryType::Liveentry, - BucketEntryType::Initentry, - BucketEntryType::Deadentry, - BucketEntryType::Metaentry, +impl LedgerUpgrade { + pub const VARIANTS: [LedgerUpgradeType; 7] = [ + LedgerUpgradeType::Version, + LedgerUpgradeType::BaseFee, + LedgerUpgradeType::MaxTxSetSize, + LedgerUpgradeType::BaseReserve, + LedgerUpgradeType::Flags, + LedgerUpgradeType::Config, + LedgerUpgradeType::MaxSorobanTxSetSize, + ]; + pub const VARIANTS_STR: [&'static str; 7] = [ + "Version", + "BaseFee", + "MaxTxSetSize", + "BaseReserve", + "Flags", + "Config", + "MaxSorobanTxSetSize", ]; - pub const VARIANTS_STR: [&'static str; 4] = - ["Liveentry", "Initentry", "Deadentry", "Metaentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Liveentry(_) => "Liveentry", - Self::Initentry(_) => "Initentry", - Self::Deadentry(_) => "Deadentry", - Self::Metaentry(_) => "Metaentry", + Self::Version(_) => "Version", + Self::BaseFee(_) => "BaseFee", + Self::MaxTxSetSize(_) => "MaxTxSetSize", + Self::BaseReserve(_) => "BaseReserve", + Self::Flags(_) => "Flags", + Self::Config(_) => "Config", + Self::MaxSorobanTxSetSize(_) => "MaxSorobanTxSetSize", } } #[must_use] - pub const fn discriminant(&self) -> BucketEntryType { + pub const fn discriminant(&self) -> LedgerUpgradeType { #[allow(clippy::match_same_arms)] match self { - Self::Liveentry(_) => BucketEntryType::Liveentry, - Self::Initentry(_) => BucketEntryType::Initentry, - Self::Deadentry(_) => BucketEntryType::Deadentry, - Self::Metaentry(_) => BucketEntryType::Metaentry, + Self::Version(_) => LedgerUpgradeType::Version, + Self::BaseFee(_) => LedgerUpgradeType::BaseFee, + Self::MaxTxSetSize(_) => LedgerUpgradeType::MaxTxSetSize, + Self::BaseReserve(_) => LedgerUpgradeType::BaseReserve, + Self::Flags(_) => LedgerUpgradeType::Flags, + Self::Config(_) => LedgerUpgradeType::Config, + Self::MaxSorobanTxSetSize(_) => LedgerUpgradeType::MaxSorobanTxSetSize, } } #[must_use] - pub const fn variants() -> [BucketEntryType; 4] { + pub const fn variants() -> [LedgerUpgradeType; 7] { Self::VARIANTS } } -impl Name for BucketEntry { +impl Name for LedgerUpgrade { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for BucketEntry { +impl Discriminant for LedgerUpgrade { #[must_use] - fn discriminant(&self) -> BucketEntryType { + fn discriminant(&self) -> LedgerUpgradeType { Self::discriminant(self) } } -impl Variants for BucketEntry { - fn variants() -> slice::Iter<'static, BucketEntryType> { +impl Variants for LedgerUpgrade { + fn variants() -> slice::Iter<'static, LedgerUpgradeType> { Self::VARIANTS.iter() } } -impl Union for BucketEntry {} +impl Union for LedgerUpgrade {} -impl ReadXdr for BucketEntry { +impl ReadXdr for LedgerUpgrade { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: BucketEntryType = ::read_xdr(r)?; + let dv: LedgerUpgradeType = ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - BucketEntryType::Liveentry => Self::Liveentry(LedgerEntry::read_xdr(r)?), - BucketEntryType::Initentry => Self::Initentry(LedgerEntry::read_xdr(r)?), - BucketEntryType::Deadentry => Self::Deadentry(LedgerKey::read_xdr(r)?), - BucketEntryType::Metaentry => Self::Metaentry(BucketMetadata::read_xdr(r)?), + LedgerUpgradeType::Version => Self::Version(u32::read_xdr(r)?), + LedgerUpgradeType::BaseFee => Self::BaseFee(u32::read_xdr(r)?), + LedgerUpgradeType::MaxTxSetSize => Self::MaxTxSetSize(u32::read_xdr(r)?), + LedgerUpgradeType::BaseReserve => Self::BaseReserve(u32::read_xdr(r)?), + LedgerUpgradeType::Flags => Self::Flags(u32::read_xdr(r)?), + LedgerUpgradeType::Config => Self::Config(ConfigUpgradeSetKey::read_xdr(r)?), + LedgerUpgradeType::MaxSorobanTxSetSize => { + Self::MaxSorobanTxSetSize(u32::read_xdr(r)?) + } #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -19422,40 +19976,34 @@ impl ReadXdr for BucketEntry { } } -impl WriteXdr for BucketEntry { +impl WriteXdr for LedgerUpgrade { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::Liveentry(v) => v.write_xdr(w)?, - Self::Initentry(v) => v.write_xdr(w)?, - Self::Deadentry(v) => v.write_xdr(w)?, - Self::Metaentry(v) => v.write_xdr(w)?, + Self::Version(v) => v.write_xdr(w)?, + Self::BaseFee(v) => v.write_xdr(w)?, + Self::MaxTxSetSize(v) => v.write_xdr(w)?, + Self::BaseReserve(v) => v.write_xdr(w)?, + Self::Flags(v) => v.write_xdr(w)?, + Self::Config(v) => v.write_xdr(w)?, + Self::MaxSorobanTxSetSize(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// HotArchiveBucketEntry is an XDR Union defines as: +/// ConfigUpgradeSet is an XDR Struct defines as: /// /// ```text -/// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) -/// { -/// case HOT_ARCHIVE_ARCHIVED: -/// LedgerEntry archivedEntry; -/// -/// case HOT_ARCHIVE_LIVE: -/// case HOT_ARCHIVE_DELETED: -/// LedgerKey key; -/// case HOT_ARCHIVE_METAENTRY: -/// BucketMetadata metaEntry; +/// struct ConfigUpgradeSet { +/// ConfigSettingEntry updatedEntry<>; /// }; /// ``` /// -// union with discriminant HotArchiveBucketEntryType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -19464,106 +20012,26 @@ impl WriteXdr for BucketEntry { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[allow(clippy::large_enum_variant)] -pub enum HotArchiveBucketEntry { - Archived(LedgerEntry), - Live(LedgerKey), - Deleted(LedgerKey), - Metaentry(BucketMetadata), -} - -impl HotArchiveBucketEntry { - pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ - HotArchiveBucketEntryType::Archived, - HotArchiveBucketEntryType::Live, - HotArchiveBucketEntryType::Deleted, - HotArchiveBucketEntryType::Metaentry, - ]; - pub const VARIANTS_STR: [&'static str; 4] = ["Archived", "Live", "Deleted", "Metaentry"]; - - #[must_use] - pub const fn name(&self) -> &'static str { - match self { - Self::Archived(_) => "Archived", - Self::Live(_) => "Live", - Self::Deleted(_) => "Deleted", - Self::Metaentry(_) => "Metaentry", - } - } - - #[must_use] - pub const fn discriminant(&self) -> HotArchiveBucketEntryType { - #[allow(clippy::match_same_arms)] - match self { - Self::Archived(_) => HotArchiveBucketEntryType::Archived, - Self::Live(_) => HotArchiveBucketEntryType::Live, - Self::Deleted(_) => HotArchiveBucketEntryType::Deleted, - Self::Metaentry(_) => HotArchiveBucketEntryType::Metaentry, - } - } - - #[must_use] - pub const fn variants() -> [HotArchiveBucketEntryType; 4] { - Self::VARIANTS - } -} - -impl Name for HotArchiveBucketEntry { - #[must_use] - fn name(&self) -> &'static str { - Self::name(self) - } -} - -impl Discriminant for HotArchiveBucketEntry { - #[must_use] - fn discriminant(&self) -> HotArchiveBucketEntryType { - Self::discriminant(self) - } -} - -impl Variants for HotArchiveBucketEntry { - fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { - Self::VARIANTS.iter() - } +pub struct ConfigUpgradeSet { + pub updated_entry: VecM, } -impl Union for HotArchiveBucketEntry {} - -impl ReadXdr for HotArchiveBucketEntry { +impl ReadXdr for ConfigUpgradeSet { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: HotArchiveBucketEntryType = - ::read_xdr(r)?; - #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] - let v = match dv { - HotArchiveBucketEntryType::Archived => Self::Archived(LedgerEntry::read_xdr(r)?), - HotArchiveBucketEntryType::Live => Self::Live(LedgerKey::read_xdr(r)?), - HotArchiveBucketEntryType::Deleted => Self::Deleted(LedgerKey::read_xdr(r)?), - HotArchiveBucketEntryType::Metaentry => { - Self::Metaentry(BucketMetadata::read_xdr(r)?) - } - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(v) + Ok(Self { + updated_entry: VecM::::read_xdr(r)?, + }) }) } } -impl WriteXdr for HotArchiveBucketEntry { +impl WriteXdr for ConfigUpgradeSet { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.discriminant().write_xdr(w)?; - #[allow(clippy::match_same_arms)] - match self { - Self::Archived(v) => v.write_xdr(w)?, - Self::Live(v) => v.write_xdr(w)?, - Self::Deleted(v) => v.write_xdr(w)?, - Self::Metaentry(v) => v.write_xdr(w)?, - }; + self.updated_entry.write_xdr(w)?; Ok(()) }) } @@ -31394,6 +31862,339 @@ impl WriteXdr for LedgerFootprint { } } +/// ArchivalProofType is an XDR Enum defines as: +/// +/// ```text +/// enum ArchivalProofType +/// { +/// EXISTENCE = 0, +/// NONEXISTENCE = 1 +/// }; +/// ``` +/// +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[repr(i32)] +pub enum ArchivalProofType { + Existence = 0, + Nonexistence = 1, +} + +impl ArchivalProofType { + pub const VARIANTS: [ArchivalProofType; 2] = [ + ArchivalProofType::Existence, + ArchivalProofType::Nonexistence, + ]; + pub const VARIANTS_STR: [&'static str; 2] = ["Existence", "Nonexistence"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Existence => "Existence", + Self::Nonexistence => "Nonexistence", + } + } + + #[must_use] + pub const fn variants() -> [ArchivalProofType; 2] { + Self::VARIANTS + } +} + +impl Name for ArchivalProofType { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Variants for ArchivalProofType { + fn variants() -> slice::Iter<'static, ArchivalProofType> { + Self::VARIANTS.iter() + } +} + +impl Enum for ArchivalProofType {} + +impl fmt::Display for ArchivalProofType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) + } +} + +impl TryFrom for ArchivalProofType { + type Error = Error; + + fn try_from(i: i32) -> Result { + let e = match i { + 0 => ArchivalProofType::Existence, + 1 => ArchivalProofType::Nonexistence, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) + } +} + +impl From for i32 { + #[must_use] + fn from(e: ArchivalProofType) -> Self { + e as Self + } +} + +impl ReadXdr for ArchivalProofType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) + }) + } +} + +impl WriteXdr for ArchivalProofType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + let i: i32 = (*self).into(); + i.write_xdr(w) + }) + } +} + +/// ArchivalProofNode is an XDR Struct defines as: +/// +/// ```text +/// struct ArchivalProofNode +/// { +/// uint32 index; +/// Hash hash; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ArchivalProofNode { + pub index: u32, + pub hash: Hash, +} + +impl ReadXdr for ArchivalProofNode { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + hash: Hash::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ArchivalProofNode { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.hash.write_xdr(w)?; + Ok(()) + }) + } +} + +/// ProofLevel is an XDR Typedef defines as: +/// +/// ```text +/// typedef ArchivalProofNode ProofLevel<>; +/// ``` +/// +#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[derive(Default)] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[derive(Debug)] +pub struct ProofLevel(pub VecM); + +impl From for VecM { + #[must_use] + fn from(x: ProofLevel) -> Self { + x.0 + } +} + +impl From> for ProofLevel { + #[must_use] + fn from(x: VecM) -> Self { + ProofLevel(x) + } +} + +impl AsRef> for ProofLevel { + #[must_use] + fn as_ref(&self) -> &VecM { + &self.0 + } +} + +impl ReadXdr for ProofLevel { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let i = VecM::::read_xdr(r)?; + let v = ProofLevel(i); + Ok(v) + }) + } +} + +impl WriteXdr for ProofLevel { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| self.0.write_xdr(w)) + } +} + +impl Deref for ProofLevel { + type Target = VecM; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From for Vec { + #[must_use] + fn from(x: ProofLevel) -> Self { + x.0 .0 + } +} + +impl TryFrom> for ProofLevel { + type Error = Error; + fn try_from(x: Vec) -> Result { + Ok(ProofLevel(x.try_into()?)) + } +} + +#[cfg(feature = "alloc")] +impl TryFrom<&Vec> for ProofLevel { + type Error = Error; + fn try_from(x: &Vec) -> Result { + Ok(ProofLevel(x.try_into()?)) + } +} + +impl AsRef> for ProofLevel { + #[must_use] + fn as_ref(&self) -> &Vec { + &self.0 .0 + } +} + +impl AsRef<[ArchivalProofNode]> for ProofLevel { + #[cfg(feature = "alloc")] + #[must_use] + fn as_ref(&self) -> &[ArchivalProofNode] { + &self.0 .0 + } + #[cfg(not(feature = "alloc"))] + #[must_use] + fn as_ref(&self) -> &[ArchivalProofNode] { + self.0 .0 + } +} + +/// ArchivalProof is an XDR Struct defines as: +/// +/// ```text +/// struct ArchivalProof +/// { +/// uint32 epoch; // AST Subtree for this proof +/// +/// union switch (ArchivalProofType t) +/// { +/// case EXISTENCE: +/// struct +/// { +/// ColdArchiveBucketEntry entriesToProve<>; +/// +/// // Vector of vectors, where proofLevels[level] +/// // contains all HashNodes that correspond with that level +/// ProofLevel proofLevels<>; +/// } existenceProof; +/// case NONEXISTENCE: +/// struct +/// { +/// LedgerKey keysToProve<>; +/// +/// // Bounds for each key being proved, where bound[n] +/// // corresponds to keysToProve[n] +/// ColdArchiveBucketEntry lowBoundEntries<>; +/// ColdArchiveBucketEntry highBoundEntries<>; +/// +/// // Vector of vectors, where proofLevels[level] +/// // contains all HashNodes that correspond with that level +/// ProofLevel proofLevels<>; +/// } nonexistenceProof; +/// } type; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ArchivalProof { + pub epoch: u32, + pub type_: ArchivalProofType, +} + +impl ReadXdr for ArchivalProof { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + epoch: u32::read_xdr(r)?, + type_: ArchivalProofType::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ArchivalProof { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.epoch.write_xdr(w)?; + self.type_.write_xdr(w)?; + Ok(()) + }) + } +} + /// SorobanResources is an XDR Struct defines as: /// /// ```text @@ -45234,6 +46035,19 @@ pub enum TypeVariant { LedgerKeyConfigSetting, LedgerKeyTtl, EnvelopeType, + BucketListType, + BucketEntryType, + HotArchiveBucketEntryType, + ColdArchiveBucketEntryType, + BucketMetadata, + BucketMetadataExt, + BucketEntry, + HotArchiveBucketEntry, + ColdArchiveArchivedLeaf, + ColdArchiveDeletedLeaf, + ColdArchiveBoundaryLeaf, + ColdArchiveHashEntry, + ColdArchiveBucketEntry, UpgradeType, StellarValueType, LedgerCloseValueSignature, @@ -45248,13 +46062,6 @@ pub enum TypeVariant { ConfigUpgradeSetKey, LedgerUpgrade, ConfigUpgradeSet, - BucketListType, - BucketEntryType, - HotArchiveBucketEntryType, - BucketMetadata, - BucketMetadataExt, - BucketEntry, - HotArchiveBucketEntry, TxSetComponentType, TxSetComponent, TxSetComponentTxsMaybeDiscountedFee, @@ -45403,6 +46210,12 @@ pub enum TypeVariant { PreconditionType, Preconditions, LedgerFootprint, + ArchivalProofType, + ArchivalProofNode, + ProofLevel, + ArchivalProof, + ArchivalProofExistenceProof, + ArchivalProofNonexistenceProof, SorobanResources, SorobanTransactionData, TransactionV0, @@ -45522,7 +46335,7 @@ pub enum TypeVariant { } impl TypeVariant { - pub const VARIANTS: [TypeVariant; 445] = [ + pub const VARIANTS: [TypeVariant; 457] = [ TypeVariant::Value, TypeVariant::ScpBallot, TypeVariant::ScpStatementType, @@ -45683,6 +46496,19 @@ impl TypeVariant { TypeVariant::LedgerKeyConfigSetting, TypeVariant::LedgerKeyTtl, TypeVariant::EnvelopeType, + TypeVariant::BucketListType, + TypeVariant::BucketEntryType, + TypeVariant::HotArchiveBucketEntryType, + TypeVariant::ColdArchiveBucketEntryType, + TypeVariant::BucketMetadata, + TypeVariant::BucketMetadataExt, + TypeVariant::BucketEntry, + TypeVariant::HotArchiveBucketEntry, + TypeVariant::ColdArchiveArchivedLeaf, + TypeVariant::ColdArchiveDeletedLeaf, + TypeVariant::ColdArchiveBoundaryLeaf, + TypeVariant::ColdArchiveHashEntry, + TypeVariant::ColdArchiveBucketEntry, TypeVariant::UpgradeType, TypeVariant::StellarValueType, TypeVariant::LedgerCloseValueSignature, @@ -45697,13 +46523,6 @@ impl TypeVariant { TypeVariant::ConfigUpgradeSetKey, TypeVariant::LedgerUpgrade, TypeVariant::ConfigUpgradeSet, - TypeVariant::BucketListType, - TypeVariant::BucketEntryType, - TypeVariant::HotArchiveBucketEntryType, - TypeVariant::BucketMetadata, - TypeVariant::BucketMetadataExt, - TypeVariant::BucketEntry, - TypeVariant::HotArchiveBucketEntry, TypeVariant::TxSetComponentType, TypeVariant::TxSetComponent, TypeVariant::TxSetComponentTxsMaybeDiscountedFee, @@ -45852,6 +46671,12 @@ impl TypeVariant { TypeVariant::PreconditionType, TypeVariant::Preconditions, TypeVariant::LedgerFootprint, + TypeVariant::ArchivalProofType, + TypeVariant::ArchivalProofNode, + TypeVariant::ProofLevel, + TypeVariant::ArchivalProof, + TypeVariant::ArchivalProofExistenceProof, + TypeVariant::ArchivalProofNonexistenceProof, TypeVariant::SorobanResources, TypeVariant::SorobanTransactionData, TypeVariant::TransactionV0, @@ -45969,7 +46794,7 @@ impl TypeVariant { TypeVariant::BinaryFuseFilterType, TypeVariant::SerializedBinaryFuseFilter, ]; - pub const VARIANTS_STR: [&'static str; 445] = [ + pub const VARIANTS_STR: [&'static str; 457] = [ "Value", "ScpBallot", "ScpStatementType", @@ -46130,6 +46955,19 @@ impl TypeVariant { "LedgerKeyConfigSetting", "LedgerKeyTtl", "EnvelopeType", + "BucketListType", + "BucketEntryType", + "HotArchiveBucketEntryType", + "ColdArchiveBucketEntryType", + "BucketMetadata", + "BucketMetadataExt", + "BucketEntry", + "HotArchiveBucketEntry", + "ColdArchiveArchivedLeaf", + "ColdArchiveDeletedLeaf", + "ColdArchiveBoundaryLeaf", + "ColdArchiveHashEntry", + "ColdArchiveBucketEntry", "UpgradeType", "StellarValueType", "LedgerCloseValueSignature", @@ -46144,13 +46982,6 @@ impl TypeVariant { "ConfigUpgradeSetKey", "LedgerUpgrade", "ConfigUpgradeSet", - "BucketListType", - "BucketEntryType", - "HotArchiveBucketEntryType", - "BucketMetadata", - "BucketMetadataExt", - "BucketEntry", - "HotArchiveBucketEntry", "TxSetComponentType", "TxSetComponent", "TxSetComponentTxsMaybeDiscountedFee", @@ -46299,6 +47130,12 @@ impl TypeVariant { "PreconditionType", "Preconditions", "LedgerFootprint", + "ArchivalProofType", + "ArchivalProofNode", + "ProofLevel", + "ArchivalProof", + "ArchivalProofExistenceProof", + "ArchivalProofNonexistenceProof", "SorobanResources", "SorobanTransactionData", "TransactionV0", @@ -46583,6 +47420,19 @@ impl TypeVariant { Self::LedgerKeyConfigSetting => "LedgerKeyConfigSetting", Self::LedgerKeyTtl => "LedgerKeyTtl", Self::EnvelopeType => "EnvelopeType", + Self::BucketListType => "BucketListType", + Self::BucketEntryType => "BucketEntryType", + Self::HotArchiveBucketEntryType => "HotArchiveBucketEntryType", + Self::ColdArchiveBucketEntryType => "ColdArchiveBucketEntryType", + Self::BucketMetadata => "BucketMetadata", + Self::BucketMetadataExt => "BucketMetadataExt", + Self::BucketEntry => "BucketEntry", + Self::HotArchiveBucketEntry => "HotArchiveBucketEntry", + Self::ColdArchiveArchivedLeaf => "ColdArchiveArchivedLeaf", + Self::ColdArchiveDeletedLeaf => "ColdArchiveDeletedLeaf", + Self::ColdArchiveBoundaryLeaf => "ColdArchiveBoundaryLeaf", + Self::ColdArchiveHashEntry => "ColdArchiveHashEntry", + Self::ColdArchiveBucketEntry => "ColdArchiveBucketEntry", Self::UpgradeType => "UpgradeType", Self::StellarValueType => "StellarValueType", Self::LedgerCloseValueSignature => "LedgerCloseValueSignature", @@ -46597,13 +47447,6 @@ impl TypeVariant { Self::ConfigUpgradeSetKey => "ConfigUpgradeSetKey", Self::LedgerUpgrade => "LedgerUpgrade", Self::ConfigUpgradeSet => "ConfigUpgradeSet", - Self::BucketListType => "BucketListType", - Self::BucketEntryType => "BucketEntryType", - Self::HotArchiveBucketEntryType => "HotArchiveBucketEntryType", - Self::BucketMetadata => "BucketMetadata", - Self::BucketMetadataExt => "BucketMetadataExt", - Self::BucketEntry => "BucketEntry", - Self::HotArchiveBucketEntry => "HotArchiveBucketEntry", Self::TxSetComponentType => "TxSetComponentType", Self::TxSetComponent => "TxSetComponent", Self::TxSetComponentTxsMaybeDiscountedFee => "TxSetComponentTxsMaybeDiscountedFee", @@ -46758,6 +47601,12 @@ impl TypeVariant { Self::PreconditionType => "PreconditionType", Self::Preconditions => "Preconditions", Self::LedgerFootprint => "LedgerFootprint", + Self::ArchivalProofType => "ArchivalProofType", + Self::ArchivalProofNode => "ArchivalProofNode", + Self::ProofLevel => "ProofLevel", + Self::ArchivalProof => "ArchivalProof", + Self::ArchivalProofExistenceProof => "ArchivalProofExistenceProof", + Self::ArchivalProofNonexistenceProof => "ArchivalProofNonexistenceProof", Self::SorobanResources => "SorobanResources", Self::SorobanTransactionData => "SorobanTransactionData", Self::TransactionV0 => "TransactionV0", @@ -46883,7 +47732,7 @@ impl TypeVariant { #[must_use] #[allow(clippy::too_many_lines)] - pub const fn variants() -> [TypeVariant; 445] { + pub const fn variants() -> [TypeVariant; 457] { Self::VARIANTS } @@ -47096,6 +47945,23 @@ impl TypeVariant { Self::LedgerKeyConfigSetting => gen.into_root_schema_for::(), Self::LedgerKeyTtl => gen.into_root_schema_for::(), Self::EnvelopeType => gen.into_root_schema_for::(), + Self::BucketListType => gen.into_root_schema_for::(), + Self::BucketEntryType => gen.into_root_schema_for::(), + Self::HotArchiveBucketEntryType => { + gen.into_root_schema_for::() + } + Self::ColdArchiveBucketEntryType => { + gen.into_root_schema_for::() + } + Self::BucketMetadata => gen.into_root_schema_for::(), + Self::BucketMetadataExt => gen.into_root_schema_for::(), + Self::BucketEntry => gen.into_root_schema_for::(), + Self::HotArchiveBucketEntry => gen.into_root_schema_for::(), + Self::ColdArchiveArchivedLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveDeletedLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveBoundaryLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveHashEntry => gen.into_root_schema_for::(), + Self::ColdArchiveBucketEntry => gen.into_root_schema_for::(), Self::UpgradeType => gen.into_root_schema_for::(), Self::StellarValueType => gen.into_root_schema_for::(), Self::LedgerCloseValueSignature => { @@ -47114,15 +47980,6 @@ impl TypeVariant { Self::ConfigUpgradeSetKey => gen.into_root_schema_for::(), Self::LedgerUpgrade => gen.into_root_schema_for::(), Self::ConfigUpgradeSet => gen.into_root_schema_for::(), - Self::BucketListType => gen.into_root_schema_for::(), - Self::BucketEntryType => gen.into_root_schema_for::(), - Self::HotArchiveBucketEntryType => { - gen.into_root_schema_for::() - } - Self::BucketMetadata => gen.into_root_schema_for::(), - Self::BucketMetadataExt => gen.into_root_schema_for::(), - Self::BucketEntry => gen.into_root_schema_for::(), - Self::HotArchiveBucketEntry => gen.into_root_schema_for::(), Self::TxSetComponentType => gen.into_root_schema_for::(), Self::TxSetComponent => gen.into_root_schema_for::(), Self::TxSetComponentTxsMaybeDiscountedFee => { @@ -47345,6 +48202,16 @@ impl TypeVariant { Self::PreconditionType => gen.into_root_schema_for::(), Self::Preconditions => gen.into_root_schema_for::(), Self::LedgerFootprint => gen.into_root_schema_for::(), + Self::ArchivalProofType => gen.into_root_schema_for::(), + Self::ArchivalProofNode => gen.into_root_schema_for::(), + Self::ProofLevel => gen.into_root_schema_for::(), + Self::ArchivalProof => gen.into_root_schema_for::(), + Self::ArchivalProofExistenceProof => { + gen.into_root_schema_for::() + } + Self::ArchivalProofNonexistenceProof => { + gen.into_root_schema_for::() + } Self::SorobanResources => gen.into_root_schema_for::(), Self::SorobanTransactionData => gen.into_root_schema_for::(), Self::TransactionV0 => gen.into_root_schema_for::(), @@ -47729,6 +48596,19 @@ impl core::str::FromStr for TypeVariant { "LedgerKeyConfigSetting" => Ok(Self::LedgerKeyConfigSetting), "LedgerKeyTtl" => Ok(Self::LedgerKeyTtl), "EnvelopeType" => Ok(Self::EnvelopeType), + "BucketListType" => Ok(Self::BucketListType), + "BucketEntryType" => Ok(Self::BucketEntryType), + "HotArchiveBucketEntryType" => Ok(Self::HotArchiveBucketEntryType), + "ColdArchiveBucketEntryType" => Ok(Self::ColdArchiveBucketEntryType), + "BucketMetadata" => Ok(Self::BucketMetadata), + "BucketMetadataExt" => Ok(Self::BucketMetadataExt), + "BucketEntry" => Ok(Self::BucketEntry), + "HotArchiveBucketEntry" => Ok(Self::HotArchiveBucketEntry), + "ColdArchiveArchivedLeaf" => Ok(Self::ColdArchiveArchivedLeaf), + "ColdArchiveDeletedLeaf" => Ok(Self::ColdArchiveDeletedLeaf), + "ColdArchiveBoundaryLeaf" => Ok(Self::ColdArchiveBoundaryLeaf), + "ColdArchiveHashEntry" => Ok(Self::ColdArchiveHashEntry), + "ColdArchiveBucketEntry" => Ok(Self::ColdArchiveBucketEntry), "UpgradeType" => Ok(Self::UpgradeType), "StellarValueType" => Ok(Self::StellarValueType), "LedgerCloseValueSignature" => Ok(Self::LedgerCloseValueSignature), @@ -47743,13 +48623,6 @@ impl core::str::FromStr for TypeVariant { "ConfigUpgradeSetKey" => Ok(Self::ConfigUpgradeSetKey), "LedgerUpgrade" => Ok(Self::LedgerUpgrade), "ConfigUpgradeSet" => Ok(Self::ConfigUpgradeSet), - "BucketListType" => Ok(Self::BucketListType), - "BucketEntryType" => Ok(Self::BucketEntryType), - "HotArchiveBucketEntryType" => Ok(Self::HotArchiveBucketEntryType), - "BucketMetadata" => Ok(Self::BucketMetadata), - "BucketMetadataExt" => Ok(Self::BucketMetadataExt), - "BucketEntry" => Ok(Self::BucketEntry), - "HotArchiveBucketEntry" => Ok(Self::HotArchiveBucketEntry), "TxSetComponentType" => Ok(Self::TxSetComponentType), "TxSetComponent" => Ok(Self::TxSetComponent), "TxSetComponentTxsMaybeDiscountedFee" => Ok(Self::TxSetComponentTxsMaybeDiscountedFee), @@ -47910,6 +48783,12 @@ impl core::str::FromStr for TypeVariant { "PreconditionType" => Ok(Self::PreconditionType), "Preconditions" => Ok(Self::Preconditions), "LedgerFootprint" => Ok(Self::LedgerFootprint), + "ArchivalProofType" => Ok(Self::ArchivalProofType), + "ArchivalProofNode" => Ok(Self::ArchivalProofNode), + "ProofLevel" => Ok(Self::ProofLevel), + "ArchivalProof" => Ok(Self::ArchivalProof), + "ArchivalProofExistenceProof" => Ok(Self::ArchivalProofExistenceProof), + "ArchivalProofNonexistenceProof" => Ok(Self::ArchivalProofNonexistenceProof), "SorobanResources" => Ok(Self::SorobanResources), "SorobanTransactionData" => Ok(Self::SorobanTransactionData), "TransactionV0" => Ok(Self::TransactionV0), @@ -48208,6 +49087,19 @@ pub enum Type { LedgerKeyConfigSetting(Box), LedgerKeyTtl(Box), EnvelopeType(Box), + BucketListType(Box), + BucketEntryType(Box), + HotArchiveBucketEntryType(Box), + ColdArchiveBucketEntryType(Box), + BucketMetadata(Box), + BucketMetadataExt(Box), + BucketEntry(Box), + HotArchiveBucketEntry(Box), + ColdArchiveArchivedLeaf(Box), + ColdArchiveDeletedLeaf(Box), + ColdArchiveBoundaryLeaf(Box), + ColdArchiveHashEntry(Box), + ColdArchiveBucketEntry(Box), UpgradeType(Box), StellarValueType(Box), LedgerCloseValueSignature(Box), @@ -48222,13 +49114,6 @@ pub enum Type { ConfigUpgradeSetKey(Box), LedgerUpgrade(Box), ConfigUpgradeSet(Box), - BucketListType(Box), - BucketEntryType(Box), - HotArchiveBucketEntryType(Box), - BucketMetadata(Box), - BucketMetadataExt(Box), - BucketEntry(Box), - HotArchiveBucketEntry(Box), TxSetComponentType(Box), TxSetComponent(Box), TxSetComponentTxsMaybeDiscountedFee(Box), @@ -48377,6 +49262,12 @@ pub enum Type { PreconditionType(Box), Preconditions(Box), LedgerFootprint(Box), + ArchivalProofType(Box), + ArchivalProofNode(Box), + ProofLevel(Box), + ArchivalProof(Box), + ArchivalProofExistenceProof(Box), + ArchivalProofNonexistenceProof(Box), SorobanResources(Box), SorobanTransactionData(Box), TransactionV0(Box), @@ -48496,7 +49387,7 @@ pub enum Type { } impl Type { - pub const VARIANTS: [TypeVariant; 445] = [ + pub const VARIANTS: [TypeVariant; 457] = [ TypeVariant::Value, TypeVariant::ScpBallot, TypeVariant::ScpStatementType, @@ -48657,6 +49548,19 @@ impl Type { TypeVariant::LedgerKeyConfigSetting, TypeVariant::LedgerKeyTtl, TypeVariant::EnvelopeType, + TypeVariant::BucketListType, + TypeVariant::BucketEntryType, + TypeVariant::HotArchiveBucketEntryType, + TypeVariant::ColdArchiveBucketEntryType, + TypeVariant::BucketMetadata, + TypeVariant::BucketMetadataExt, + TypeVariant::BucketEntry, + TypeVariant::HotArchiveBucketEntry, + TypeVariant::ColdArchiveArchivedLeaf, + TypeVariant::ColdArchiveDeletedLeaf, + TypeVariant::ColdArchiveBoundaryLeaf, + TypeVariant::ColdArchiveHashEntry, + TypeVariant::ColdArchiveBucketEntry, TypeVariant::UpgradeType, TypeVariant::StellarValueType, TypeVariant::LedgerCloseValueSignature, @@ -48671,13 +49575,6 @@ impl Type { TypeVariant::ConfigUpgradeSetKey, TypeVariant::LedgerUpgrade, TypeVariant::ConfigUpgradeSet, - TypeVariant::BucketListType, - TypeVariant::BucketEntryType, - TypeVariant::HotArchiveBucketEntryType, - TypeVariant::BucketMetadata, - TypeVariant::BucketMetadataExt, - TypeVariant::BucketEntry, - TypeVariant::HotArchiveBucketEntry, TypeVariant::TxSetComponentType, TypeVariant::TxSetComponent, TypeVariant::TxSetComponentTxsMaybeDiscountedFee, @@ -48826,6 +49723,12 @@ impl Type { TypeVariant::PreconditionType, TypeVariant::Preconditions, TypeVariant::LedgerFootprint, + TypeVariant::ArchivalProofType, + TypeVariant::ArchivalProofNode, + TypeVariant::ProofLevel, + TypeVariant::ArchivalProof, + TypeVariant::ArchivalProofExistenceProof, + TypeVariant::ArchivalProofNonexistenceProof, TypeVariant::SorobanResources, TypeVariant::SorobanTransactionData, TypeVariant::TransactionV0, @@ -48943,7 +49846,7 @@ impl Type { TypeVariant::BinaryFuseFilterType, TypeVariant::SerializedBinaryFuseFilter, ]; - pub const VARIANTS_STR: [&'static str; 445] = [ + pub const VARIANTS_STR: [&'static str; 457] = [ "Value", "ScpBallot", "ScpStatementType", @@ -49104,6 +50007,19 @@ impl Type { "LedgerKeyConfigSetting", "LedgerKeyTtl", "EnvelopeType", + "BucketListType", + "BucketEntryType", + "HotArchiveBucketEntryType", + "ColdArchiveBucketEntryType", + "BucketMetadata", + "BucketMetadataExt", + "BucketEntry", + "HotArchiveBucketEntry", + "ColdArchiveArchivedLeaf", + "ColdArchiveDeletedLeaf", + "ColdArchiveBoundaryLeaf", + "ColdArchiveHashEntry", + "ColdArchiveBucketEntry", "UpgradeType", "StellarValueType", "LedgerCloseValueSignature", @@ -49118,13 +50034,6 @@ impl Type { "ConfigUpgradeSetKey", "LedgerUpgrade", "ConfigUpgradeSet", - "BucketListType", - "BucketEntryType", - "HotArchiveBucketEntryType", - "BucketMetadata", - "BucketMetadataExt", - "BucketEntry", - "HotArchiveBucketEntry", "TxSetComponentType", "TxSetComponent", "TxSetComponentTxsMaybeDiscountedFee", @@ -49273,6 +50182,12 @@ impl Type { "PreconditionType", "Preconditions", "LedgerFootprint", + "ArchivalProofType", + "ArchivalProofNode", + "ProofLevel", + "ArchivalProof", + "ArchivalProofExistenceProof", + "ArchivalProofNonexistenceProof", "SorobanResources", "SorobanTransactionData", "TransactionV0", @@ -50051,6 +50966,65 @@ impl Type { TypeVariant::EnvelopeType => r.with_limited_depth(|r| { Ok(Self::EnvelopeType(Box::new(EnvelopeType::read_xdr(r)?))) }), + TypeVariant::BucketListType => r.with_limited_depth(|r| { + Ok(Self::BucketListType(Box::new(BucketListType::read_xdr(r)?))) + }), + TypeVariant::BucketEntryType => r.with_limited_depth(|r| { + Ok(Self::BucketEntryType(Box::new(BucketEntryType::read_xdr( + r, + )?))) + }), + TypeVariant::HotArchiveBucketEntryType => r.with_limited_depth(|r| { + Ok(Self::HotArchiveBucketEntryType(Box::new( + HotArchiveBucketEntryType::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBucketEntryType => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBucketEntryType(Box::new( + ColdArchiveBucketEntryType::read_xdr(r)?, + ))) + }), + TypeVariant::BucketMetadata => r.with_limited_depth(|r| { + Ok(Self::BucketMetadata(Box::new(BucketMetadata::read_xdr(r)?))) + }), + TypeVariant::BucketMetadataExt => r.with_limited_depth(|r| { + Ok(Self::BucketMetadataExt(Box::new( + BucketMetadataExt::read_xdr(r)?, + ))) + }), + TypeVariant::BucketEntry => { + r.with_limited_depth(|r| Ok(Self::BucketEntry(Box::new(BucketEntry::read_xdr(r)?)))) + } + TypeVariant::HotArchiveBucketEntry => r.with_limited_depth(|r| { + Ok(Self::HotArchiveBucketEntry(Box::new( + HotArchiveBucketEntry::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveArchivedLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveArchivedLeaf(Box::new( + ColdArchiveArchivedLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveDeletedLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveDeletedLeaf(Box::new( + ColdArchiveDeletedLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBoundaryLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBoundaryLeaf(Box::new( + ColdArchiveBoundaryLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveHashEntry => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveHashEntry(Box::new( + ColdArchiveHashEntry::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBucketEntry => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBucketEntry(Box::new( + ColdArchiveBucketEntry::read_xdr(r)?, + ))) + }), TypeVariant::UpgradeType => { r.with_limited_depth(|r| Ok(Self::UpgradeType(Box::new(UpgradeType::read_xdr(r)?)))) } @@ -50113,35 +51087,6 @@ impl Type { ConfigUpgradeSet::read_xdr(r)?, ))) }), - TypeVariant::BucketListType => r.with_limited_depth(|r| { - Ok(Self::BucketListType(Box::new(BucketListType::read_xdr(r)?))) - }), - TypeVariant::BucketEntryType => r.with_limited_depth(|r| { - Ok(Self::BucketEntryType(Box::new(BucketEntryType::read_xdr( - r, - )?))) - }), - TypeVariant::HotArchiveBucketEntryType => r.with_limited_depth(|r| { - Ok(Self::HotArchiveBucketEntryType(Box::new( - HotArchiveBucketEntryType::read_xdr(r)?, - ))) - }), - TypeVariant::BucketMetadata => r.with_limited_depth(|r| { - Ok(Self::BucketMetadata(Box::new(BucketMetadata::read_xdr(r)?))) - }), - TypeVariant::BucketMetadataExt => r.with_limited_depth(|r| { - Ok(Self::BucketMetadataExt(Box::new( - BucketMetadataExt::read_xdr(r)?, - ))) - }), - TypeVariant::BucketEntry => { - r.with_limited_depth(|r| Ok(Self::BucketEntry(Box::new(BucketEntry::read_xdr(r)?)))) - } - TypeVariant::HotArchiveBucketEntry => r.with_limited_depth(|r| { - Ok(Self::HotArchiveBucketEntry(Box::new( - HotArchiveBucketEntry::read_xdr(r)?, - ))) - }), TypeVariant::TxSetComponentType => r.with_limited_depth(|r| { Ok(Self::TxSetComponentType(Box::new( TxSetComponentType::read_xdr(r)?, @@ -50802,6 +51747,32 @@ impl Type { r, )?))) }), + TypeVariant::ArchivalProofType => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofType(Box::new( + ArchivalProofType::read_xdr(r)?, + ))) + }), + TypeVariant::ArchivalProofNode => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofNode(Box::new( + ArchivalProofNode::read_xdr(r)?, + ))) + }), + TypeVariant::ProofLevel => { + r.with_limited_depth(|r| Ok(Self::ProofLevel(Box::new(ProofLevel::read_xdr(r)?)))) + } + TypeVariant::ArchivalProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProof(Box::new(ArchivalProof::read_xdr(r)?))) + }), + TypeVariant::ArchivalProofExistenceProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofExistenceProof(Box::new( + ArchivalProofExistenceProof::read_xdr(r)?, + ))) + }), + TypeVariant::ArchivalProofNonexistenceProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofNonexistenceProof(Box::new( + ArchivalProofNonexistenceProof::read_xdr(r)?, + ))) + }), TypeVariant::SorobanResources => r.with_limited_depth(|r| { Ok(Self::SorobanResources(Box::new( SorobanResources::read_xdr(r)?, @@ -52038,6 +53009,58 @@ impl Type { ReadXdrIter::<_, EnvelopeType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, BucketListType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, BucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, BucketMetadata>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, BucketMetadataExt>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, BucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveArchivedLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveDeletedLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveBoundaryLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, ColdArchiveHashEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, UpgradeType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t)))), @@ -52094,34 +53117,6 @@ impl Type { ReadXdrIter::<_, ConfigUpgradeSet>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, BucketListType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, BucketEntryType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, BucketMetadata>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, BucketMetadataExt>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, BucketEntry>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, TxSetComponentType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t)))), @@ -52764,6 +53759,33 @@ impl Type { ReadXdrIter::<_, LedgerFootprint>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, ArchivalProofType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, ArchivalProofNode>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, ProofLevel>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, ArchivalProof>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofExistenceProof>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofNonexistenceProof>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, SorobanResources>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t)))), @@ -54042,6 +55064,76 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t.0)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t.0)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t.0)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t.0)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t.0)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t.0)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t.0)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t.0)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t.0)))), @@ -54107,37 +55199,6 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t.0)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t.0)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t.0)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, Frame>::new( - &mut r.inner, - r.limits.clone(), - ) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t.0)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t.0)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t.0)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t.0)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t.0)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t.0)))), @@ -54890,6 +55951,36 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t.0)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t.0)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t.0)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t.0)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t.0)))), @@ -56157,6 +57248,58 @@ impl Type { ReadXdrIter::<_, EnvelopeType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, BucketListType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, BucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, BucketMetadata>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, BucketMetadataExt>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, BucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveArchivedLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveDeletedLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveBoundaryLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, ColdArchiveHashEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, UpgradeType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t)))), @@ -56213,34 +57356,6 @@ impl Type { ReadXdrIter::<_, ConfigUpgradeSet>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, BucketListType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, BucketEntryType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntryType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, BucketMetadata>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, BucketMetadataExt>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, BucketEntry>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntry>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, TxSetComponentType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t)))), @@ -56844,6 +57959,30 @@ impl Type { ReadXdrIter::<_, LedgerFootprint>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, ArchivalProofType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, ArchivalProofNode>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, ProofLevel>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, ArchivalProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofExistenceProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofNonexistenceProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, SorobanResources>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t)))), @@ -57751,6 +58890,45 @@ impl Type { TypeVariant::EnvelopeType => { Ok(Self::EnvelopeType(Box::new(serde_json::from_reader(r)?))) } + TypeVariant::BucketListType => { + Ok(Self::BucketListType(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::BucketEntryType => { + Ok(Self::BucketEntryType(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::HotArchiveBucketEntryType => Ok(Self::HotArchiveBucketEntryType( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::ColdArchiveBucketEntryType => Ok(Self::ColdArchiveBucketEntryType( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::BucketMetadata => { + Ok(Self::BucketMetadata(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::BucketMetadataExt => Ok(Self::BucketMetadataExt(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::BucketEntry => { + Ok(Self::BucketEntry(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::HotArchiveBucketEntry => Ok(Self::HotArchiveBucketEntry(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveArchivedLeaf => Ok(Self::ColdArchiveArchivedLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveDeletedLeaf => Ok(Self::ColdArchiveDeletedLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveBoundaryLeaf => Ok(Self::ColdArchiveBoundaryLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveHashEntry => Ok(Self::ColdArchiveHashEntry(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveBucketEntry => Ok(Self::ColdArchiveBucketEntry(Box::new( + serde_json::from_reader(r)?, + ))), TypeVariant::UpgradeType => { Ok(Self::UpgradeType(Box::new(serde_json::from_reader(r)?))) } @@ -57793,27 +58971,6 @@ impl Type { TypeVariant::ConfigUpgradeSet => Ok(Self::ConfigUpgradeSet(Box::new( serde_json::from_reader(r)?, ))), - TypeVariant::BucketListType => { - Ok(Self::BucketListType(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::BucketEntryType => { - Ok(Self::BucketEntryType(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::HotArchiveBucketEntryType => Ok(Self::HotArchiveBucketEntryType( - Box::new(serde_json::from_reader(r)?), - )), - TypeVariant::BucketMetadata => { - Ok(Self::BucketMetadata(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::BucketMetadataExt => Ok(Self::BucketMetadataExt(Box::new( - serde_json::from_reader(r)?, - ))), - TypeVariant::BucketEntry => { - Ok(Self::BucketEntry(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::HotArchiveBucketEntry => Ok(Self::HotArchiveBucketEntry(Box::new( - serde_json::from_reader(r)?, - ))), TypeVariant::TxSetComponentType => Ok(Self::TxSetComponentType(Box::new( serde_json::from_reader(r)?, ))), @@ -58232,6 +59389,22 @@ impl Type { TypeVariant::LedgerFootprint => { Ok(Self::LedgerFootprint(Box::new(serde_json::from_reader(r)?))) } + TypeVariant::ArchivalProofType => Ok(Self::ArchivalProofType(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ArchivalProofNode => Ok(Self::ArchivalProofNode(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ProofLevel => Ok(Self::ProofLevel(Box::new(serde_json::from_reader(r)?))), + TypeVariant::ArchivalProof => { + Ok(Self::ArchivalProof(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::ArchivalProofExistenceProof => Ok(Self::ArchivalProofExistenceProof( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::ArchivalProofNonexistenceProof => Ok( + Self::ArchivalProofNonexistenceProof(Box::new(serde_json::from_reader(r)?)), + ), TypeVariant::SorobanResources => Ok(Self::SorobanResources(Box::new( serde_json::from_reader(r)?, ))), @@ -58725,6 +59898,19 @@ impl Type { Self::LedgerKeyConfigSetting(ref v) => v.as_ref(), Self::LedgerKeyTtl(ref v) => v.as_ref(), Self::EnvelopeType(ref v) => v.as_ref(), + Self::BucketListType(ref v) => v.as_ref(), + Self::BucketEntryType(ref v) => v.as_ref(), + Self::HotArchiveBucketEntryType(ref v) => v.as_ref(), + Self::ColdArchiveBucketEntryType(ref v) => v.as_ref(), + Self::BucketMetadata(ref v) => v.as_ref(), + Self::BucketMetadataExt(ref v) => v.as_ref(), + Self::BucketEntry(ref v) => v.as_ref(), + Self::HotArchiveBucketEntry(ref v) => v.as_ref(), + Self::ColdArchiveArchivedLeaf(ref v) => v.as_ref(), + Self::ColdArchiveDeletedLeaf(ref v) => v.as_ref(), + Self::ColdArchiveBoundaryLeaf(ref v) => v.as_ref(), + Self::ColdArchiveHashEntry(ref v) => v.as_ref(), + Self::ColdArchiveBucketEntry(ref v) => v.as_ref(), Self::UpgradeType(ref v) => v.as_ref(), Self::StellarValueType(ref v) => v.as_ref(), Self::LedgerCloseValueSignature(ref v) => v.as_ref(), @@ -58739,13 +59925,6 @@ impl Type { Self::ConfigUpgradeSetKey(ref v) => v.as_ref(), Self::LedgerUpgrade(ref v) => v.as_ref(), Self::ConfigUpgradeSet(ref v) => v.as_ref(), - Self::BucketListType(ref v) => v.as_ref(), - Self::BucketEntryType(ref v) => v.as_ref(), - Self::HotArchiveBucketEntryType(ref v) => v.as_ref(), - Self::BucketMetadata(ref v) => v.as_ref(), - Self::BucketMetadataExt(ref v) => v.as_ref(), - Self::BucketEntry(ref v) => v.as_ref(), - Self::HotArchiveBucketEntry(ref v) => v.as_ref(), Self::TxSetComponentType(ref v) => v.as_ref(), Self::TxSetComponent(ref v) => v.as_ref(), Self::TxSetComponentTxsMaybeDiscountedFee(ref v) => v.as_ref(), @@ -58894,6 +60073,12 @@ impl Type { Self::PreconditionType(ref v) => v.as_ref(), Self::Preconditions(ref v) => v.as_ref(), Self::LedgerFootprint(ref v) => v.as_ref(), + Self::ArchivalProofType(ref v) => v.as_ref(), + Self::ArchivalProofNode(ref v) => v.as_ref(), + Self::ProofLevel(ref v) => v.as_ref(), + Self::ArchivalProof(ref v) => v.as_ref(), + Self::ArchivalProofExistenceProof(ref v) => v.as_ref(), + Self::ArchivalProofNonexistenceProof(ref v) => v.as_ref(), Self::SorobanResources(ref v) => v.as_ref(), Self::SorobanTransactionData(ref v) => v.as_ref(), Self::TransactionV0(ref v) => v.as_ref(), @@ -59183,6 +60368,19 @@ impl Type { Self::LedgerKeyConfigSetting(_) => "LedgerKeyConfigSetting", Self::LedgerKeyTtl(_) => "LedgerKeyTtl", Self::EnvelopeType(_) => "EnvelopeType", + Self::BucketListType(_) => "BucketListType", + Self::BucketEntryType(_) => "BucketEntryType", + Self::HotArchiveBucketEntryType(_) => "HotArchiveBucketEntryType", + Self::ColdArchiveBucketEntryType(_) => "ColdArchiveBucketEntryType", + Self::BucketMetadata(_) => "BucketMetadata", + Self::BucketMetadataExt(_) => "BucketMetadataExt", + Self::BucketEntry(_) => "BucketEntry", + Self::HotArchiveBucketEntry(_) => "HotArchiveBucketEntry", + Self::ColdArchiveArchivedLeaf(_) => "ColdArchiveArchivedLeaf", + Self::ColdArchiveDeletedLeaf(_) => "ColdArchiveDeletedLeaf", + Self::ColdArchiveBoundaryLeaf(_) => "ColdArchiveBoundaryLeaf", + Self::ColdArchiveHashEntry(_) => "ColdArchiveHashEntry", + Self::ColdArchiveBucketEntry(_) => "ColdArchiveBucketEntry", Self::UpgradeType(_) => "UpgradeType", Self::StellarValueType(_) => "StellarValueType", Self::LedgerCloseValueSignature(_) => "LedgerCloseValueSignature", @@ -59197,13 +60395,6 @@ impl Type { Self::ConfigUpgradeSetKey(_) => "ConfigUpgradeSetKey", Self::LedgerUpgrade(_) => "LedgerUpgrade", Self::ConfigUpgradeSet(_) => "ConfigUpgradeSet", - Self::BucketListType(_) => "BucketListType", - Self::BucketEntryType(_) => "BucketEntryType", - Self::HotArchiveBucketEntryType(_) => "HotArchiveBucketEntryType", - Self::BucketMetadata(_) => "BucketMetadata", - Self::BucketMetadataExt(_) => "BucketMetadataExt", - Self::BucketEntry(_) => "BucketEntry", - Self::HotArchiveBucketEntry(_) => "HotArchiveBucketEntry", Self::TxSetComponentType(_) => "TxSetComponentType", Self::TxSetComponent(_) => "TxSetComponent", Self::TxSetComponentTxsMaybeDiscountedFee(_) => "TxSetComponentTxsMaybeDiscountedFee", @@ -59362,6 +60553,12 @@ impl Type { Self::PreconditionType(_) => "PreconditionType", Self::Preconditions(_) => "Preconditions", Self::LedgerFootprint(_) => "LedgerFootprint", + Self::ArchivalProofType(_) => "ArchivalProofType", + Self::ArchivalProofNode(_) => "ArchivalProofNode", + Self::ProofLevel(_) => "ProofLevel", + Self::ArchivalProof(_) => "ArchivalProof", + Self::ArchivalProofExistenceProof(_) => "ArchivalProofExistenceProof", + Self::ArchivalProofNonexistenceProof(_) => "ArchivalProofNonexistenceProof", Self::SorobanResources(_) => "SorobanResources", Self::SorobanTransactionData(_) => "SorobanTransactionData", Self::TransactionV0(_) => "TransactionV0", @@ -59491,7 +60688,7 @@ impl Type { #[must_use] #[allow(clippy::too_many_lines)] - pub const fn variants() -> [TypeVariant; 445] { + pub const fn variants() -> [TypeVariant; 457] { Self::VARIANTS } @@ -59675,6 +60872,19 @@ impl Type { Self::LedgerKeyConfigSetting(_) => TypeVariant::LedgerKeyConfigSetting, Self::LedgerKeyTtl(_) => TypeVariant::LedgerKeyTtl, Self::EnvelopeType(_) => TypeVariant::EnvelopeType, + Self::BucketListType(_) => TypeVariant::BucketListType, + Self::BucketEntryType(_) => TypeVariant::BucketEntryType, + Self::HotArchiveBucketEntryType(_) => TypeVariant::HotArchiveBucketEntryType, + Self::ColdArchiveBucketEntryType(_) => TypeVariant::ColdArchiveBucketEntryType, + Self::BucketMetadata(_) => TypeVariant::BucketMetadata, + Self::BucketMetadataExt(_) => TypeVariant::BucketMetadataExt, + Self::BucketEntry(_) => TypeVariant::BucketEntry, + Self::HotArchiveBucketEntry(_) => TypeVariant::HotArchiveBucketEntry, + Self::ColdArchiveArchivedLeaf(_) => TypeVariant::ColdArchiveArchivedLeaf, + Self::ColdArchiveDeletedLeaf(_) => TypeVariant::ColdArchiveDeletedLeaf, + Self::ColdArchiveBoundaryLeaf(_) => TypeVariant::ColdArchiveBoundaryLeaf, + Self::ColdArchiveHashEntry(_) => TypeVariant::ColdArchiveHashEntry, + Self::ColdArchiveBucketEntry(_) => TypeVariant::ColdArchiveBucketEntry, Self::UpgradeType(_) => TypeVariant::UpgradeType, Self::StellarValueType(_) => TypeVariant::StellarValueType, Self::LedgerCloseValueSignature(_) => TypeVariant::LedgerCloseValueSignature, @@ -59689,13 +60899,6 @@ impl Type { Self::ConfigUpgradeSetKey(_) => TypeVariant::ConfigUpgradeSetKey, Self::LedgerUpgrade(_) => TypeVariant::LedgerUpgrade, Self::ConfigUpgradeSet(_) => TypeVariant::ConfigUpgradeSet, - Self::BucketListType(_) => TypeVariant::BucketListType, - Self::BucketEntryType(_) => TypeVariant::BucketEntryType, - Self::HotArchiveBucketEntryType(_) => TypeVariant::HotArchiveBucketEntryType, - Self::BucketMetadata(_) => TypeVariant::BucketMetadata, - Self::BucketMetadataExt(_) => TypeVariant::BucketMetadataExt, - Self::BucketEntry(_) => TypeVariant::BucketEntry, - Self::HotArchiveBucketEntry(_) => TypeVariant::HotArchiveBucketEntry, Self::TxSetComponentType(_) => TypeVariant::TxSetComponentType, Self::TxSetComponent(_) => TypeVariant::TxSetComponent, Self::TxSetComponentTxsMaybeDiscountedFee(_) => { @@ -59868,6 +61071,12 @@ impl Type { Self::PreconditionType(_) => TypeVariant::PreconditionType, Self::Preconditions(_) => TypeVariant::Preconditions, Self::LedgerFootprint(_) => TypeVariant::LedgerFootprint, + Self::ArchivalProofType(_) => TypeVariant::ArchivalProofType, + Self::ArchivalProofNode(_) => TypeVariant::ArchivalProofNode, + Self::ProofLevel(_) => TypeVariant::ProofLevel, + Self::ArchivalProof(_) => TypeVariant::ArchivalProof, + Self::ArchivalProofExistenceProof(_) => TypeVariant::ArchivalProofExistenceProof, + Self::ArchivalProofNonexistenceProof(_) => TypeVariant::ArchivalProofNonexistenceProof, Self::SorobanResources(_) => TypeVariant::SorobanResources, Self::SorobanTransactionData(_) => TypeVariant::SorobanTransactionData, Self::TransactionV0(_) => TypeVariant::TransactionV0, @@ -60192,6 +61401,19 @@ impl WriteXdr for Type { Self::LedgerKeyConfigSetting(v) => v.write_xdr(w), Self::LedgerKeyTtl(v) => v.write_xdr(w), Self::EnvelopeType(v) => v.write_xdr(w), + Self::BucketListType(v) => v.write_xdr(w), + Self::BucketEntryType(v) => v.write_xdr(w), + Self::HotArchiveBucketEntryType(v) => v.write_xdr(w), + Self::ColdArchiveBucketEntryType(v) => v.write_xdr(w), + Self::BucketMetadata(v) => v.write_xdr(w), + Self::BucketMetadataExt(v) => v.write_xdr(w), + Self::BucketEntry(v) => v.write_xdr(w), + Self::HotArchiveBucketEntry(v) => v.write_xdr(w), + Self::ColdArchiveArchivedLeaf(v) => v.write_xdr(w), + Self::ColdArchiveDeletedLeaf(v) => v.write_xdr(w), + Self::ColdArchiveBoundaryLeaf(v) => v.write_xdr(w), + Self::ColdArchiveHashEntry(v) => v.write_xdr(w), + Self::ColdArchiveBucketEntry(v) => v.write_xdr(w), Self::UpgradeType(v) => v.write_xdr(w), Self::StellarValueType(v) => v.write_xdr(w), Self::LedgerCloseValueSignature(v) => v.write_xdr(w), @@ -60206,13 +61428,6 @@ impl WriteXdr for Type { Self::ConfigUpgradeSetKey(v) => v.write_xdr(w), Self::LedgerUpgrade(v) => v.write_xdr(w), Self::ConfigUpgradeSet(v) => v.write_xdr(w), - Self::BucketListType(v) => v.write_xdr(w), - Self::BucketEntryType(v) => v.write_xdr(w), - Self::HotArchiveBucketEntryType(v) => v.write_xdr(w), - Self::BucketMetadata(v) => v.write_xdr(w), - Self::BucketMetadataExt(v) => v.write_xdr(w), - Self::BucketEntry(v) => v.write_xdr(w), - Self::HotArchiveBucketEntry(v) => v.write_xdr(w), Self::TxSetComponentType(v) => v.write_xdr(w), Self::TxSetComponent(v) => v.write_xdr(w), Self::TxSetComponentTxsMaybeDiscountedFee(v) => v.write_xdr(w), @@ -60361,6 +61576,12 @@ impl WriteXdr for Type { Self::PreconditionType(v) => v.write_xdr(w), Self::Preconditions(v) => v.write_xdr(w), Self::LedgerFootprint(v) => v.write_xdr(w), + Self::ArchivalProofType(v) => v.write_xdr(w), + Self::ArchivalProofNode(v) => v.write_xdr(w), + Self::ProofLevel(v) => v.write_xdr(w), + Self::ArchivalProof(v) => v.write_xdr(w), + Self::ArchivalProofExistenceProof(v) => v.write_xdr(w), + Self::ArchivalProofNonexistenceProof(v) => v.write_xdr(w), Self::SorobanResources(v) => v.write_xdr(w), Self::SorobanTransactionData(v) => v.write_xdr(w), Self::TransactionV0(v) => v.write_xdr(w), diff --git a/src/next/generated.rs b/src/next/generated.rs index 93099b1d..29be5b17 100644 --- a/src/next/generated.rs +++ b/src/next/generated.rs @@ -46,11 +46,11 @@ pub const XDR_FILES_SHA256: [(&str, &str); 12] = [ ), ( "xdr/next/Stellar-ledger-entries.x", - "77dc7062ae6d0812136333e12e35b2294d7c2896a536be9c811eb0ed2abbbccb", + "5dea4f695f01aeb57ad97b97646f3da7dcf5ec35748e5065b19de429fb762cbc", ), ( "xdr/next/Stellar-ledger.x", - "0faadb179156fa2664366812e3757f0c6e637439dc2e7941c5dfcc8650b5d93d", + "79692619a21814327f00560b47742f0074c9d9712051bbdc135d851ffe3fcfed", ), ( "xdr/next/Stellar-overlay.x", @@ -58,7 +58,7 @@ pub const XDR_FILES_SHA256: [(&str, &str); 12] = [ ), ( "xdr/next/Stellar-transaction.x", - "747639c267aa298c01e5c026a776679454171d717207ef60aed158c5dedae957", + "4e7873995d280979566bdd0a6f06e7d6e58142fe4894fa80a59990e66e6b0e70", ), ( "xdr/next/Stellar-types.x", @@ -17526,119 +17526,131 @@ impl WriteXdr for EnvelopeType { } } -/// UpgradeType is an XDR Typedef defines as: +/// BucketListType is an XDR Enum defines as: /// /// ```text -/// typedef opaque UpgradeType<128>; +/// enum BucketListType +/// { +/// LIVE = 0, +/// HOT_ARCHIVE = 1, +/// COLD_ARCHIVE = 2 +/// }; /// ``` /// -#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[derive(Default)] #[cfg_attr( all(feature = "serde", feature = "alloc"), derive(serde::Serialize, serde::Deserialize), serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[derive(Debug)] -pub struct UpgradeType(pub BytesM<128>); - -impl From for BytesM<128> { - #[must_use] - fn from(x: UpgradeType) -> Self { - x.0 - } +#[repr(i32)] +pub enum BucketListType { + Live = 0, + HotArchive = 1, + ColdArchive = 2, } -impl From> for UpgradeType { +impl BucketListType { + pub const VARIANTS: [BucketListType; 3] = [ + BucketListType::Live, + BucketListType::HotArchive, + BucketListType::ColdArchive, + ]; + pub const VARIANTS_STR: [&'static str; 3] = ["Live", "HotArchive", "ColdArchive"]; + #[must_use] - fn from(x: BytesM<128>) -> Self { - UpgradeType(x) + pub const fn name(&self) -> &'static str { + match self { + Self::Live => "Live", + Self::HotArchive => "HotArchive", + Self::ColdArchive => "ColdArchive", + } } -} -impl AsRef> for UpgradeType { #[must_use] - fn as_ref(&self) -> &BytesM<128> { - &self.0 + pub const fn variants() -> [BucketListType; 3] { + Self::VARIANTS } } -impl ReadXdr for UpgradeType { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - let i = BytesM::<128>::read_xdr(r)?; - let v = UpgradeType(i); - Ok(v) - }) +impl Name for BucketListType { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) } } -impl WriteXdr for UpgradeType { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| self.0.write_xdr(w)) +impl Variants for BucketListType { + fn variants() -> slice::Iter<'static, BucketListType> { + Self::VARIANTS.iter() } } -impl Deref for UpgradeType { - type Target = BytesM<128>; - fn deref(&self) -> &Self::Target { - &self.0 - } -} +impl Enum for BucketListType {} -impl From for Vec { - #[must_use] - fn from(x: UpgradeType) -> Self { - x.0 .0 +impl fmt::Display for BucketListType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) } } -impl TryFrom> for UpgradeType { +impl TryFrom for BucketListType { type Error = Error; - fn try_from(x: Vec) -> Result { - Ok(UpgradeType(x.try_into()?)) - } -} -#[cfg(feature = "alloc")] -impl TryFrom<&Vec> for UpgradeType { - type Error = Error; - fn try_from(x: &Vec) -> Result { - Ok(UpgradeType(x.try_into()?)) + fn try_from(i: i32) -> Result { + let e = match i { + 0 => BucketListType::Live, + 1 => BucketListType::HotArchive, + 2 => BucketListType::ColdArchive, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) } } -impl AsRef> for UpgradeType { +impl From for i32 { #[must_use] - fn as_ref(&self) -> &Vec { - &self.0 .0 + fn from(e: BucketListType) -> Self { + e as Self } } -impl AsRef<[u8]> for UpgradeType { - #[cfg(feature = "alloc")] - #[must_use] - fn as_ref(&self) -> &[u8] { - &self.0 .0 +impl ReadXdr for BucketListType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) + }) } - #[cfg(not(feature = "alloc"))] - #[must_use] - fn as_ref(&self) -> &[u8] { - self.0 .0 +} + +impl WriteXdr for BucketListType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + let i: i32 = (*self).into(); + i.write_xdr(w) + }) } } -/// StellarValueType is an XDR Enum defines as: +/// BucketEntryType is an XDR Enum defines as: /// /// ```text -/// enum StellarValueType +/// enum BucketEntryType /// { -/// STELLAR_VALUE_BASIC = 0, -/// STELLAR_VALUE_SIGNED = 1 +/// METAENTRY = +/// -1, // At-and-after protocol 11: bucket metadata, should come first. +/// LIVEENTRY = 0, // Before protocol 11: created-or-updated; +/// // At-and-after protocol 11: only updated. +/// DEADENTRY = 1, +/// INITENTRY = 2 // At-and-after protocol 11: only created. /// }; /// ``` /// @@ -17652,57 +17664,69 @@ impl AsRef<[u8]> for UpgradeType { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum StellarValueType { - Basic = 0, - Signed = 1, +pub enum BucketEntryType { + Metaentry = -1, + Liveentry = 0, + Deadentry = 1, + Initentry = 2, } -impl StellarValueType { - pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; - pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; +impl BucketEntryType { + pub const VARIANTS: [BucketEntryType; 4] = [ + BucketEntryType::Metaentry, + BucketEntryType::Liveentry, + BucketEntryType::Deadentry, + BucketEntryType::Initentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = + ["Metaentry", "Liveentry", "Deadentry", "Initentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Basic => "Basic", - Self::Signed => "Signed", + Self::Metaentry => "Metaentry", + Self::Liveentry => "Liveentry", + Self::Deadentry => "Deadentry", + Self::Initentry => "Initentry", } } #[must_use] - pub const fn variants() -> [StellarValueType; 2] { + pub const fn variants() -> [BucketEntryType; 4] { Self::VARIANTS } } -impl Name for StellarValueType { +impl Name for BucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for StellarValueType { - fn variants() -> slice::Iter<'static, StellarValueType> { +impl Variants for BucketEntryType { + fn variants() -> slice::Iter<'static, BucketEntryType> { Self::VARIANTS.iter() } } -impl Enum for StellarValueType {} +impl Enum for BucketEntryType {} -impl fmt::Display for StellarValueType { +impl fmt::Display for BucketEntryType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for StellarValueType { +impl TryFrom for BucketEntryType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 0 => StellarValueType::Basic, - 1 => StellarValueType::Signed, + -1 => BucketEntryType::Metaentry, + 0 => BucketEntryType::Liveentry, + 1 => BucketEntryType::Deadentry, + 2 => BucketEntryType::Initentry, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -17710,14 +17734,14 @@ impl TryFrom for StellarValueType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: StellarValueType) -> Self { + fn from(e: BucketEntryType) -> Self { e as Self } } -impl ReadXdr for StellarValueType { +impl ReadXdr for BucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -17728,7 +17752,7 @@ impl ReadXdr for StellarValueType { } } -impl WriteXdr for StellarValueType { +impl WriteXdr for BucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -17738,66 +17762,22 @@ impl WriteXdr for StellarValueType { } } -/// LedgerCloseValueSignature is an XDR Struct defines as: +/// HotArchiveBucketEntryType is an XDR Enum defines as: /// /// ```text -/// struct LedgerCloseValueSignature +/// enum HotArchiveBucketEntryType /// { -/// NodeID nodeID; // which node introduced the value -/// Signature signature; // nodeID's signature +/// HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. +/// HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived +/// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but +/// // has been added back to the live BucketList. +/// // Does not need to be persisted. +/// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) /// }; /// ``` /// -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[cfg_attr( - all(feature = "serde", feature = "alloc"), - derive(serde::Serialize, serde::Deserialize), - serde(rename_all = "snake_case") -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerCloseValueSignature { - pub node_id: NodeId, - pub signature: Signature, -} - -impl ReadXdr for LedgerCloseValueSignature { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - Ok(Self { - node_id: NodeId::read_xdr(r)?, - signature: Signature::read_xdr(r)?, - }) - }) - } -} - -impl WriteXdr for LedgerCloseValueSignature { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| { - self.node_id.write_xdr(w)?; - self.signature.write_xdr(w)?; - Ok(()) - }) - } -} - -/// StellarValueExt is an XDR NestedUnion defines as: -/// -/// ```text -/// union switch (StellarValueType v) -/// { -/// case STELLAR_VALUE_BASIC: -/// void; -/// case STELLAR_VALUE_SIGNED: -/// LedgerCloseValueSignature lcValueSignature; -/// } -/// ``` -/// -// union with discriminant StellarValueType -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -17805,178 +17785,114 @@ impl WriteXdr for LedgerCloseValueSignature { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[allow(clippy::large_enum_variant)] -pub enum StellarValueExt { - Basic, - Signed(LedgerCloseValueSignature), +#[repr(i32)] +pub enum HotArchiveBucketEntryType { + Metaentry = -1, + Archived = 0, + Live = 1, + Deleted = 2, } -impl StellarValueExt { - pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; - pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; +impl HotArchiveBucketEntryType { + pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ + HotArchiveBucketEntryType::Metaentry, + HotArchiveBucketEntryType::Archived, + HotArchiveBucketEntryType::Live, + HotArchiveBucketEntryType::Deleted, + ]; + pub const VARIANTS_STR: [&'static str; 4] = ["Metaentry", "Archived", "Live", "Deleted"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Basic => "Basic", - Self::Signed(_) => "Signed", - } - } - - #[must_use] - pub const fn discriminant(&self) -> StellarValueType { - #[allow(clippy::match_same_arms)] - match self { - Self::Basic => StellarValueType::Basic, - Self::Signed(_) => StellarValueType::Signed, + Self::Metaentry => "Metaentry", + Self::Archived => "Archived", + Self::Live => "Live", + Self::Deleted => "Deleted", } } #[must_use] - pub const fn variants() -> [StellarValueType; 2] { + pub const fn variants() -> [HotArchiveBucketEntryType; 4] { Self::VARIANTS } } -impl Name for StellarValueExt { +impl Name for HotArchiveBucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for StellarValueExt { - #[must_use] - fn discriminant(&self) -> StellarValueType { - Self::discriminant(self) - } -} - -impl Variants for StellarValueExt { - fn variants() -> slice::Iter<'static, StellarValueType> { +impl Variants for HotArchiveBucketEntryType { + fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { Self::VARIANTS.iter() } } -impl Union for StellarValueExt {} +impl Enum for HotArchiveBucketEntryType {} -impl ReadXdr for StellarValueExt { - #[cfg(feature = "std")] - fn read_xdr(r: &mut Limited) -> Result { - r.with_limited_depth(|r| { - let dv: StellarValueType = ::read_xdr(r)?; - #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] - let v = match dv { - StellarValueType::Basic => Self::Basic, - StellarValueType::Signed => Self::Signed(LedgerCloseValueSignature::read_xdr(r)?), - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(v) - }) +impl fmt::Display for HotArchiveBucketEntryType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) } } -impl WriteXdr for StellarValueExt { - #[cfg(feature = "std")] - fn write_xdr(&self, w: &mut Limited) -> Result<()> { - w.with_limited_depth(|w| { - self.discriminant().write_xdr(w)?; - #[allow(clippy::match_same_arms)] - match self { - Self::Basic => ().write_xdr(w)?, - Self::Signed(v) => v.write_xdr(w)?, - }; - Ok(()) - }) +impl TryFrom for HotArchiveBucketEntryType { + type Error = Error; + + fn try_from(i: i32) -> Result { + let e = match i { + -1 => HotArchiveBucketEntryType::Metaentry, + 0 => HotArchiveBucketEntryType::Archived, + 1 => HotArchiveBucketEntryType::Live, + 2 => HotArchiveBucketEntryType::Deleted, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) } } -/// StellarValue is an XDR Struct defines as: -/// -/// ```text -/// struct StellarValue -/// { -/// Hash txSetHash; // transaction set to apply to previous ledger -/// TimePoint closeTime; // network close time -/// -/// // upgrades to apply to the previous ledger (usually empty) -/// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop -/// // unknown steps during consensus if needed. -/// // see notes below on 'LedgerUpgrade' for more detail -/// // max size is dictated by number of upgrade types (+ room for future) -/// UpgradeType upgrades<6>; -/// -/// // reserved for future use -/// union switch (StellarValueType v) -/// { -/// case STELLAR_VALUE_BASIC: -/// void; -/// case STELLAR_VALUE_SIGNED: -/// LedgerCloseValueSignature lcValueSignature; -/// } -/// ext; -/// }; -/// ``` -/// -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[cfg_attr( - all(feature = "serde", feature = "alloc"), - derive(serde::Serialize, serde::Deserialize), - serde(rename_all = "snake_case") -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct StellarValue { - pub tx_set_hash: Hash, - pub close_time: TimePoint, - pub upgrades: VecM, - pub ext: StellarValueExt, +impl From for i32 { + #[must_use] + fn from(e: HotArchiveBucketEntryType) -> Self { + e as Self + } } -impl ReadXdr for StellarValue { +impl ReadXdr for HotArchiveBucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - Ok(Self { - tx_set_hash: Hash::read_xdr(r)?, - close_time: TimePoint::read_xdr(r)?, - upgrades: VecM::::read_xdr(r)?, - ext: StellarValueExt::read_xdr(r)?, - }) + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) }) } } -impl WriteXdr for StellarValue { +impl WriteXdr for HotArchiveBucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.tx_set_hash.write_xdr(w)?; - self.close_time.write_xdr(w)?; - self.upgrades.write_xdr(w)?; - self.ext.write_xdr(w)?; - Ok(()) + let i: i32 = (*self).into(); + i.write_xdr(w) }) } } -/// MaskLedgerHeaderFlags is an XDR Const defines as: -/// -/// ```text -/// const MASK_LEDGER_HEADER_FLAGS = 0x7; -/// ``` -/// -pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; - -/// LedgerHeaderFlags is an XDR Enum defines as: +/// ColdArchiveBucketEntryType is an XDR Enum defines as: /// /// ```text -/// enum LedgerHeaderFlags +/// enum ColdArchiveBucketEntryType /// { -/// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, -/// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, -/// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 +/// COLD_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. +/// COLD_ARCHIVE_ARCHIVED_LEAF = 0, // Full LedgerEntry that was archived during the epoch +/// COLD_ARCHIVE_DELETED_LEAF = 1, // LedgerKey that was deleted during the epoch +/// COLD_ARCHIVE_BOUNDARY_LEAF = 2, // Dummy leaf representing low/high bound +/// COLD_ARCHIVE_HASH = 3 // Intermediary Merkle hash entry /// }; /// ``` /// @@ -17990,64 +17906,78 @@ pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum LedgerHeaderFlags { - TradingFlag = 1, - DepositFlag = 2, - WithdrawalFlag = 4, +pub enum ColdArchiveBucketEntryType { + Metaentry = -1, + ArchivedLeaf = 0, + DeletedLeaf = 1, + BoundaryLeaf = 2, + Hash = 3, } -impl LedgerHeaderFlags { - pub const VARIANTS: [LedgerHeaderFlags; 3] = [ - LedgerHeaderFlags::TradingFlag, - LedgerHeaderFlags::DepositFlag, - LedgerHeaderFlags::WithdrawalFlag, +impl ColdArchiveBucketEntryType { + pub const VARIANTS: [ColdArchiveBucketEntryType; 5] = [ + ColdArchiveBucketEntryType::Metaentry, + ColdArchiveBucketEntryType::ArchivedLeaf, + ColdArchiveBucketEntryType::DeletedLeaf, + ColdArchiveBucketEntryType::BoundaryLeaf, + ColdArchiveBucketEntryType::Hash, + ]; + pub const VARIANTS_STR: [&'static str; 5] = [ + "Metaentry", + "ArchivedLeaf", + "DeletedLeaf", + "BoundaryLeaf", + "Hash", ]; - pub const VARIANTS_STR: [&'static str; 3] = ["TradingFlag", "DepositFlag", "WithdrawalFlag"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::TradingFlag => "TradingFlag", - Self::DepositFlag => "DepositFlag", - Self::WithdrawalFlag => "WithdrawalFlag", + Self::Metaentry => "Metaentry", + Self::ArchivedLeaf => "ArchivedLeaf", + Self::DeletedLeaf => "DeletedLeaf", + Self::BoundaryLeaf => "BoundaryLeaf", + Self::Hash => "Hash", } } #[must_use] - pub const fn variants() -> [LedgerHeaderFlags; 3] { + pub const fn variants() -> [ColdArchiveBucketEntryType; 5] { Self::VARIANTS } } -impl Name for LedgerHeaderFlags { +impl Name for ColdArchiveBucketEntryType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for LedgerHeaderFlags { - fn variants() -> slice::Iter<'static, LedgerHeaderFlags> { +impl Variants for ColdArchiveBucketEntryType { + fn variants() -> slice::Iter<'static, ColdArchiveBucketEntryType> { Self::VARIANTS.iter() } } -impl Enum for LedgerHeaderFlags {} +impl Enum for ColdArchiveBucketEntryType {} -impl fmt::Display for LedgerHeaderFlags { +impl fmt::Display for ColdArchiveBucketEntryType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for LedgerHeaderFlags { +impl TryFrom for ColdArchiveBucketEntryType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 1 => LedgerHeaderFlags::TradingFlag, - 2 => LedgerHeaderFlags::DepositFlag, - 4 => LedgerHeaderFlags::WithdrawalFlag, + -1 => ColdArchiveBucketEntryType::Metaentry, + 0 => ColdArchiveBucketEntryType::ArchivedLeaf, + 1 => ColdArchiveBucketEntryType::DeletedLeaf, + 2 => ColdArchiveBucketEntryType::BoundaryLeaf, + 3 => ColdArchiveBucketEntryType::Hash, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18055,14 +17985,14 @@ impl TryFrom for LedgerHeaderFlags { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: LedgerHeaderFlags) -> Self { + fn from(e: ColdArchiveBucketEntryType) -> Self { e as Self } } -impl ReadXdr for LedgerHeaderFlags { +impl ReadXdr for ColdArchiveBucketEntryType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18073,7 +18003,7 @@ impl ReadXdr for LedgerHeaderFlags { } } -impl WriteXdr for LedgerHeaderFlags { +impl WriteXdr for ColdArchiveBucketEntryType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18083,13 +18013,15 @@ impl WriteXdr for LedgerHeaderFlags { } } -/// LedgerHeaderExtensionV1Ext is an XDR NestedUnion defines as: +/// BucketMetadataExt is an XDR NestedUnion defines as: /// /// ```text /// union switch (int v) /// { /// case 0: /// void; +/// case 1: +/// BucketListType bucketListType; /// } /// ``` /// @@ -18103,18 +18035,20 @@ impl WriteXdr for LedgerHeaderFlags { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerHeaderExtensionV1Ext { +pub enum BucketMetadataExt { V0, + V1(BucketListType), } -impl LedgerHeaderExtensionV1Ext { - pub const VARIANTS: [i32; 1] = [0]; - pub const VARIANTS_STR: [&'static str; 1] = ["V0"]; +impl BucketMetadataExt { + pub const VARIANTS: [i32; 2] = [0, 1]; + pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; #[must_use] pub const fn name(&self) -> &'static str { match self { Self::V0 => "V0", + Self::V1(_) => "V1", } } @@ -18123,38 +18057,39 @@ impl LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms)] match self { Self::V0 => 0, + Self::V1(_) => 1, } } #[must_use] - pub const fn variants() -> [i32; 1] { + pub const fn variants() -> [i32; 2] { Self::VARIANTS } } -impl Name for LedgerHeaderExtensionV1Ext { +impl Name for BucketMetadataExt { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerHeaderExtensionV1Ext { +impl Discriminant for BucketMetadataExt { #[must_use] fn discriminant(&self) -> i32 { Self::discriminant(self) } } -impl Variants for LedgerHeaderExtensionV1Ext { +impl Variants for BucketMetadataExt { fn variants() -> slice::Iter<'static, i32> { Self::VARIANTS.iter() } } -impl Union for LedgerHeaderExtensionV1Ext {} +impl Union for BucketMetadataExt {} -impl ReadXdr for LedgerHeaderExtensionV1Ext { +impl ReadXdr for BucketMetadataExt { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18162,6 +18097,7 @@ impl ReadXdr for LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { 0 => Self::V0, + 1 => Self::V1(BucketListType::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18170,7 +18106,7 @@ impl ReadXdr for LedgerHeaderExtensionV1Ext { } } -impl WriteXdr for LedgerHeaderExtensionV1Ext { +impl WriteXdr for BucketMetadataExt { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18178,23 +18114,28 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { #[allow(clippy::match_same_arms)] match self { Self::V0 => ().write_xdr(w)?, + Self::V1(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// LedgerHeaderExtensionV1 is an XDR Struct defines as: +/// BucketMetadata is an XDR Struct defines as: /// /// ```text -/// struct LedgerHeaderExtensionV1 +/// struct BucketMetadata /// { -/// uint32 flags; // LedgerHeaderFlags +/// // Indicates the protocol version used to create / merge this bucket. +/// uint32 ledgerVersion; /// +/// // reserved for future use /// union switch (int v) /// { /// case 0: /// void; +/// case 1: +/// BucketListType bucketListType; /// } /// ext; /// }; @@ -18208,47 +18149,51 @@ impl WriteXdr for LedgerHeaderExtensionV1Ext { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerHeaderExtensionV1 { - pub flags: u32, - pub ext: LedgerHeaderExtensionV1Ext, +pub struct BucketMetadata { + pub ledger_version: u32, + pub ext: BucketMetadataExt, } -impl ReadXdr for LedgerHeaderExtensionV1 { +impl ReadXdr for BucketMetadata { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - flags: u32::read_xdr(r)?, - ext: LedgerHeaderExtensionV1Ext::read_xdr(r)?, + ledger_version: u32::read_xdr(r)?, + ext: BucketMetadataExt::read_xdr(r)?, }) }) } } -impl WriteXdr for LedgerHeaderExtensionV1 { +impl WriteXdr for BucketMetadata { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.flags.write_xdr(w)?; + self.ledger_version.write_xdr(w)?; self.ext.write_xdr(w)?; Ok(()) }) } } -/// LedgerHeaderExt is an XDR NestedUnion defines as: +/// BucketEntry is an XDR Union defines as: /// /// ```text -/// union switch (int v) -/// { -/// case 0: -/// void; -/// case 1: -/// LedgerHeaderExtensionV1 v1; -/// } +/// union BucketEntry switch (BucketEntryType type) +/// { +/// case LIVEENTRY: +/// case INITENTRY: +/// LedgerEntry liveEntry; +/// +/// case DEADENTRY: +/// LedgerKey deadEntry; +/// case METAENTRY: +/// BucketMetadata metaEntry; +/// }; /// ``` /// -// union with discriminant i32 +// union with discriminant BucketEntryType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -18258,69 +18203,83 @@ impl WriteXdr for LedgerHeaderExtensionV1 { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerHeaderExt { - V0, - V1(LedgerHeaderExtensionV1), +pub enum BucketEntry { + Liveentry(LedgerEntry), + Initentry(LedgerEntry), + Deadentry(LedgerKey), + Metaentry(BucketMetadata), } -impl LedgerHeaderExt { - pub const VARIANTS: [i32; 2] = [0, 1]; - pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; +impl BucketEntry { + pub const VARIANTS: [BucketEntryType; 4] = [ + BucketEntryType::Liveentry, + BucketEntryType::Initentry, + BucketEntryType::Deadentry, + BucketEntryType::Metaentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = + ["Liveentry", "Initentry", "Deadentry", "Metaentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::V0 => "V0", - Self::V1(_) => "V1", + Self::Liveentry(_) => "Liveentry", + Self::Initentry(_) => "Initentry", + Self::Deadentry(_) => "Deadentry", + Self::Metaentry(_) => "Metaentry", } } #[must_use] - pub const fn discriminant(&self) -> i32 { + pub const fn discriminant(&self) -> BucketEntryType { #[allow(clippy::match_same_arms)] match self { - Self::V0 => 0, - Self::V1(_) => 1, + Self::Liveentry(_) => BucketEntryType::Liveentry, + Self::Initentry(_) => BucketEntryType::Initentry, + Self::Deadentry(_) => BucketEntryType::Deadentry, + Self::Metaentry(_) => BucketEntryType::Metaentry, } } #[must_use] - pub const fn variants() -> [i32; 2] { + pub const fn variants() -> [BucketEntryType; 4] { Self::VARIANTS } } -impl Name for LedgerHeaderExt { +impl Name for BucketEntry { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerHeaderExt { +impl Discriminant for BucketEntry { #[must_use] - fn discriminant(&self) -> i32 { + fn discriminant(&self) -> BucketEntryType { Self::discriminant(self) } } -impl Variants for LedgerHeaderExt { - fn variants() -> slice::Iter<'static, i32> { +impl Variants for BucketEntry { + fn variants() -> slice::Iter<'static, BucketEntryType> { Self::VARIANTS.iter() } } -impl Union for LedgerHeaderExt {} +impl Union for BucketEntry {} -impl ReadXdr for LedgerHeaderExt { +impl ReadXdr for BucketEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: i32 = ::read_xdr(r)?; + let dv: BucketEntryType = ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - 0 => Self::V0, - 1 => Self::V1(LedgerHeaderExtensionV1::read_xdr(r)?), + BucketEntryType::Liveentry => Self::Liveentry(LedgerEntry::read_xdr(r)?), + BucketEntryType::Initentry => Self::Initentry(LedgerEntry::read_xdr(r)?), + BucketEntryType::Deadentry => Self::Deadentry(LedgerKey::read_xdr(r)?), + BucketEntryType::Metaentry => Self::Metaentry(BucketMetadata::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18329,62 +18288,299 @@ impl ReadXdr for LedgerHeaderExt { } } -impl WriteXdr for LedgerHeaderExt { +impl WriteXdr for BucketEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::V0 => ().write_xdr(w)?, - Self::V1(v) => v.write_xdr(w)?, + Self::Liveentry(v) => v.write_xdr(w)?, + Self::Initentry(v) => v.write_xdr(w)?, + Self::Deadentry(v) => v.write_xdr(w)?, + Self::Metaentry(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// LedgerHeader is an XDR Struct defines as: +/// HotArchiveBucketEntry is an XDR Union defines as: /// /// ```text -/// struct LedgerHeader +/// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) /// { -/// uint32 ledgerVersion; // the protocol version of the ledger -/// Hash previousLedgerHash; // hash of the previous ledger header -/// StellarValue scpValue; // what consensus agreed to -/// Hash txSetResultHash; // the TransactionResultSet that led to this ledger -/// Hash bucketListHash; // hash of the ledger state +/// case HOT_ARCHIVE_ARCHIVED: +/// LedgerEntry archivedEntry; /// -/// uint32 ledgerSeq; // sequence number of this ledger +/// case HOT_ARCHIVE_LIVE: +/// case HOT_ARCHIVE_DELETED: +/// LedgerKey key; +/// case HOT_ARCHIVE_METAENTRY: +/// BucketMetadata metaEntry; +/// }; +/// ``` /// -/// int64 totalCoins; // total number of stroops in existence. -/// // 10,000,000 stroops in 1 XLM +// union with discriminant HotArchiveBucketEntryType +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[allow(clippy::large_enum_variant)] +pub enum HotArchiveBucketEntry { + Archived(LedgerEntry), + Live(LedgerKey), + Deleted(LedgerKey), + Metaentry(BucketMetadata), +} + +impl HotArchiveBucketEntry { + pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ + HotArchiveBucketEntryType::Archived, + HotArchiveBucketEntryType::Live, + HotArchiveBucketEntryType::Deleted, + HotArchiveBucketEntryType::Metaentry, + ]; + pub const VARIANTS_STR: [&'static str; 4] = ["Archived", "Live", "Deleted", "Metaentry"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Archived(_) => "Archived", + Self::Live(_) => "Live", + Self::Deleted(_) => "Deleted", + Self::Metaentry(_) => "Metaentry", + } + } + + #[must_use] + pub const fn discriminant(&self) -> HotArchiveBucketEntryType { + #[allow(clippy::match_same_arms)] + match self { + Self::Archived(_) => HotArchiveBucketEntryType::Archived, + Self::Live(_) => HotArchiveBucketEntryType::Live, + Self::Deleted(_) => HotArchiveBucketEntryType::Deleted, + Self::Metaentry(_) => HotArchiveBucketEntryType::Metaentry, + } + } + + #[must_use] + pub const fn variants() -> [HotArchiveBucketEntryType; 4] { + Self::VARIANTS + } +} + +impl Name for HotArchiveBucketEntry { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Discriminant for HotArchiveBucketEntry { + #[must_use] + fn discriminant(&self) -> HotArchiveBucketEntryType { + Self::discriminant(self) + } +} + +impl Variants for HotArchiveBucketEntry { + fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { + Self::VARIANTS.iter() + } +} + +impl Union for HotArchiveBucketEntry {} + +impl ReadXdr for HotArchiveBucketEntry { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let dv: HotArchiveBucketEntryType = + ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + HotArchiveBucketEntryType::Archived => Self::Archived(LedgerEntry::read_xdr(r)?), + HotArchiveBucketEntryType::Live => Self::Live(LedgerKey::read_xdr(r)?), + HotArchiveBucketEntryType::Deleted => Self::Deleted(LedgerKey::read_xdr(r)?), + HotArchiveBucketEntryType::Metaentry => { + Self::Metaentry(BucketMetadata::read_xdr(r)?) + } + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) + }) + } +} + +impl WriteXdr for HotArchiveBucketEntry { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::Archived(v) => v.write_xdr(w)?, + Self::Live(v) => v.write_xdr(w)?, + Self::Deleted(v) => v.write_xdr(w)?, + Self::Metaentry(v) => v.write_xdr(w)?, + }; + Ok(()) + }) + } +} + +/// ColdArchiveArchivedLeaf is an XDR Struct defines as: /// -/// int64 feePool; // fees burned since last inflation run -/// uint32 inflationSeq; // inflation sequence number +/// ```text +/// struct ColdArchiveArchivedLeaf +/// { +/// uint32 index; +/// LedgerEntry archivedEntry; +/// }; +/// ``` /// -/// uint64 idPool; // last used global ID, used for generating objects +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ColdArchiveArchivedLeaf { + pub index: u32, + pub archived_entry: LedgerEntry, +} + +impl ReadXdr for ColdArchiveArchivedLeaf { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + archived_entry: LedgerEntry::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ColdArchiveArchivedLeaf { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.archived_entry.write_xdr(w)?; + Ok(()) + }) + } +} + +/// ColdArchiveDeletedLeaf is an XDR Struct defines as: /// -/// uint32 baseFee; // base fee per operation in stroops -/// uint32 baseReserve; // account base reserve in stroops +/// ```text +/// struct ColdArchiveDeletedLeaf +/// { +/// uint32 index; +/// LedgerKey deletedKey; +/// }; +/// ``` /// -/// uint32 maxTxSetSize; // maximum size a transaction set can be +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ColdArchiveDeletedLeaf { + pub index: u32, + pub deleted_key: LedgerKey, +} + +impl ReadXdr for ColdArchiveDeletedLeaf { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + deleted_key: LedgerKey::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ColdArchiveDeletedLeaf { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.deleted_key.write_xdr(w)?; + Ok(()) + }) + } +} + +/// ColdArchiveBoundaryLeaf is an XDR Struct defines as: /// -/// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back -/// // in time without walking the chain back ledger by ledger -/// // each slot contains the oldest ledger that is mod of -/// // either 50 5000 50000 or 500000 depending on index -/// // skipList[0] mod(50), skipList[1] mod(5000), etc +/// ```text +/// struct ColdArchiveBoundaryLeaf +/// { +/// uint32 index; +/// bool isLowerBound; +/// }; +/// ``` /// -/// // reserved for future use -/// union switch (int v) -/// { -/// case 0: -/// void; -/// case 1: -/// LedgerHeaderExtensionV1 v1; -/// } -/// ext; +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ColdArchiveBoundaryLeaf { + pub index: u32, + pub is_lower_bound: bool, +} + +impl ReadXdr for ColdArchiveBoundaryLeaf { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + is_lower_bound: bool::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ColdArchiveBoundaryLeaf { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.is_lower_bound.write_xdr(w)?; + Ok(()) + }) + } +} + +/// ColdArchiveHashEntry is an XDR Struct defines as: +/// +/// ```text +/// struct ColdArchiveHashEntry +/// { +/// uint32 index; +/// uint32 level; +/// Hash hash; /// }; /// ``` /// @@ -18396,85 +18592,300 @@ impl WriteXdr for LedgerHeaderExt { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LedgerHeader { - pub ledger_version: u32, - pub previous_ledger_hash: Hash, - pub scp_value: StellarValue, - pub tx_set_result_hash: Hash, - pub bucket_list_hash: Hash, - pub ledger_seq: u32, - pub total_coins: i64, - pub fee_pool: i64, - pub inflation_seq: u32, - pub id_pool: u64, - pub base_fee: u32, - pub base_reserve: u32, - pub max_tx_set_size: u32, - pub skip_list: [Hash; 4], - pub ext: LedgerHeaderExt, +pub struct ColdArchiveHashEntry { + pub index: u32, + pub level: u32, + pub hash: Hash, } -impl ReadXdr for LedgerHeader { +impl ReadXdr for ColdArchiveHashEntry { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - ledger_version: u32::read_xdr(r)?, - previous_ledger_hash: Hash::read_xdr(r)?, - scp_value: StellarValue::read_xdr(r)?, - tx_set_result_hash: Hash::read_xdr(r)?, - bucket_list_hash: Hash::read_xdr(r)?, - ledger_seq: u32::read_xdr(r)?, - total_coins: i64::read_xdr(r)?, - fee_pool: i64::read_xdr(r)?, - inflation_seq: u32::read_xdr(r)?, - id_pool: u64::read_xdr(r)?, - base_fee: u32::read_xdr(r)?, - base_reserve: u32::read_xdr(r)?, - max_tx_set_size: u32::read_xdr(r)?, - skip_list: <[Hash; 4]>::read_xdr(r)?, - ext: LedgerHeaderExt::read_xdr(r)?, + index: u32::read_xdr(r)?, + level: u32::read_xdr(r)?, + hash: Hash::read_xdr(r)?, }) }) } } -impl WriteXdr for LedgerHeader { +impl WriteXdr for ColdArchiveHashEntry { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.ledger_version.write_xdr(w)?; - self.previous_ledger_hash.write_xdr(w)?; - self.scp_value.write_xdr(w)?; - self.tx_set_result_hash.write_xdr(w)?; - self.bucket_list_hash.write_xdr(w)?; - self.ledger_seq.write_xdr(w)?; - self.total_coins.write_xdr(w)?; - self.fee_pool.write_xdr(w)?; - self.inflation_seq.write_xdr(w)?; - self.id_pool.write_xdr(w)?; - self.base_fee.write_xdr(w)?; - self.base_reserve.write_xdr(w)?; - self.max_tx_set_size.write_xdr(w)?; - self.skip_list.write_xdr(w)?; - self.ext.write_xdr(w)?; + self.index.write_xdr(w)?; + self.level.write_xdr(w)?; + self.hash.write_xdr(w)?; Ok(()) }) } } -/// LedgerUpgradeType is an XDR Enum defines as: +/// ColdArchiveBucketEntry is an XDR Union defines as: /// /// ```text -/// enum LedgerUpgradeType +/// union ColdArchiveBucketEntry switch (ColdArchiveBucketEntryType type) /// { -/// LEDGER_UPGRADE_VERSION = 1, -/// LEDGER_UPGRADE_BASE_FEE = 2, -/// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, -/// LEDGER_UPGRADE_BASE_RESERVE = 4, -/// LEDGER_UPGRADE_FLAGS = 5, -/// LEDGER_UPGRADE_CONFIG = 6, -/// LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 +/// case COLD_ARCHIVE_METAENTRY: +/// BucketMetadata metaEntry; +/// case COLD_ARCHIVE_ARCHIVED_LEAF: +/// ColdArchiveArchivedLeaf archivedLeaf; +/// case COLD_ARCHIVE_DELETED_LEAF: +/// ColdArchiveDeletedLeaf deletedLeaf; +/// case COLD_ARCHIVE_BOUNDARY_LEAF: +/// ColdArchiveBoundaryLeaf boundaryLeaf; +/// case COLD_ARCHIVE_HASH: +/// ColdArchiveHashEntry hashEntry; +/// }; +/// ``` +/// +// union with discriminant ColdArchiveBucketEntryType +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[allow(clippy::large_enum_variant)] +pub enum ColdArchiveBucketEntry { + Metaentry(BucketMetadata), + ArchivedLeaf(ColdArchiveArchivedLeaf), + DeletedLeaf(ColdArchiveDeletedLeaf), + BoundaryLeaf(ColdArchiveBoundaryLeaf), + Hash(ColdArchiveHashEntry), +} + +impl ColdArchiveBucketEntry { + pub const VARIANTS: [ColdArchiveBucketEntryType; 5] = [ + ColdArchiveBucketEntryType::Metaentry, + ColdArchiveBucketEntryType::ArchivedLeaf, + ColdArchiveBucketEntryType::DeletedLeaf, + ColdArchiveBucketEntryType::BoundaryLeaf, + ColdArchiveBucketEntryType::Hash, + ]; + pub const VARIANTS_STR: [&'static str; 5] = [ + "Metaentry", + "ArchivedLeaf", + "DeletedLeaf", + "BoundaryLeaf", + "Hash", + ]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Metaentry(_) => "Metaentry", + Self::ArchivedLeaf(_) => "ArchivedLeaf", + Self::DeletedLeaf(_) => "DeletedLeaf", + Self::BoundaryLeaf(_) => "BoundaryLeaf", + Self::Hash(_) => "Hash", + } + } + + #[must_use] + pub const fn discriminant(&self) -> ColdArchiveBucketEntryType { + #[allow(clippy::match_same_arms)] + match self { + Self::Metaentry(_) => ColdArchiveBucketEntryType::Metaentry, + Self::ArchivedLeaf(_) => ColdArchiveBucketEntryType::ArchivedLeaf, + Self::DeletedLeaf(_) => ColdArchiveBucketEntryType::DeletedLeaf, + Self::BoundaryLeaf(_) => ColdArchiveBucketEntryType::BoundaryLeaf, + Self::Hash(_) => ColdArchiveBucketEntryType::Hash, + } + } + + #[must_use] + pub const fn variants() -> [ColdArchiveBucketEntryType; 5] { + Self::VARIANTS + } +} + +impl Name for ColdArchiveBucketEntry { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Discriminant for ColdArchiveBucketEntry { + #[must_use] + fn discriminant(&self) -> ColdArchiveBucketEntryType { + Self::discriminant(self) + } +} + +impl Variants for ColdArchiveBucketEntry { + fn variants() -> slice::Iter<'static, ColdArchiveBucketEntryType> { + Self::VARIANTS.iter() + } +} + +impl Union for ColdArchiveBucketEntry {} + +impl ReadXdr for ColdArchiveBucketEntry { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let dv: ColdArchiveBucketEntryType = + ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + ColdArchiveBucketEntryType::Metaentry => { + Self::Metaentry(BucketMetadata::read_xdr(r)?) + } + ColdArchiveBucketEntryType::ArchivedLeaf => { + Self::ArchivedLeaf(ColdArchiveArchivedLeaf::read_xdr(r)?) + } + ColdArchiveBucketEntryType::DeletedLeaf => { + Self::DeletedLeaf(ColdArchiveDeletedLeaf::read_xdr(r)?) + } + ColdArchiveBucketEntryType::BoundaryLeaf => { + Self::BoundaryLeaf(ColdArchiveBoundaryLeaf::read_xdr(r)?) + } + ColdArchiveBucketEntryType::Hash => Self::Hash(ColdArchiveHashEntry::read_xdr(r)?), + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) + }) + } +} + +impl WriteXdr for ColdArchiveBucketEntry { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::Metaentry(v) => v.write_xdr(w)?, + Self::ArchivedLeaf(v) => v.write_xdr(w)?, + Self::DeletedLeaf(v) => v.write_xdr(w)?, + Self::BoundaryLeaf(v) => v.write_xdr(w)?, + Self::Hash(v) => v.write_xdr(w)?, + }; + Ok(()) + }) + } +} + +/// UpgradeType is an XDR Typedef defines as: +/// +/// ```text +/// typedef opaque UpgradeType<128>; +/// ``` +/// +#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[derive(Default)] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[derive(Debug)] +pub struct UpgradeType(pub BytesM<128>); + +impl From for BytesM<128> { + #[must_use] + fn from(x: UpgradeType) -> Self { + x.0 + } +} + +impl From> for UpgradeType { + #[must_use] + fn from(x: BytesM<128>) -> Self { + UpgradeType(x) + } +} + +impl AsRef> for UpgradeType { + #[must_use] + fn as_ref(&self) -> &BytesM<128> { + &self.0 + } +} + +impl ReadXdr for UpgradeType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let i = BytesM::<128>::read_xdr(r)?; + let v = UpgradeType(i); + Ok(v) + }) + } +} + +impl WriteXdr for UpgradeType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| self.0.write_xdr(w)) + } +} + +impl Deref for UpgradeType { + type Target = BytesM<128>; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From for Vec { + #[must_use] + fn from(x: UpgradeType) -> Self { + x.0 .0 + } +} + +impl TryFrom> for UpgradeType { + type Error = Error; + fn try_from(x: Vec) -> Result { + Ok(UpgradeType(x.try_into()?)) + } +} + +#[cfg(feature = "alloc")] +impl TryFrom<&Vec> for UpgradeType { + type Error = Error; + fn try_from(x: &Vec) -> Result { + Ok(UpgradeType(x.try_into()?)) + } +} + +impl AsRef> for UpgradeType { + #[must_use] + fn as_ref(&self) -> &Vec { + &self.0 .0 + } +} + +impl AsRef<[u8]> for UpgradeType { + #[cfg(feature = "alloc")] + #[must_use] + fn as_ref(&self) -> &[u8] { + &self.0 .0 + } + #[cfg(not(feature = "alloc"))] + #[must_use] + fn as_ref(&self) -> &[u8] { + self.0 .0 + } +} + +/// StellarValueType is an XDR Enum defines as: +/// +/// ```text +/// enum StellarValueType +/// { +/// STELLAR_VALUE_BASIC = 0, +/// STELLAR_VALUE_SIGNED = 1 /// }; /// ``` /// @@ -18488,88 +18899,57 @@ impl WriteXdr for LedgerHeader { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum LedgerUpgradeType { - Version = 1, - BaseFee = 2, - MaxTxSetSize = 3, - BaseReserve = 4, - Flags = 5, - Config = 6, - MaxSorobanTxSetSize = 7, +pub enum StellarValueType { + Basic = 0, + Signed = 1, } -impl LedgerUpgradeType { - pub const VARIANTS: [LedgerUpgradeType; 7] = [ - LedgerUpgradeType::Version, - LedgerUpgradeType::BaseFee, - LedgerUpgradeType::MaxTxSetSize, - LedgerUpgradeType::BaseReserve, - LedgerUpgradeType::Flags, - LedgerUpgradeType::Config, - LedgerUpgradeType::MaxSorobanTxSetSize, - ]; - pub const VARIANTS_STR: [&'static str; 7] = [ - "Version", - "BaseFee", - "MaxTxSetSize", - "BaseReserve", - "Flags", - "Config", - "MaxSorobanTxSetSize", - ]; +impl StellarValueType { + pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; + pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Version => "Version", - Self::BaseFee => "BaseFee", - Self::MaxTxSetSize => "MaxTxSetSize", - Self::BaseReserve => "BaseReserve", - Self::Flags => "Flags", - Self::Config => "Config", - Self::MaxSorobanTxSetSize => "MaxSorobanTxSetSize", + Self::Basic => "Basic", + Self::Signed => "Signed", } } #[must_use] - pub const fn variants() -> [LedgerUpgradeType; 7] { + pub const fn variants() -> [StellarValueType; 2] { Self::VARIANTS } } -impl Name for LedgerUpgradeType { +impl Name for StellarValueType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for LedgerUpgradeType { - fn variants() -> slice::Iter<'static, LedgerUpgradeType> { +impl Variants for StellarValueType { + fn variants() -> slice::Iter<'static, StellarValueType> { Self::VARIANTS.iter() } } -impl Enum for LedgerUpgradeType {} +impl Enum for StellarValueType {} -impl fmt::Display for LedgerUpgradeType { +impl fmt::Display for StellarValueType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for LedgerUpgradeType { +impl TryFrom for StellarValueType { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 1 => LedgerUpgradeType::Version, - 2 => LedgerUpgradeType::BaseFee, - 3 => LedgerUpgradeType::MaxTxSetSize, - 4 => LedgerUpgradeType::BaseReserve, - 5 => LedgerUpgradeType::Flags, - 6 => LedgerUpgradeType::Config, - 7 => LedgerUpgradeType::MaxSorobanTxSetSize, + 0 => StellarValueType::Basic, + 1 => StellarValueType::Signed, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18577,14 +18957,14 @@ impl TryFrom for LedgerUpgradeType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: LedgerUpgradeType) -> Self { + fn from(e: StellarValueType) -> Self { e as Self } } -impl ReadXdr for LedgerUpgradeType { +impl ReadXdr for StellarValueType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18595,7 +18975,7 @@ impl ReadXdr for LedgerUpgradeType { } } -impl WriteXdr for LedgerUpgradeType { +impl WriteXdr for StellarValueType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18605,12 +18985,13 @@ impl WriteXdr for LedgerUpgradeType { } } -/// ConfigUpgradeSetKey is an XDR Struct defines as: +/// LedgerCloseValueSignature is an XDR Struct defines as: /// /// ```text -/// struct ConfigUpgradeSetKey { -/// Hash contractID; -/// Hash contentHash; +/// struct LedgerCloseValueSignature +/// { +/// NodeID nodeID; // which node introduced the value +/// Signature signature; // nodeID's signature /// }; /// ``` /// @@ -18622,60 +19003,47 @@ impl WriteXdr for LedgerUpgradeType { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct ConfigUpgradeSetKey { - pub contract_id: Hash, - pub content_hash: Hash, +pub struct LedgerCloseValueSignature { + pub node_id: NodeId, + pub signature: Signature, } -impl ReadXdr for ConfigUpgradeSetKey { +impl ReadXdr for LedgerCloseValueSignature { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - contract_id: Hash::read_xdr(r)?, - content_hash: Hash::read_xdr(r)?, + node_id: NodeId::read_xdr(r)?, + signature: Signature::read_xdr(r)?, }) }) } } -impl WriteXdr for ConfigUpgradeSetKey { +impl WriteXdr for LedgerCloseValueSignature { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.contract_id.write_xdr(w)?; - self.content_hash.write_xdr(w)?; + self.node_id.write_xdr(w)?; + self.signature.write_xdr(w)?; Ok(()) }) } } -/// LedgerUpgrade is an XDR Union defines as: +/// StellarValueExt is an XDR NestedUnion defines as: /// /// ```text -/// union LedgerUpgrade switch (LedgerUpgradeType type) -/// { -/// case LEDGER_UPGRADE_VERSION: -/// uint32 newLedgerVersion; // update ledgerVersion -/// case LEDGER_UPGRADE_BASE_FEE: -/// uint32 newBaseFee; // update baseFee -/// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: -/// uint32 newMaxTxSetSize; // update maxTxSetSize -/// case LEDGER_UPGRADE_BASE_RESERVE: -/// uint32 newBaseReserve; // update baseReserve -/// case LEDGER_UPGRADE_FLAGS: -/// uint32 newFlags; // update flags -/// case LEDGER_UPGRADE_CONFIG: -/// // Update arbitrary `ConfigSetting` entries identified by the key. -/// ConfigUpgradeSetKey newConfig; -/// case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: -/// // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without -/// // using `LEDGER_UPGRADE_CONFIG`. -/// uint32 newMaxSorobanTxSetSize; -/// }; +/// union switch (StellarValueType v) +/// { +/// case STELLAR_VALUE_BASIC: +/// void; +/// case STELLAR_VALUE_SIGNED: +/// LedgerCloseValueSignature lcValueSignature; +/// } /// ``` /// -// union with discriminant LedgerUpgradeType +// union with discriminant StellarValueType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -18685,107 +19053,69 @@ impl WriteXdr for ConfigUpgradeSetKey { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum LedgerUpgrade { - Version(u32), - BaseFee(u32), - MaxTxSetSize(u32), - BaseReserve(u32), - Flags(u32), - Config(ConfigUpgradeSetKey), - MaxSorobanTxSetSize(u32), +pub enum StellarValueExt { + Basic, + Signed(LedgerCloseValueSignature), } -impl LedgerUpgrade { - pub const VARIANTS: [LedgerUpgradeType; 7] = [ - LedgerUpgradeType::Version, - LedgerUpgradeType::BaseFee, - LedgerUpgradeType::MaxTxSetSize, - LedgerUpgradeType::BaseReserve, - LedgerUpgradeType::Flags, - LedgerUpgradeType::Config, - LedgerUpgradeType::MaxSorobanTxSetSize, - ]; - pub const VARIANTS_STR: [&'static str; 7] = [ - "Version", - "BaseFee", - "MaxTxSetSize", - "BaseReserve", - "Flags", - "Config", - "MaxSorobanTxSetSize", - ]; +impl StellarValueExt { + pub const VARIANTS: [StellarValueType; 2] = [StellarValueType::Basic, StellarValueType::Signed]; + pub const VARIANTS_STR: [&'static str; 2] = ["Basic", "Signed"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Version(_) => "Version", - Self::BaseFee(_) => "BaseFee", - Self::MaxTxSetSize(_) => "MaxTxSetSize", - Self::BaseReserve(_) => "BaseReserve", - Self::Flags(_) => "Flags", - Self::Config(_) => "Config", - Self::MaxSorobanTxSetSize(_) => "MaxSorobanTxSetSize", + Self::Basic => "Basic", + Self::Signed(_) => "Signed", } } #[must_use] - pub const fn discriminant(&self) -> LedgerUpgradeType { + pub const fn discriminant(&self) -> StellarValueType { #[allow(clippy::match_same_arms)] match self { - Self::Version(_) => LedgerUpgradeType::Version, - Self::BaseFee(_) => LedgerUpgradeType::BaseFee, - Self::MaxTxSetSize(_) => LedgerUpgradeType::MaxTxSetSize, - Self::BaseReserve(_) => LedgerUpgradeType::BaseReserve, - Self::Flags(_) => LedgerUpgradeType::Flags, - Self::Config(_) => LedgerUpgradeType::Config, - Self::MaxSorobanTxSetSize(_) => LedgerUpgradeType::MaxSorobanTxSetSize, + Self::Basic => StellarValueType::Basic, + Self::Signed(_) => StellarValueType::Signed, } } #[must_use] - pub const fn variants() -> [LedgerUpgradeType; 7] { + pub const fn variants() -> [StellarValueType; 2] { Self::VARIANTS } } -impl Name for LedgerUpgrade { +impl Name for StellarValueExt { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for LedgerUpgrade { +impl Discriminant for StellarValueExt { #[must_use] - fn discriminant(&self) -> LedgerUpgradeType { + fn discriminant(&self) -> StellarValueType { Self::discriminant(self) } } -impl Variants for LedgerUpgrade { - fn variants() -> slice::Iter<'static, LedgerUpgradeType> { +impl Variants for StellarValueExt { + fn variants() -> slice::Iter<'static, StellarValueType> { Self::VARIANTS.iter() } } -impl Union for LedgerUpgrade {} +impl Union for StellarValueExt {} -impl ReadXdr for LedgerUpgrade { +impl ReadXdr for StellarValueExt { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: LedgerUpgradeType = ::read_xdr(r)?; + let dv: StellarValueType = ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - LedgerUpgradeType::Version => Self::Version(u32::read_xdr(r)?), - LedgerUpgradeType::BaseFee => Self::BaseFee(u32::read_xdr(r)?), - LedgerUpgradeType::MaxTxSetSize => Self::MaxTxSetSize(u32::read_xdr(r)?), - LedgerUpgradeType::BaseReserve => Self::BaseReserve(u32::read_xdr(r)?), - LedgerUpgradeType::Flags => Self::Flags(u32::read_xdr(r)?), - LedgerUpgradeType::Config => Self::Config(ConfigUpgradeSetKey::read_xdr(r)?), - LedgerUpgradeType::MaxSorobanTxSetSize => { - Self::MaxSorobanTxSetSize(u32::read_xdr(r)?) - } + StellarValueType::Basic => Self::Basic, + StellarValueType::Signed => Self::Signed(LedgerCloseValueSignature::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18794,31 +19124,45 @@ impl ReadXdr for LedgerUpgrade { } } -impl WriteXdr for LedgerUpgrade { +impl WriteXdr for StellarValueExt { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::Version(v) => v.write_xdr(w)?, - Self::BaseFee(v) => v.write_xdr(w)?, - Self::MaxTxSetSize(v) => v.write_xdr(w)?, - Self::BaseReserve(v) => v.write_xdr(w)?, - Self::Flags(v) => v.write_xdr(w)?, - Self::Config(v) => v.write_xdr(w)?, - Self::MaxSorobanTxSetSize(v) => v.write_xdr(w)?, + Self::Basic => ().write_xdr(w)?, + Self::Signed(v) => v.write_xdr(w)?, }; Ok(()) }) } } -/// ConfigUpgradeSet is an XDR Struct defines as: +/// StellarValue is an XDR Struct defines as: /// /// ```text -/// struct ConfigUpgradeSet { -/// ConfigSettingEntry updatedEntry<>; +/// struct StellarValue +/// { +/// Hash txSetHash; // transaction set to apply to previous ledger +/// TimePoint closeTime; // network close time +/// +/// // upgrades to apply to the previous ledger (usually empty) +/// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop +/// // unknown steps during consensus if needed. +/// // see notes below on 'LedgerUpgrade' for more detail +/// // max size is dictated by number of upgrade types (+ room for future) +/// UpgradeType upgrades<6>; +/// +/// // reserved for future use +/// union switch (StellarValueType v) +/// { +/// case STELLAR_VALUE_BASIC: +/// void; +/// case STELLAR_VALUE_SIGNED: +/// LedgerCloseValueSignature lcValueSignature; +/// } +/// ext; /// }; /// ``` /// @@ -18830,39 +19174,56 @@ impl WriteXdr for LedgerUpgrade { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct ConfigUpgradeSet { - pub updated_entry: VecM, +pub struct StellarValue { + pub tx_set_hash: Hash, + pub close_time: TimePoint, + pub upgrades: VecM, + pub ext: StellarValueExt, } -impl ReadXdr for ConfigUpgradeSet { +impl ReadXdr for StellarValue { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - updated_entry: VecM::::read_xdr(r)?, + tx_set_hash: Hash::read_xdr(r)?, + close_time: TimePoint::read_xdr(r)?, + upgrades: VecM::::read_xdr(r)?, + ext: StellarValueExt::read_xdr(r)?, }) }) } } -impl WriteXdr for ConfigUpgradeSet { +impl WriteXdr for StellarValue { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.updated_entry.write_xdr(w)?; + self.tx_set_hash.write_xdr(w)?; + self.close_time.write_xdr(w)?; + self.upgrades.write_xdr(w)?; + self.ext.write_xdr(w)?; Ok(()) }) } } -/// BucketListType is an XDR Enum defines as: +/// MaskLedgerHeaderFlags is an XDR Const defines as: /// /// ```text -/// enum BucketListType +/// const MASK_LEDGER_HEADER_FLAGS = 0x7; +/// ``` +/// +pub const MASK_LEDGER_HEADER_FLAGS: u64 = 0x7; + +/// LedgerHeaderFlags is an XDR Enum defines as: +/// +/// ```text +/// enum LedgerHeaderFlags /// { -/// LIVE = 0, -/// HOT_ARCHIVE = 1, -/// COLD_ARCHIVE = 2 +/// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, +/// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, +/// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 /// }; /// ``` /// @@ -18876,64 +19237,64 @@ impl WriteXdr for ConfigUpgradeSet { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[repr(i32)] -pub enum BucketListType { - Live = 0, - HotArchive = 1, - ColdArchive = 2, +pub enum LedgerHeaderFlags { + TradingFlag = 1, + DepositFlag = 2, + WithdrawalFlag = 4, } -impl BucketListType { - pub const VARIANTS: [BucketListType; 3] = [ - BucketListType::Live, - BucketListType::HotArchive, - BucketListType::ColdArchive, +impl LedgerHeaderFlags { + pub const VARIANTS: [LedgerHeaderFlags; 3] = [ + LedgerHeaderFlags::TradingFlag, + LedgerHeaderFlags::DepositFlag, + LedgerHeaderFlags::WithdrawalFlag, ]; - pub const VARIANTS_STR: [&'static str; 3] = ["Live", "HotArchive", "ColdArchive"]; + pub const VARIANTS_STR: [&'static str; 3] = ["TradingFlag", "DepositFlag", "WithdrawalFlag"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Live => "Live", - Self::HotArchive => "HotArchive", - Self::ColdArchive => "ColdArchive", + Self::TradingFlag => "TradingFlag", + Self::DepositFlag => "DepositFlag", + Self::WithdrawalFlag => "WithdrawalFlag", } } #[must_use] - pub const fn variants() -> [BucketListType; 3] { + pub const fn variants() -> [LedgerHeaderFlags; 3] { Self::VARIANTS } } -impl Name for BucketListType { +impl Name for LedgerHeaderFlags { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for BucketListType { - fn variants() -> slice::Iter<'static, BucketListType> { +impl Variants for LedgerHeaderFlags { + fn variants() -> slice::Iter<'static, LedgerHeaderFlags> { Self::VARIANTS.iter() } } -impl Enum for BucketListType {} +impl Enum for LedgerHeaderFlags {} -impl fmt::Display for BucketListType { +impl fmt::Display for LedgerHeaderFlags { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.name()) } } -impl TryFrom for BucketListType { +impl TryFrom for LedgerHeaderFlags { type Error = Error; fn try_from(i: i32) -> Result { let e = match i { - 0 => BucketListType::Live, - 1 => BucketListType::HotArchive, - 2 => BucketListType::ColdArchive, + 1 => LedgerHeaderFlags::TradingFlag, + 2 => LedgerHeaderFlags::DepositFlag, + 4 => LedgerHeaderFlags::WithdrawalFlag, #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -18941,14 +19302,14 @@ impl TryFrom for BucketListType { } } -impl From for i32 { +impl From for i32 { #[must_use] - fn from(e: BucketListType) -> Self { + fn from(e: LedgerHeaderFlags) -> Self { e as Self } } -impl ReadXdr for BucketListType { +impl ReadXdr for LedgerHeaderFlags { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -18959,7 +19320,7 @@ impl ReadXdr for BucketListType { } } -impl WriteXdr for BucketListType { +impl WriteXdr for LedgerHeaderFlags { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -18969,22 +19330,18 @@ impl WriteXdr for BucketListType { } } -/// BucketEntryType is an XDR Enum defines as: +/// LedgerHeaderExtensionV1Ext is an XDR NestedUnion defines as: /// /// ```text -/// enum BucketEntryType -/// { -/// METAENTRY = -/// -1, // At-and-after protocol 11: bucket metadata, should come first. -/// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -/// // At-and-after protocol 11: only updated. -/// DEADENTRY = 1, -/// INITENTRY = 2 // At-and-after protocol 11: only created. -/// }; +/// union switch (int v) +/// { +/// case 0: +/// void; +/// } /// ``` /// -// enum -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +// union with discriminant i32 +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -18992,227 +19349,141 @@ impl WriteXdr for BucketListType { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[repr(i32)] -pub enum BucketEntryType { - Metaentry = -1, - Liveentry = 0, - Deadentry = 1, - Initentry = 2, +#[allow(clippy::large_enum_variant)] +pub enum LedgerHeaderExtensionV1Ext { + V0, } -impl BucketEntryType { - pub const VARIANTS: [BucketEntryType; 4] = [ - BucketEntryType::Metaentry, - BucketEntryType::Liveentry, - BucketEntryType::Deadentry, - BucketEntryType::Initentry, - ]; - pub const VARIANTS_STR: [&'static str; 4] = - ["Metaentry", "Liveentry", "Deadentry", "Initentry"]; +impl LedgerHeaderExtensionV1Ext { + pub const VARIANTS: [i32; 1] = [0]; + pub const VARIANTS_STR: [&'static str; 1] = ["V0"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Metaentry => "Metaentry", - Self::Liveentry => "Liveentry", - Self::Deadentry => "Deadentry", - Self::Initentry => "Initentry", + Self::V0 => "V0", } } #[must_use] - pub const fn variants() -> [BucketEntryType; 4] { + pub const fn discriminant(&self) -> i32 { + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => 0, + } + } + + #[must_use] + pub const fn variants() -> [i32; 1] { Self::VARIANTS } } -impl Name for BucketEntryType { +impl Name for LedgerHeaderExtensionV1Ext { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Variants for BucketEntryType { - fn variants() -> slice::Iter<'static, BucketEntryType> { - Self::VARIANTS.iter() - } -} - -impl Enum for BucketEntryType {} - -impl fmt::Display for BucketEntryType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.name()) +impl Discriminant for LedgerHeaderExtensionV1Ext { + #[must_use] + fn discriminant(&self) -> i32 { + Self::discriminant(self) } } -impl TryFrom for BucketEntryType { - type Error = Error; - - fn try_from(i: i32) -> Result { - let e = match i { - -1 => BucketEntryType::Metaentry, - 0 => BucketEntryType::Liveentry, - 1 => BucketEntryType::Deadentry, - 2 => BucketEntryType::Initentry, - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(e) +impl Variants for LedgerHeaderExtensionV1Ext { + fn variants() -> slice::Iter<'static, i32> { + Self::VARIANTS.iter() } } -impl From for i32 { - #[must_use] - fn from(e: BucketEntryType) -> Self { - e as Self - } -} +impl Union for LedgerHeaderExtensionV1Ext {} -impl ReadXdr for BucketEntryType { +impl ReadXdr for LedgerHeaderExtensionV1Ext { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let e = i32::read_xdr(r)?; - let v: Self = e.try_into()?; + let dv: i32 = ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + 0 => Self::V0, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; Ok(v) }) } } -impl WriteXdr for BucketEntryType { +impl WriteXdr for LedgerHeaderExtensionV1Ext { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - let i: i32 = (*self).into(); - i.write_xdr(w) + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => ().write_xdr(w)?, + }; + Ok(()) }) } } -/// HotArchiveBucketEntryType is an XDR Enum defines as: +/// LedgerHeaderExtensionV1 is an XDR Struct defines as: /// /// ```text -/// enum HotArchiveBucketEntryType +/// struct LedgerHeaderExtensionV1 /// { -/// HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first. -/// HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived -/// HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but -/// // has been added back to the live BucketList. -/// // Does not need to be persisted. -/// HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive) +/// uint32 flags; // LedgerHeaderFlags +/// +/// union switch (int v) +/// { +/// case 0: +/// void; +/// } +/// ext; /// }; /// ``` /// -// enum -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] -#[cfg_attr( - all(feature = "serde", feature = "alloc"), - derive(serde::Serialize, serde::Deserialize), - serde(rename_all = "snake_case") -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[repr(i32)] -pub enum HotArchiveBucketEntryType { - Metaentry = -1, - Archived = 0, - Live = 1, - Deleted = 2, -} - -impl HotArchiveBucketEntryType { - pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ - HotArchiveBucketEntryType::Metaentry, - HotArchiveBucketEntryType::Archived, - HotArchiveBucketEntryType::Live, - HotArchiveBucketEntryType::Deleted, - ]; - pub const VARIANTS_STR: [&'static str; 4] = ["Metaentry", "Archived", "Live", "Deleted"]; - - #[must_use] - pub const fn name(&self) -> &'static str { - match self { - Self::Metaentry => "Metaentry", - Self::Archived => "Archived", - Self::Live => "Live", - Self::Deleted => "Deleted", - } - } - - #[must_use] - pub const fn variants() -> [HotArchiveBucketEntryType; 4] { - Self::VARIANTS - } -} - -impl Name for HotArchiveBucketEntryType { - #[must_use] - fn name(&self) -> &'static str { - Self::name(self) - } -} - -impl Variants for HotArchiveBucketEntryType { - fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { - Self::VARIANTS.iter() - } -} - -impl Enum for HotArchiveBucketEntryType {} - -impl fmt::Display for HotArchiveBucketEntryType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.name()) - } -} - -impl TryFrom for HotArchiveBucketEntryType { - type Error = Error; - - fn try_from(i: i32) -> Result { - let e = match i { - -1 => HotArchiveBucketEntryType::Metaentry, - 0 => HotArchiveBucketEntryType::Archived, - 1 => HotArchiveBucketEntryType::Live, - 2 => HotArchiveBucketEntryType::Deleted, - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; - Ok(e) - } -} - -impl From for i32 { - #[must_use] - fn from(e: HotArchiveBucketEntryType) -> Self { - e as Self - } +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct LedgerHeaderExtensionV1 { + pub flags: u32, + pub ext: LedgerHeaderExtensionV1Ext, } -impl ReadXdr for HotArchiveBucketEntryType { +impl ReadXdr for LedgerHeaderExtensionV1 { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let e = i32::read_xdr(r)?; - let v: Self = e.try_into()?; - Ok(v) + Ok(Self { + flags: u32::read_xdr(r)?, + ext: LedgerHeaderExtensionV1Ext::read_xdr(r)?, + }) }) } } -impl WriteXdr for HotArchiveBucketEntryType { +impl WriteXdr for LedgerHeaderExtensionV1 { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - let i: i32 = (*self).into(); - i.write_xdr(w) + self.flags.write_xdr(w)?; + self.ext.write_xdr(w)?; + Ok(()) }) } } -/// BucketMetadataExt is an XDR NestedUnion defines as: +/// LedgerHeaderExt is an XDR NestedUnion defines as: /// /// ```text /// union switch (int v) @@ -19220,7 +19491,7 @@ impl WriteXdr for HotArchiveBucketEntryType { /// case 0: /// void; /// case 1: -/// BucketListType bucketListType; +/// LedgerHeaderExtensionV1 v1; /// } /// ``` /// @@ -19234,12 +19505,12 @@ impl WriteXdr for HotArchiveBucketEntryType { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum BucketMetadataExt { +pub enum LedgerHeaderExt { V0, - V1(BucketListType), + V1(LedgerHeaderExtensionV1), } -impl BucketMetadataExt { +impl LedgerHeaderExt { pub const VARIANTS: [i32; 2] = [0, 1]; pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; @@ -19266,29 +19537,29 @@ impl BucketMetadataExt { } } -impl Name for BucketMetadataExt { +impl Name for LedgerHeaderExt { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for BucketMetadataExt { +impl Discriminant for LedgerHeaderExt { #[must_use] fn discriminant(&self) -> i32 { Self::discriminant(self) } } -impl Variants for BucketMetadataExt { +impl Variants for LedgerHeaderExt { fn variants() -> slice::Iter<'static, i32> { Self::VARIANTS.iter() } } -impl Union for BucketMetadataExt {} +impl Union for LedgerHeaderExt {} -impl ReadXdr for BucketMetadataExt { +impl ReadXdr for LedgerHeaderExt { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { @@ -19296,7 +19567,7 @@ impl ReadXdr for BucketMetadataExt { #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { 0 => Self::V0, - 1 => Self::V1(BucketListType::read_xdr(r)?), + 1 => Self::V1(LedgerHeaderExtensionV1::read_xdr(r)?), #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), }; @@ -19305,7 +19576,7 @@ impl ReadXdr for BucketMetadataExt { } } -impl WriteXdr for BucketMetadataExt { +impl WriteXdr for LedgerHeaderExt { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { @@ -19320,13 +19591,37 @@ impl WriteXdr for BucketMetadataExt { } } -/// BucketMetadata is an XDR Struct defines as: +/// LedgerHeader is an XDR Struct defines as: /// /// ```text -/// struct BucketMetadata +/// struct LedgerHeader /// { -/// // Indicates the protocol version used to create / merge this bucket. -/// uint32 ledgerVersion; +/// uint32 ledgerVersion; // the protocol version of the ledger +/// Hash previousLedgerHash; // hash of the previous ledger header +/// StellarValue scpValue; // what consensus agreed to +/// Hash txSetResultHash; // the TransactionResultSet that led to this ledger +/// Hash bucketListHash; // hash of the ledger state +/// +/// uint32 ledgerSeq; // sequence number of this ledger +/// +/// int64 totalCoins; // total number of stroops in existence. +/// // 10,000,000 stroops in 1 XLM +/// +/// int64 feePool; // fees burned since last inflation run +/// uint32 inflationSeq; // inflation sequence number +/// +/// uint64 idPool; // last used global ID, used for generating objects +/// +/// uint32 baseFee; // base fee per operation in stroops +/// uint32 baseReserve; // account base reserve in stroops +/// +/// uint32 maxTxSetSize; // maximum size a transaction set can be +/// +/// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back +/// // in time without walking the chain back ledger by ledger +/// // each slot contains the oldest ledger that is mod of +/// // either 50 5000 50000 or 500000 depending on index +/// // skipList[0] mod(50), skipList[1] mod(5000), etc /// /// // reserved for future use /// union switch (int v) @@ -19334,7 +19629,7 @@ impl WriteXdr for BucketMetadataExt { /// case 0: /// void; /// case 1: -/// BucketListType bucketListType; +/// LedgerHeaderExtensionV1 v1; /// } /// ext; /// }; @@ -19348,52 +19643,90 @@ impl WriteXdr for BucketMetadataExt { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct BucketMetadata { +pub struct LedgerHeader { pub ledger_version: u32, - pub ext: BucketMetadataExt, + pub previous_ledger_hash: Hash, + pub scp_value: StellarValue, + pub tx_set_result_hash: Hash, + pub bucket_list_hash: Hash, + pub ledger_seq: u32, + pub total_coins: i64, + pub fee_pool: i64, + pub inflation_seq: u32, + pub id_pool: u64, + pub base_fee: u32, + pub base_reserve: u32, + pub max_tx_set_size: u32, + pub skip_list: [Hash; 4], + pub ext: LedgerHeaderExt, } -impl ReadXdr for BucketMetadata { +impl ReadXdr for LedgerHeader { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { ledger_version: u32::read_xdr(r)?, - ext: BucketMetadataExt::read_xdr(r)?, + previous_ledger_hash: Hash::read_xdr(r)?, + scp_value: StellarValue::read_xdr(r)?, + tx_set_result_hash: Hash::read_xdr(r)?, + bucket_list_hash: Hash::read_xdr(r)?, + ledger_seq: u32::read_xdr(r)?, + total_coins: i64::read_xdr(r)?, + fee_pool: i64::read_xdr(r)?, + inflation_seq: u32::read_xdr(r)?, + id_pool: u64::read_xdr(r)?, + base_fee: u32::read_xdr(r)?, + base_reserve: u32::read_xdr(r)?, + max_tx_set_size: u32::read_xdr(r)?, + skip_list: <[Hash; 4]>::read_xdr(r)?, + ext: LedgerHeaderExt::read_xdr(r)?, }) }) } } -impl WriteXdr for BucketMetadata { +impl WriteXdr for LedgerHeader { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.ledger_version.write_xdr(w)?; + self.previous_ledger_hash.write_xdr(w)?; + self.scp_value.write_xdr(w)?; + self.tx_set_result_hash.write_xdr(w)?; + self.bucket_list_hash.write_xdr(w)?; + self.ledger_seq.write_xdr(w)?; + self.total_coins.write_xdr(w)?; + self.fee_pool.write_xdr(w)?; + self.inflation_seq.write_xdr(w)?; + self.id_pool.write_xdr(w)?; + self.base_fee.write_xdr(w)?; + self.base_reserve.write_xdr(w)?; + self.max_tx_set_size.write_xdr(w)?; + self.skip_list.write_xdr(w)?; self.ext.write_xdr(w)?; Ok(()) }) } } -/// BucketEntry is an XDR Union defines as: +/// LedgerUpgradeType is an XDR Enum defines as: /// /// ```text -/// union BucketEntry switch (BucketEntryType type) +/// enum LedgerUpgradeType /// { -/// case LIVEENTRY: -/// case INITENTRY: -/// LedgerEntry liveEntry; -/// -/// case DEADENTRY: -/// LedgerKey deadEntry; -/// case METAENTRY: -/// BucketMetadata metaEntry; +/// LEDGER_UPGRADE_VERSION = 1, +/// LEDGER_UPGRADE_BASE_FEE = 2, +/// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, +/// LEDGER_UPGRADE_BASE_RESERVE = 4, +/// LEDGER_UPGRADE_FLAGS = 5, +/// LEDGER_UPGRADE_CONFIG = 6, +/// LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 /// }; /// ``` /// -// union with discriminant BucketEntryType -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( all(feature = "serde", feature = "alloc"), @@ -19401,126 +19734,195 @@ impl WriteXdr for BucketMetadata { serde(rename_all = "snake_case") )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[allow(clippy::large_enum_variant)] -pub enum BucketEntry { - Liveentry(LedgerEntry), - Initentry(LedgerEntry), - Deadentry(LedgerKey), - Metaentry(BucketMetadata), +#[repr(i32)] +pub enum LedgerUpgradeType { + Version = 1, + BaseFee = 2, + MaxTxSetSize = 3, + BaseReserve = 4, + Flags = 5, + Config = 6, + MaxSorobanTxSetSize = 7, } -impl BucketEntry { - pub const VARIANTS: [BucketEntryType; 4] = [ - BucketEntryType::Liveentry, - BucketEntryType::Initentry, - BucketEntryType::Deadentry, - BucketEntryType::Metaentry, +impl LedgerUpgradeType { + pub const VARIANTS: [LedgerUpgradeType; 7] = [ + LedgerUpgradeType::Version, + LedgerUpgradeType::BaseFee, + LedgerUpgradeType::MaxTxSetSize, + LedgerUpgradeType::BaseReserve, + LedgerUpgradeType::Flags, + LedgerUpgradeType::Config, + LedgerUpgradeType::MaxSorobanTxSetSize, + ]; + pub const VARIANTS_STR: [&'static str; 7] = [ + "Version", + "BaseFee", + "MaxTxSetSize", + "BaseReserve", + "Flags", + "Config", + "MaxSorobanTxSetSize", ]; - pub const VARIANTS_STR: [&'static str; 4] = - ["Liveentry", "Initentry", "Deadentry", "Metaentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Liveentry(_) => "Liveentry", - Self::Initentry(_) => "Initentry", - Self::Deadentry(_) => "Deadentry", - Self::Metaentry(_) => "Metaentry", - } - } - - #[must_use] - pub const fn discriminant(&self) -> BucketEntryType { - #[allow(clippy::match_same_arms)] - match self { - Self::Liveentry(_) => BucketEntryType::Liveentry, - Self::Initentry(_) => BucketEntryType::Initentry, - Self::Deadentry(_) => BucketEntryType::Deadentry, - Self::Metaentry(_) => BucketEntryType::Metaentry, + Self::Version => "Version", + Self::BaseFee => "BaseFee", + Self::MaxTxSetSize => "MaxTxSetSize", + Self::BaseReserve => "BaseReserve", + Self::Flags => "Flags", + Self::Config => "Config", + Self::MaxSorobanTxSetSize => "MaxSorobanTxSetSize", } } #[must_use] - pub const fn variants() -> [BucketEntryType; 4] { + pub const fn variants() -> [LedgerUpgradeType; 7] { Self::VARIANTS } } -impl Name for BucketEntry { +impl Name for LedgerUpgradeType { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for BucketEntry { - #[must_use] - fn discriminant(&self) -> BucketEntryType { - Self::discriminant(self) +impl Variants for LedgerUpgradeType { + fn variants() -> slice::Iter<'static, LedgerUpgradeType> { + Self::VARIANTS.iter() } } -impl Variants for BucketEntry { - fn variants() -> slice::Iter<'static, BucketEntryType> { - Self::VARIANTS.iter() +impl Enum for LedgerUpgradeType {} + +impl fmt::Display for LedgerUpgradeType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) } } -impl Union for BucketEntry {} +impl TryFrom for LedgerUpgradeType { + type Error = Error; -impl ReadXdr for BucketEntry { + fn try_from(i: i32) -> Result { + let e = match i { + 1 => LedgerUpgradeType::Version, + 2 => LedgerUpgradeType::BaseFee, + 3 => LedgerUpgradeType::MaxTxSetSize, + 4 => LedgerUpgradeType::BaseReserve, + 5 => LedgerUpgradeType::Flags, + 6 => LedgerUpgradeType::Config, + 7 => LedgerUpgradeType::MaxSorobanTxSetSize, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) + } +} + +impl From for i32 { + #[must_use] + fn from(e: LedgerUpgradeType) -> Self { + e as Self + } +} + +impl ReadXdr for LedgerUpgradeType { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: BucketEntryType = ::read_xdr(r)?; - #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] - let v = match dv { - BucketEntryType::Liveentry => Self::Liveentry(LedgerEntry::read_xdr(r)?), - BucketEntryType::Initentry => Self::Initentry(LedgerEntry::read_xdr(r)?), - BucketEntryType::Deadentry => Self::Deadentry(LedgerKey::read_xdr(r)?), - BucketEntryType::Metaentry => Self::Metaentry(BucketMetadata::read_xdr(r)?), - #[allow(unreachable_patterns)] - _ => return Err(Error::Invalid), - }; + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; Ok(v) }) } } -impl WriteXdr for BucketEntry { +impl WriteXdr for LedgerUpgradeType { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { - self.discriminant().write_xdr(w)?; - #[allow(clippy::match_same_arms)] - match self { - Self::Liveentry(v) => v.write_xdr(w)?, - Self::Initentry(v) => v.write_xdr(w)?, - Self::Deadentry(v) => v.write_xdr(w)?, - Self::Metaentry(v) => v.write_xdr(w)?, - }; + let i: i32 = (*self).into(); + i.write_xdr(w) + }) + } +} + +/// ConfigUpgradeSetKey is an XDR Struct defines as: +/// +/// ```text +/// struct ConfigUpgradeSetKey { +/// Hash contractID; +/// Hash contentHash; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ConfigUpgradeSetKey { + pub contract_id: Hash, + pub content_hash: Hash, +} + +impl ReadXdr for ConfigUpgradeSetKey { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + contract_id: Hash::read_xdr(r)?, + content_hash: Hash::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ConfigUpgradeSetKey { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.contract_id.write_xdr(w)?; + self.content_hash.write_xdr(w)?; Ok(()) }) } } -/// HotArchiveBucketEntry is an XDR Union defines as: +/// LedgerUpgrade is an XDR Union defines as: /// /// ```text -/// union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type) +/// union LedgerUpgrade switch (LedgerUpgradeType type) /// { -/// case HOT_ARCHIVE_ARCHIVED: -/// LedgerEntry archivedEntry; -/// -/// case HOT_ARCHIVE_LIVE: -/// case HOT_ARCHIVE_DELETED: -/// LedgerKey key; -/// case HOT_ARCHIVE_METAENTRY: -/// BucketMetadata metaEntry; +/// case LEDGER_UPGRADE_VERSION: +/// uint32 newLedgerVersion; // update ledgerVersion +/// case LEDGER_UPGRADE_BASE_FEE: +/// uint32 newBaseFee; // update baseFee +/// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: +/// uint32 newMaxTxSetSize; // update maxTxSetSize +/// case LEDGER_UPGRADE_BASE_RESERVE: +/// uint32 newBaseReserve; // update baseReserve +/// case LEDGER_UPGRADE_FLAGS: +/// uint32 newFlags; // update flags +/// case LEDGER_UPGRADE_CONFIG: +/// // Update arbitrary `ConfigSetting` entries identified by the key. +/// ConfigUpgradeSetKey newConfig; +/// case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: +/// // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without +/// // using `LEDGER_UPGRADE_CONFIG`. +/// uint32 newMaxSorobanTxSetSize; /// }; /// ``` /// -// union with discriminant HotArchiveBucketEntryType +// union with discriminant LedgerUpgradeType #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] #[cfg_attr( @@ -19530,84 +19932,106 @@ impl WriteXdr for BucketEntry { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[allow(clippy::large_enum_variant)] -pub enum HotArchiveBucketEntry { - Archived(LedgerEntry), - Live(LedgerKey), - Deleted(LedgerKey), - Metaentry(BucketMetadata), +pub enum LedgerUpgrade { + Version(u32), + BaseFee(u32), + MaxTxSetSize(u32), + BaseReserve(u32), + Flags(u32), + Config(ConfigUpgradeSetKey), + MaxSorobanTxSetSize(u32), } -impl HotArchiveBucketEntry { - pub const VARIANTS: [HotArchiveBucketEntryType; 4] = [ - HotArchiveBucketEntryType::Archived, - HotArchiveBucketEntryType::Live, - HotArchiveBucketEntryType::Deleted, - HotArchiveBucketEntryType::Metaentry, +impl LedgerUpgrade { + pub const VARIANTS: [LedgerUpgradeType; 7] = [ + LedgerUpgradeType::Version, + LedgerUpgradeType::BaseFee, + LedgerUpgradeType::MaxTxSetSize, + LedgerUpgradeType::BaseReserve, + LedgerUpgradeType::Flags, + LedgerUpgradeType::Config, + LedgerUpgradeType::MaxSorobanTxSetSize, + ]; + pub const VARIANTS_STR: [&'static str; 7] = [ + "Version", + "BaseFee", + "MaxTxSetSize", + "BaseReserve", + "Flags", + "Config", + "MaxSorobanTxSetSize", ]; - pub const VARIANTS_STR: [&'static str; 4] = ["Archived", "Live", "Deleted", "Metaentry"]; #[must_use] pub const fn name(&self) -> &'static str { match self { - Self::Archived(_) => "Archived", - Self::Live(_) => "Live", - Self::Deleted(_) => "Deleted", - Self::Metaentry(_) => "Metaentry", + Self::Version(_) => "Version", + Self::BaseFee(_) => "BaseFee", + Self::MaxTxSetSize(_) => "MaxTxSetSize", + Self::BaseReserve(_) => "BaseReserve", + Self::Flags(_) => "Flags", + Self::Config(_) => "Config", + Self::MaxSorobanTxSetSize(_) => "MaxSorobanTxSetSize", } } #[must_use] - pub const fn discriminant(&self) -> HotArchiveBucketEntryType { + pub const fn discriminant(&self) -> LedgerUpgradeType { #[allow(clippy::match_same_arms)] match self { - Self::Archived(_) => HotArchiveBucketEntryType::Archived, - Self::Live(_) => HotArchiveBucketEntryType::Live, - Self::Deleted(_) => HotArchiveBucketEntryType::Deleted, - Self::Metaentry(_) => HotArchiveBucketEntryType::Metaentry, + Self::Version(_) => LedgerUpgradeType::Version, + Self::BaseFee(_) => LedgerUpgradeType::BaseFee, + Self::MaxTxSetSize(_) => LedgerUpgradeType::MaxTxSetSize, + Self::BaseReserve(_) => LedgerUpgradeType::BaseReserve, + Self::Flags(_) => LedgerUpgradeType::Flags, + Self::Config(_) => LedgerUpgradeType::Config, + Self::MaxSorobanTxSetSize(_) => LedgerUpgradeType::MaxSorobanTxSetSize, } } #[must_use] - pub const fn variants() -> [HotArchiveBucketEntryType; 4] { + pub const fn variants() -> [LedgerUpgradeType; 7] { Self::VARIANTS } } -impl Name for HotArchiveBucketEntry { +impl Name for LedgerUpgrade { #[must_use] fn name(&self) -> &'static str { Self::name(self) } } -impl Discriminant for HotArchiveBucketEntry { +impl Discriminant for LedgerUpgrade { #[must_use] - fn discriminant(&self) -> HotArchiveBucketEntryType { + fn discriminant(&self) -> LedgerUpgradeType { Self::discriminant(self) } } -impl Variants for HotArchiveBucketEntry { - fn variants() -> slice::Iter<'static, HotArchiveBucketEntryType> { +impl Variants for LedgerUpgrade { + fn variants() -> slice::Iter<'static, LedgerUpgradeType> { Self::VARIANTS.iter() } } -impl Union for HotArchiveBucketEntry {} +impl Union for LedgerUpgrade {} -impl ReadXdr for HotArchiveBucketEntry { +impl ReadXdr for LedgerUpgrade { #[cfg(feature = "std")] fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { - let dv: HotArchiveBucketEntryType = - ::read_xdr(r)?; + let dv: LedgerUpgradeType = ::read_xdr(r)?; #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] let v = match dv { - HotArchiveBucketEntryType::Archived => Self::Archived(LedgerEntry::read_xdr(r)?), - HotArchiveBucketEntryType::Live => Self::Live(LedgerKey::read_xdr(r)?), - HotArchiveBucketEntryType::Deleted => Self::Deleted(LedgerKey::read_xdr(r)?), - HotArchiveBucketEntryType::Metaentry => { - Self::Metaentry(BucketMetadata::read_xdr(r)?) + LedgerUpgradeType::Version => Self::Version(u32::read_xdr(r)?), + LedgerUpgradeType::BaseFee => Self::BaseFee(u32::read_xdr(r)?), + LedgerUpgradeType::MaxTxSetSize => Self::MaxTxSetSize(u32::read_xdr(r)?), + LedgerUpgradeType::BaseReserve => Self::BaseReserve(u32::read_xdr(r)?), + LedgerUpgradeType::Flags => Self::Flags(u32::read_xdr(r)?), + LedgerUpgradeType::Config => Self::Config(ConfigUpgradeSetKey::read_xdr(r)?), + LedgerUpgradeType::MaxSorobanTxSetSize => { + Self::MaxSorobanTxSetSize(u32::read_xdr(r)?) } #[allow(unreachable_patterns)] _ => return Err(Error::Invalid), @@ -19617,23 +20041,67 @@ impl ReadXdr for HotArchiveBucketEntry { } } -impl WriteXdr for HotArchiveBucketEntry { +impl WriteXdr for LedgerUpgrade { #[cfg(feature = "std")] fn write_xdr(&self, w: &mut Limited) -> Result<()> { w.with_limited_depth(|w| { self.discriminant().write_xdr(w)?; #[allow(clippy::match_same_arms)] match self { - Self::Archived(v) => v.write_xdr(w)?, - Self::Live(v) => v.write_xdr(w)?, - Self::Deleted(v) => v.write_xdr(w)?, - Self::Metaentry(v) => v.write_xdr(w)?, + Self::Version(v) => v.write_xdr(w)?, + Self::BaseFee(v) => v.write_xdr(w)?, + Self::MaxTxSetSize(v) => v.write_xdr(w)?, + Self::BaseReserve(v) => v.write_xdr(w)?, + Self::Flags(v) => v.write_xdr(w)?, + Self::Config(v) => v.write_xdr(w)?, + Self::MaxSorobanTxSetSize(v) => v.write_xdr(w)?, }; Ok(()) }) } } +/// ConfigUpgradeSet is an XDR Struct defines as: +/// +/// ```text +/// struct ConfigUpgradeSet { +/// ConfigSettingEntry updatedEntry<>; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ConfigUpgradeSet { + pub updated_entry: VecM, +} + +impl ReadXdr for ConfigUpgradeSet { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + updated_entry: VecM::::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ConfigUpgradeSet { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.updated_entry.write_xdr(w)?; + Ok(()) + }) + } +} + /// TxSetComponentType is an XDR Enum defines as: /// /// ```text @@ -31618,6 +32086,339 @@ impl WriteXdr for LedgerFootprint { } } +/// ArchivalProofType is an XDR Enum defines as: +/// +/// ```text +/// enum ArchivalProofType +/// { +/// EXISTENCE = 0, +/// NONEXISTENCE = 1 +/// }; +/// ``` +/// +// enum +#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[repr(i32)] +pub enum ArchivalProofType { + Existence = 0, + Nonexistence = 1, +} + +impl ArchivalProofType { + pub const VARIANTS: [ArchivalProofType; 2] = [ + ArchivalProofType::Existence, + ArchivalProofType::Nonexistence, + ]; + pub const VARIANTS_STR: [&'static str; 2] = ["Existence", "Nonexistence"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::Existence => "Existence", + Self::Nonexistence => "Nonexistence", + } + } + + #[must_use] + pub const fn variants() -> [ArchivalProofType; 2] { + Self::VARIANTS + } +} + +impl Name for ArchivalProofType { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Variants for ArchivalProofType { + fn variants() -> slice::Iter<'static, ArchivalProofType> { + Self::VARIANTS.iter() + } +} + +impl Enum for ArchivalProofType {} + +impl fmt::Display for ArchivalProofType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.name()) + } +} + +impl TryFrom for ArchivalProofType { + type Error = Error; + + fn try_from(i: i32) -> Result { + let e = match i { + 0 => ArchivalProofType::Existence, + 1 => ArchivalProofType::Nonexistence, + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(e) + } +} + +impl From for i32 { + #[must_use] + fn from(e: ArchivalProofType) -> Self { + e as Self + } +} + +impl ReadXdr for ArchivalProofType { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let e = i32::read_xdr(r)?; + let v: Self = e.try_into()?; + Ok(v) + }) + } +} + +impl WriteXdr for ArchivalProofType { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + let i: i32 = (*self).into(); + i.write_xdr(w) + }) + } +} + +/// ArchivalProofNode is an XDR Struct defines as: +/// +/// ```text +/// struct ArchivalProofNode +/// { +/// uint32 index; +/// Hash hash; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ArchivalProofNode { + pub index: u32, + pub hash: Hash, +} + +impl ReadXdr for ArchivalProofNode { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + index: u32::read_xdr(r)?, + hash: Hash::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ArchivalProofNode { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.index.write_xdr(w)?; + self.hash.write_xdr(w)?; + Ok(()) + }) + } +} + +/// ProofLevel is an XDR Typedef defines as: +/// +/// ```text +/// typedef ArchivalProofNode ProofLevel<>; +/// ``` +/// +#[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[derive(Default)] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[derive(Debug)] +pub struct ProofLevel(pub VecM); + +impl From for VecM { + #[must_use] + fn from(x: ProofLevel) -> Self { + x.0 + } +} + +impl From> for ProofLevel { + #[must_use] + fn from(x: VecM) -> Self { + ProofLevel(x) + } +} + +impl AsRef> for ProofLevel { + #[must_use] + fn as_ref(&self) -> &VecM { + &self.0 + } +} + +impl ReadXdr for ProofLevel { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let i = VecM::::read_xdr(r)?; + let v = ProofLevel(i); + Ok(v) + }) + } +} + +impl WriteXdr for ProofLevel { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| self.0.write_xdr(w)) + } +} + +impl Deref for ProofLevel { + type Target = VecM; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From for Vec { + #[must_use] + fn from(x: ProofLevel) -> Self { + x.0 .0 + } +} + +impl TryFrom> for ProofLevel { + type Error = Error; + fn try_from(x: Vec) -> Result { + Ok(ProofLevel(x.try_into()?)) + } +} + +#[cfg(feature = "alloc")] +impl TryFrom<&Vec> for ProofLevel { + type Error = Error; + fn try_from(x: &Vec) -> Result { + Ok(ProofLevel(x.try_into()?)) + } +} + +impl AsRef> for ProofLevel { + #[must_use] + fn as_ref(&self) -> &Vec { + &self.0 .0 + } +} + +impl AsRef<[ArchivalProofNode]> for ProofLevel { + #[cfg(feature = "alloc")] + #[must_use] + fn as_ref(&self) -> &[ArchivalProofNode] { + &self.0 .0 + } + #[cfg(not(feature = "alloc"))] + #[must_use] + fn as_ref(&self) -> &[ArchivalProofNode] { + self.0 .0 + } +} + +/// ArchivalProof is an XDR Struct defines as: +/// +/// ```text +/// struct ArchivalProof +/// { +/// uint32 epoch; // AST Subtree for this proof +/// +/// union switch (ArchivalProofType t) +/// { +/// case EXISTENCE: +/// struct +/// { +/// ColdArchiveBucketEntry entriesToProve<>; +/// +/// // Vector of vectors, where proofLevels[level] +/// // contains all HashNodes that correspond with that level +/// ProofLevel proofLevels<>; +/// } existenceProof; +/// case NONEXISTENCE: +/// struct +/// { +/// LedgerKey keysToProve<>; +/// +/// // Bounds for each key being proved, where bound[n] +/// // corresponds to keysToProve[n] +/// ColdArchiveBucketEntry lowBoundEntries<>; +/// ColdArchiveBucketEntry highBoundEntries<>; +/// +/// // Vector of vectors, where proofLevels[level] +/// // contains all HashNodes that correspond with that level +/// ProofLevel proofLevels<>; +/// } nonexistenceProof; +/// } type; +/// }; +/// ``` +/// +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +pub struct ArchivalProof { + pub epoch: u32, + pub type_: ArchivalProofType, +} + +impl ReadXdr for ArchivalProof { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + Ok(Self { + epoch: u32::read_xdr(r)?, + type_: ArchivalProofType::read_xdr(r)?, + }) + }) + } +} + +impl WriteXdr for ArchivalProof { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.epoch.write_xdr(w)?; + self.type_.write_xdr(w)?; + Ok(()) + }) + } +} + /// SorobanResources is an XDR Struct defines as: /// /// ```text @@ -31677,12 +32478,126 @@ impl WriteXdr for SorobanResources { } } +/// SorobanTransactionDataExt is an XDR NestedUnion defines as: +/// +/// ```text +/// union switch (int v) +/// { +/// case 0: +/// void; +/// case 1: +/// ArchivalProof proofs<>; +/// } +/// ``` +/// +// union with discriminant i32 +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[cfg_attr(feature = "arbitrary", derive(Arbitrary))] +#[cfg_attr( + all(feature = "serde", feature = "alloc"), + derive(serde::Serialize, serde::Deserialize), + serde(rename_all = "snake_case") +)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[allow(clippy::large_enum_variant)] +pub enum SorobanTransactionDataExt { + V0, + V1(VecM), +} + +impl SorobanTransactionDataExt { + pub const VARIANTS: [i32; 2] = [0, 1]; + pub const VARIANTS_STR: [&'static str; 2] = ["V0", "V1"]; + + #[must_use] + pub const fn name(&self) -> &'static str { + match self { + Self::V0 => "V0", + Self::V1(_) => "V1", + } + } + + #[must_use] + pub const fn discriminant(&self) -> i32 { + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => 0, + Self::V1(_) => 1, + } + } + + #[must_use] + pub const fn variants() -> [i32; 2] { + Self::VARIANTS + } +} + +impl Name for SorobanTransactionDataExt { + #[must_use] + fn name(&self) -> &'static str { + Self::name(self) + } +} + +impl Discriminant for SorobanTransactionDataExt { + #[must_use] + fn discriminant(&self) -> i32 { + Self::discriminant(self) + } +} + +impl Variants for SorobanTransactionDataExt { + fn variants() -> slice::Iter<'static, i32> { + Self::VARIANTS.iter() + } +} + +impl Union for SorobanTransactionDataExt {} + +impl ReadXdr for SorobanTransactionDataExt { + #[cfg(feature = "std")] + fn read_xdr(r: &mut Limited) -> Result { + r.with_limited_depth(|r| { + let dv: i32 = ::read_xdr(r)?; + #[allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] + let v = match dv { + 0 => Self::V0, + 1 => Self::V1(VecM::::read_xdr(r)?), + #[allow(unreachable_patterns)] + _ => return Err(Error::Invalid), + }; + Ok(v) + }) + } +} + +impl WriteXdr for SorobanTransactionDataExt { + #[cfg(feature = "std")] + fn write_xdr(&self, w: &mut Limited) -> Result<()> { + w.with_limited_depth(|w| { + self.discriminant().write_xdr(w)?; + #[allow(clippy::match_same_arms)] + match self { + Self::V0 => ().write_xdr(w)?, + Self::V1(v) => v.write_xdr(w)?, + }; + Ok(()) + }) + } +} + /// SorobanTransactionData is an XDR Struct defines as: /// /// ```text /// struct SorobanTransactionData /// { -/// ExtensionPoint ext; +/// union switch (int v) +/// { +/// case 0: +/// void; +/// case 1: +/// ArchivalProof proofs<>; +/// } ext; /// SorobanResources resources; /// // Amount of the transaction `fee` allocated to the Soroban resource fees. /// // The fraction of `resourceFee` corresponding to `resources` specified @@ -31706,7 +32621,7 @@ impl WriteXdr for SorobanResources { )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SorobanTransactionData { - pub ext: ExtensionPoint, + pub ext: SorobanTransactionDataExt, pub resources: SorobanResources, pub resource_fee: i64, } @@ -31716,7 +32631,7 @@ impl ReadXdr for SorobanTransactionData { fn read_xdr(r: &mut Limited) -> Result { r.with_limited_depth(|r| { Ok(Self { - ext: ExtensionPoint::read_xdr(r)?, + ext: SorobanTransactionDataExt::read_xdr(r)?, resources: SorobanResources::read_xdr(r)?, resource_fee: i64::read_xdr(r)?, }) @@ -45459,6 +46374,19 @@ pub enum TypeVariant { LedgerKeyConfigSetting, LedgerKeyTtl, EnvelopeType, + BucketListType, + BucketEntryType, + HotArchiveBucketEntryType, + ColdArchiveBucketEntryType, + BucketMetadata, + BucketMetadataExt, + BucketEntry, + HotArchiveBucketEntry, + ColdArchiveArchivedLeaf, + ColdArchiveDeletedLeaf, + ColdArchiveBoundaryLeaf, + ColdArchiveHashEntry, + ColdArchiveBucketEntry, UpgradeType, StellarValueType, LedgerCloseValueSignature, @@ -45473,13 +46401,6 @@ pub enum TypeVariant { ConfigUpgradeSetKey, LedgerUpgrade, ConfigUpgradeSet, - BucketListType, - BucketEntryType, - HotArchiveBucketEntryType, - BucketMetadata, - BucketMetadataExt, - BucketEntry, - HotArchiveBucketEntry, TxSetComponentType, TxExecutionThread, ParallelTxExecutionStage, @@ -45630,8 +46551,15 @@ pub enum TypeVariant { PreconditionType, Preconditions, LedgerFootprint, + ArchivalProofType, + ArchivalProofNode, + ProofLevel, + ArchivalProof, + ArchivalProofExistenceProof, + ArchivalProofNonexistenceProof, SorobanResources, SorobanTransactionData, + SorobanTransactionDataExt, TransactionV0, TransactionV0Ext, TransactionV0Envelope, @@ -45749,7 +46677,7 @@ pub enum TypeVariant { } impl TypeVariant { - pub const VARIANTS: [TypeVariant; 448] = [ + pub const VARIANTS: [TypeVariant; 461] = [ TypeVariant::Value, TypeVariant::ScpBallot, TypeVariant::ScpStatementType, @@ -45911,6 +46839,19 @@ impl TypeVariant { TypeVariant::LedgerKeyConfigSetting, TypeVariant::LedgerKeyTtl, TypeVariant::EnvelopeType, + TypeVariant::BucketListType, + TypeVariant::BucketEntryType, + TypeVariant::HotArchiveBucketEntryType, + TypeVariant::ColdArchiveBucketEntryType, + TypeVariant::BucketMetadata, + TypeVariant::BucketMetadataExt, + TypeVariant::BucketEntry, + TypeVariant::HotArchiveBucketEntry, + TypeVariant::ColdArchiveArchivedLeaf, + TypeVariant::ColdArchiveDeletedLeaf, + TypeVariant::ColdArchiveBoundaryLeaf, + TypeVariant::ColdArchiveHashEntry, + TypeVariant::ColdArchiveBucketEntry, TypeVariant::UpgradeType, TypeVariant::StellarValueType, TypeVariant::LedgerCloseValueSignature, @@ -45925,13 +46866,6 @@ impl TypeVariant { TypeVariant::ConfigUpgradeSetKey, TypeVariant::LedgerUpgrade, TypeVariant::ConfigUpgradeSet, - TypeVariant::BucketListType, - TypeVariant::BucketEntryType, - TypeVariant::HotArchiveBucketEntryType, - TypeVariant::BucketMetadata, - TypeVariant::BucketMetadataExt, - TypeVariant::BucketEntry, - TypeVariant::HotArchiveBucketEntry, TypeVariant::TxSetComponentType, TypeVariant::TxExecutionThread, TypeVariant::ParallelTxExecutionStage, @@ -46082,8 +47016,15 @@ impl TypeVariant { TypeVariant::PreconditionType, TypeVariant::Preconditions, TypeVariant::LedgerFootprint, + TypeVariant::ArchivalProofType, + TypeVariant::ArchivalProofNode, + TypeVariant::ProofLevel, + TypeVariant::ArchivalProof, + TypeVariant::ArchivalProofExistenceProof, + TypeVariant::ArchivalProofNonexistenceProof, TypeVariant::SorobanResources, TypeVariant::SorobanTransactionData, + TypeVariant::SorobanTransactionDataExt, TypeVariant::TransactionV0, TypeVariant::TransactionV0Ext, TypeVariant::TransactionV0Envelope, @@ -46199,7 +47140,7 @@ impl TypeVariant { TypeVariant::BinaryFuseFilterType, TypeVariant::SerializedBinaryFuseFilter, ]; - pub const VARIANTS_STR: [&'static str; 448] = [ + pub const VARIANTS_STR: [&'static str; 461] = [ "Value", "ScpBallot", "ScpStatementType", @@ -46361,6 +47302,19 @@ impl TypeVariant { "LedgerKeyConfigSetting", "LedgerKeyTtl", "EnvelopeType", + "BucketListType", + "BucketEntryType", + "HotArchiveBucketEntryType", + "ColdArchiveBucketEntryType", + "BucketMetadata", + "BucketMetadataExt", + "BucketEntry", + "HotArchiveBucketEntry", + "ColdArchiveArchivedLeaf", + "ColdArchiveDeletedLeaf", + "ColdArchiveBoundaryLeaf", + "ColdArchiveHashEntry", + "ColdArchiveBucketEntry", "UpgradeType", "StellarValueType", "LedgerCloseValueSignature", @@ -46375,13 +47329,6 @@ impl TypeVariant { "ConfigUpgradeSetKey", "LedgerUpgrade", "ConfigUpgradeSet", - "BucketListType", - "BucketEntryType", - "HotArchiveBucketEntryType", - "BucketMetadata", - "BucketMetadataExt", - "BucketEntry", - "HotArchiveBucketEntry", "TxSetComponentType", "TxExecutionThread", "ParallelTxExecutionStage", @@ -46532,8 +47479,15 @@ impl TypeVariant { "PreconditionType", "Preconditions", "LedgerFootprint", + "ArchivalProofType", + "ArchivalProofNode", + "ProofLevel", + "ArchivalProof", + "ArchivalProofExistenceProof", + "ArchivalProofNonexistenceProof", "SorobanResources", "SorobanTransactionData", + "SorobanTransactionDataExt", "TransactionV0", "TransactionV0Ext", "TransactionV0Envelope", @@ -46819,6 +47773,19 @@ impl TypeVariant { Self::LedgerKeyConfigSetting => "LedgerKeyConfigSetting", Self::LedgerKeyTtl => "LedgerKeyTtl", Self::EnvelopeType => "EnvelopeType", + Self::BucketListType => "BucketListType", + Self::BucketEntryType => "BucketEntryType", + Self::HotArchiveBucketEntryType => "HotArchiveBucketEntryType", + Self::ColdArchiveBucketEntryType => "ColdArchiveBucketEntryType", + Self::BucketMetadata => "BucketMetadata", + Self::BucketMetadataExt => "BucketMetadataExt", + Self::BucketEntry => "BucketEntry", + Self::HotArchiveBucketEntry => "HotArchiveBucketEntry", + Self::ColdArchiveArchivedLeaf => "ColdArchiveArchivedLeaf", + Self::ColdArchiveDeletedLeaf => "ColdArchiveDeletedLeaf", + Self::ColdArchiveBoundaryLeaf => "ColdArchiveBoundaryLeaf", + Self::ColdArchiveHashEntry => "ColdArchiveHashEntry", + Self::ColdArchiveBucketEntry => "ColdArchiveBucketEntry", Self::UpgradeType => "UpgradeType", Self::StellarValueType => "StellarValueType", Self::LedgerCloseValueSignature => "LedgerCloseValueSignature", @@ -46833,13 +47800,6 @@ impl TypeVariant { Self::ConfigUpgradeSetKey => "ConfigUpgradeSetKey", Self::LedgerUpgrade => "LedgerUpgrade", Self::ConfigUpgradeSet => "ConfigUpgradeSet", - Self::BucketListType => "BucketListType", - Self::BucketEntryType => "BucketEntryType", - Self::HotArchiveBucketEntryType => "HotArchiveBucketEntryType", - Self::BucketMetadata => "BucketMetadata", - Self::BucketMetadataExt => "BucketMetadataExt", - Self::BucketEntry => "BucketEntry", - Self::HotArchiveBucketEntry => "HotArchiveBucketEntry", Self::TxSetComponentType => "TxSetComponentType", Self::TxExecutionThread => "TxExecutionThread", Self::ParallelTxExecutionStage => "ParallelTxExecutionStage", @@ -46996,8 +47956,15 @@ impl TypeVariant { Self::PreconditionType => "PreconditionType", Self::Preconditions => "Preconditions", Self::LedgerFootprint => "LedgerFootprint", + Self::ArchivalProofType => "ArchivalProofType", + Self::ArchivalProofNode => "ArchivalProofNode", + Self::ProofLevel => "ProofLevel", + Self::ArchivalProof => "ArchivalProof", + Self::ArchivalProofExistenceProof => "ArchivalProofExistenceProof", + Self::ArchivalProofNonexistenceProof => "ArchivalProofNonexistenceProof", Self::SorobanResources => "SorobanResources", Self::SorobanTransactionData => "SorobanTransactionData", + Self::SorobanTransactionDataExt => "SorobanTransactionDataExt", Self::TransactionV0 => "TransactionV0", Self::TransactionV0Ext => "TransactionV0Ext", Self::TransactionV0Envelope => "TransactionV0Envelope", @@ -47121,7 +48088,7 @@ impl TypeVariant { #[must_use] #[allow(clippy::too_many_lines)] - pub const fn variants() -> [TypeVariant; 448] { + pub const fn variants() -> [TypeVariant; 461] { Self::VARIANTS } @@ -47337,6 +48304,23 @@ impl TypeVariant { Self::LedgerKeyConfigSetting => gen.into_root_schema_for::(), Self::LedgerKeyTtl => gen.into_root_schema_for::(), Self::EnvelopeType => gen.into_root_schema_for::(), + Self::BucketListType => gen.into_root_schema_for::(), + Self::BucketEntryType => gen.into_root_schema_for::(), + Self::HotArchiveBucketEntryType => { + gen.into_root_schema_for::() + } + Self::ColdArchiveBucketEntryType => { + gen.into_root_schema_for::() + } + Self::BucketMetadata => gen.into_root_schema_for::(), + Self::BucketMetadataExt => gen.into_root_schema_for::(), + Self::BucketEntry => gen.into_root_schema_for::(), + Self::HotArchiveBucketEntry => gen.into_root_schema_for::(), + Self::ColdArchiveArchivedLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveDeletedLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveBoundaryLeaf => gen.into_root_schema_for::(), + Self::ColdArchiveHashEntry => gen.into_root_schema_for::(), + Self::ColdArchiveBucketEntry => gen.into_root_schema_for::(), Self::UpgradeType => gen.into_root_schema_for::(), Self::StellarValueType => gen.into_root_schema_for::(), Self::LedgerCloseValueSignature => { @@ -47355,15 +48339,6 @@ impl TypeVariant { Self::ConfigUpgradeSetKey => gen.into_root_schema_for::(), Self::LedgerUpgrade => gen.into_root_schema_for::(), Self::ConfigUpgradeSet => gen.into_root_schema_for::(), - Self::BucketListType => gen.into_root_schema_for::(), - Self::BucketEntryType => gen.into_root_schema_for::(), - Self::HotArchiveBucketEntryType => { - gen.into_root_schema_for::() - } - Self::BucketMetadata => gen.into_root_schema_for::(), - Self::BucketMetadataExt => gen.into_root_schema_for::(), - Self::BucketEntry => gen.into_root_schema_for::(), - Self::HotArchiveBucketEntry => gen.into_root_schema_for::(), Self::TxSetComponentType => gen.into_root_schema_for::(), Self::TxExecutionThread => gen.into_root_schema_for::(), Self::ParallelTxExecutionStage => { @@ -47590,8 +48565,21 @@ impl TypeVariant { Self::PreconditionType => gen.into_root_schema_for::(), Self::Preconditions => gen.into_root_schema_for::(), Self::LedgerFootprint => gen.into_root_schema_for::(), + Self::ArchivalProofType => gen.into_root_schema_for::(), + Self::ArchivalProofNode => gen.into_root_schema_for::(), + Self::ProofLevel => gen.into_root_schema_for::(), + Self::ArchivalProof => gen.into_root_schema_for::(), + Self::ArchivalProofExistenceProof => { + gen.into_root_schema_for::() + } + Self::ArchivalProofNonexistenceProof => { + gen.into_root_schema_for::() + } Self::SorobanResources => gen.into_root_schema_for::(), Self::SorobanTransactionData => gen.into_root_schema_for::(), + Self::SorobanTransactionDataExt => { + gen.into_root_schema_for::() + } Self::TransactionV0 => gen.into_root_schema_for::(), Self::TransactionV0Ext => gen.into_root_schema_for::(), Self::TransactionV0Envelope => gen.into_root_schema_for::(), @@ -47977,6 +48965,19 @@ impl core::str::FromStr for TypeVariant { "LedgerKeyConfigSetting" => Ok(Self::LedgerKeyConfigSetting), "LedgerKeyTtl" => Ok(Self::LedgerKeyTtl), "EnvelopeType" => Ok(Self::EnvelopeType), + "BucketListType" => Ok(Self::BucketListType), + "BucketEntryType" => Ok(Self::BucketEntryType), + "HotArchiveBucketEntryType" => Ok(Self::HotArchiveBucketEntryType), + "ColdArchiveBucketEntryType" => Ok(Self::ColdArchiveBucketEntryType), + "BucketMetadata" => Ok(Self::BucketMetadata), + "BucketMetadataExt" => Ok(Self::BucketMetadataExt), + "BucketEntry" => Ok(Self::BucketEntry), + "HotArchiveBucketEntry" => Ok(Self::HotArchiveBucketEntry), + "ColdArchiveArchivedLeaf" => Ok(Self::ColdArchiveArchivedLeaf), + "ColdArchiveDeletedLeaf" => Ok(Self::ColdArchiveDeletedLeaf), + "ColdArchiveBoundaryLeaf" => Ok(Self::ColdArchiveBoundaryLeaf), + "ColdArchiveHashEntry" => Ok(Self::ColdArchiveHashEntry), + "ColdArchiveBucketEntry" => Ok(Self::ColdArchiveBucketEntry), "UpgradeType" => Ok(Self::UpgradeType), "StellarValueType" => Ok(Self::StellarValueType), "LedgerCloseValueSignature" => Ok(Self::LedgerCloseValueSignature), @@ -47991,13 +48992,6 @@ impl core::str::FromStr for TypeVariant { "ConfigUpgradeSetKey" => Ok(Self::ConfigUpgradeSetKey), "LedgerUpgrade" => Ok(Self::LedgerUpgrade), "ConfigUpgradeSet" => Ok(Self::ConfigUpgradeSet), - "BucketListType" => Ok(Self::BucketListType), - "BucketEntryType" => Ok(Self::BucketEntryType), - "HotArchiveBucketEntryType" => Ok(Self::HotArchiveBucketEntryType), - "BucketMetadata" => Ok(Self::BucketMetadata), - "BucketMetadataExt" => Ok(Self::BucketMetadataExt), - "BucketEntry" => Ok(Self::BucketEntry), - "HotArchiveBucketEntry" => Ok(Self::HotArchiveBucketEntry), "TxSetComponentType" => Ok(Self::TxSetComponentType), "TxExecutionThread" => Ok(Self::TxExecutionThread), "ParallelTxExecutionStage" => Ok(Self::ParallelTxExecutionStage), @@ -48160,8 +49154,15 @@ impl core::str::FromStr for TypeVariant { "PreconditionType" => Ok(Self::PreconditionType), "Preconditions" => Ok(Self::Preconditions), "LedgerFootprint" => Ok(Self::LedgerFootprint), + "ArchivalProofType" => Ok(Self::ArchivalProofType), + "ArchivalProofNode" => Ok(Self::ArchivalProofNode), + "ProofLevel" => Ok(Self::ProofLevel), + "ArchivalProof" => Ok(Self::ArchivalProof), + "ArchivalProofExistenceProof" => Ok(Self::ArchivalProofExistenceProof), + "ArchivalProofNonexistenceProof" => Ok(Self::ArchivalProofNonexistenceProof), "SorobanResources" => Ok(Self::SorobanResources), "SorobanTransactionData" => Ok(Self::SorobanTransactionData), + "SorobanTransactionDataExt" => Ok(Self::SorobanTransactionDataExt), "TransactionV0" => Ok(Self::TransactionV0), "TransactionV0Ext" => Ok(Self::TransactionV0Ext), "TransactionV0Envelope" => Ok(Self::TransactionV0Envelope), @@ -48459,6 +49460,19 @@ pub enum Type { LedgerKeyConfigSetting(Box), LedgerKeyTtl(Box), EnvelopeType(Box), + BucketListType(Box), + BucketEntryType(Box), + HotArchiveBucketEntryType(Box), + ColdArchiveBucketEntryType(Box), + BucketMetadata(Box), + BucketMetadataExt(Box), + BucketEntry(Box), + HotArchiveBucketEntry(Box), + ColdArchiveArchivedLeaf(Box), + ColdArchiveDeletedLeaf(Box), + ColdArchiveBoundaryLeaf(Box), + ColdArchiveHashEntry(Box), + ColdArchiveBucketEntry(Box), UpgradeType(Box), StellarValueType(Box), LedgerCloseValueSignature(Box), @@ -48473,13 +49487,6 @@ pub enum Type { ConfigUpgradeSetKey(Box), LedgerUpgrade(Box), ConfigUpgradeSet(Box), - BucketListType(Box), - BucketEntryType(Box), - HotArchiveBucketEntryType(Box), - BucketMetadata(Box), - BucketMetadataExt(Box), - BucketEntry(Box), - HotArchiveBucketEntry(Box), TxSetComponentType(Box), TxExecutionThread(Box), ParallelTxExecutionStage(Box), @@ -48630,8 +49637,15 @@ pub enum Type { PreconditionType(Box), Preconditions(Box), LedgerFootprint(Box), + ArchivalProofType(Box), + ArchivalProofNode(Box), + ProofLevel(Box), + ArchivalProof(Box), + ArchivalProofExistenceProof(Box), + ArchivalProofNonexistenceProof(Box), SorobanResources(Box), SorobanTransactionData(Box), + SorobanTransactionDataExt(Box), TransactionV0(Box), TransactionV0Ext(Box), TransactionV0Envelope(Box), @@ -48749,7 +49763,7 @@ pub enum Type { } impl Type { - pub const VARIANTS: [TypeVariant; 448] = [ + pub const VARIANTS: [TypeVariant; 461] = [ TypeVariant::Value, TypeVariant::ScpBallot, TypeVariant::ScpStatementType, @@ -48911,6 +49925,19 @@ impl Type { TypeVariant::LedgerKeyConfigSetting, TypeVariant::LedgerKeyTtl, TypeVariant::EnvelopeType, + TypeVariant::BucketListType, + TypeVariant::BucketEntryType, + TypeVariant::HotArchiveBucketEntryType, + TypeVariant::ColdArchiveBucketEntryType, + TypeVariant::BucketMetadata, + TypeVariant::BucketMetadataExt, + TypeVariant::BucketEntry, + TypeVariant::HotArchiveBucketEntry, + TypeVariant::ColdArchiveArchivedLeaf, + TypeVariant::ColdArchiveDeletedLeaf, + TypeVariant::ColdArchiveBoundaryLeaf, + TypeVariant::ColdArchiveHashEntry, + TypeVariant::ColdArchiveBucketEntry, TypeVariant::UpgradeType, TypeVariant::StellarValueType, TypeVariant::LedgerCloseValueSignature, @@ -48925,13 +49952,6 @@ impl Type { TypeVariant::ConfigUpgradeSetKey, TypeVariant::LedgerUpgrade, TypeVariant::ConfigUpgradeSet, - TypeVariant::BucketListType, - TypeVariant::BucketEntryType, - TypeVariant::HotArchiveBucketEntryType, - TypeVariant::BucketMetadata, - TypeVariant::BucketMetadataExt, - TypeVariant::BucketEntry, - TypeVariant::HotArchiveBucketEntry, TypeVariant::TxSetComponentType, TypeVariant::TxExecutionThread, TypeVariant::ParallelTxExecutionStage, @@ -49082,8 +50102,15 @@ impl Type { TypeVariant::PreconditionType, TypeVariant::Preconditions, TypeVariant::LedgerFootprint, + TypeVariant::ArchivalProofType, + TypeVariant::ArchivalProofNode, + TypeVariant::ProofLevel, + TypeVariant::ArchivalProof, + TypeVariant::ArchivalProofExistenceProof, + TypeVariant::ArchivalProofNonexistenceProof, TypeVariant::SorobanResources, TypeVariant::SorobanTransactionData, + TypeVariant::SorobanTransactionDataExt, TypeVariant::TransactionV0, TypeVariant::TransactionV0Ext, TypeVariant::TransactionV0Envelope, @@ -49199,7 +50226,7 @@ impl Type { TypeVariant::BinaryFuseFilterType, TypeVariant::SerializedBinaryFuseFilter, ]; - pub const VARIANTS_STR: [&'static str; 448] = [ + pub const VARIANTS_STR: [&'static str; 461] = [ "Value", "ScpBallot", "ScpStatementType", @@ -49361,6 +50388,19 @@ impl Type { "LedgerKeyConfigSetting", "LedgerKeyTtl", "EnvelopeType", + "BucketListType", + "BucketEntryType", + "HotArchiveBucketEntryType", + "ColdArchiveBucketEntryType", + "BucketMetadata", + "BucketMetadataExt", + "BucketEntry", + "HotArchiveBucketEntry", + "ColdArchiveArchivedLeaf", + "ColdArchiveDeletedLeaf", + "ColdArchiveBoundaryLeaf", + "ColdArchiveHashEntry", + "ColdArchiveBucketEntry", "UpgradeType", "StellarValueType", "LedgerCloseValueSignature", @@ -49375,13 +50415,6 @@ impl Type { "ConfigUpgradeSetKey", "LedgerUpgrade", "ConfigUpgradeSet", - "BucketListType", - "BucketEntryType", - "HotArchiveBucketEntryType", - "BucketMetadata", - "BucketMetadataExt", - "BucketEntry", - "HotArchiveBucketEntry", "TxSetComponentType", "TxExecutionThread", "ParallelTxExecutionStage", @@ -49532,8 +50565,15 @@ impl Type { "PreconditionType", "Preconditions", "LedgerFootprint", + "ArchivalProofType", + "ArchivalProofNode", + "ProofLevel", + "ArchivalProof", + "ArchivalProofExistenceProof", + "ArchivalProofNonexistenceProof", "SorobanResources", "SorobanTransactionData", + "SorobanTransactionDataExt", "TransactionV0", "TransactionV0Ext", "TransactionV0Envelope", @@ -50315,6 +51355,65 @@ impl Type { TypeVariant::EnvelopeType => r.with_limited_depth(|r| { Ok(Self::EnvelopeType(Box::new(EnvelopeType::read_xdr(r)?))) }), + TypeVariant::BucketListType => r.with_limited_depth(|r| { + Ok(Self::BucketListType(Box::new(BucketListType::read_xdr(r)?))) + }), + TypeVariant::BucketEntryType => r.with_limited_depth(|r| { + Ok(Self::BucketEntryType(Box::new(BucketEntryType::read_xdr( + r, + )?))) + }), + TypeVariant::HotArchiveBucketEntryType => r.with_limited_depth(|r| { + Ok(Self::HotArchiveBucketEntryType(Box::new( + HotArchiveBucketEntryType::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBucketEntryType => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBucketEntryType(Box::new( + ColdArchiveBucketEntryType::read_xdr(r)?, + ))) + }), + TypeVariant::BucketMetadata => r.with_limited_depth(|r| { + Ok(Self::BucketMetadata(Box::new(BucketMetadata::read_xdr(r)?))) + }), + TypeVariant::BucketMetadataExt => r.with_limited_depth(|r| { + Ok(Self::BucketMetadataExt(Box::new( + BucketMetadataExt::read_xdr(r)?, + ))) + }), + TypeVariant::BucketEntry => { + r.with_limited_depth(|r| Ok(Self::BucketEntry(Box::new(BucketEntry::read_xdr(r)?)))) + } + TypeVariant::HotArchiveBucketEntry => r.with_limited_depth(|r| { + Ok(Self::HotArchiveBucketEntry(Box::new( + HotArchiveBucketEntry::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveArchivedLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveArchivedLeaf(Box::new( + ColdArchiveArchivedLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveDeletedLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveDeletedLeaf(Box::new( + ColdArchiveDeletedLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBoundaryLeaf => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBoundaryLeaf(Box::new( + ColdArchiveBoundaryLeaf::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveHashEntry => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveHashEntry(Box::new( + ColdArchiveHashEntry::read_xdr(r)?, + ))) + }), + TypeVariant::ColdArchiveBucketEntry => r.with_limited_depth(|r| { + Ok(Self::ColdArchiveBucketEntry(Box::new( + ColdArchiveBucketEntry::read_xdr(r)?, + ))) + }), TypeVariant::UpgradeType => { r.with_limited_depth(|r| Ok(Self::UpgradeType(Box::new(UpgradeType::read_xdr(r)?)))) } @@ -50377,35 +51476,6 @@ impl Type { ConfigUpgradeSet::read_xdr(r)?, ))) }), - TypeVariant::BucketListType => r.with_limited_depth(|r| { - Ok(Self::BucketListType(Box::new(BucketListType::read_xdr(r)?))) - }), - TypeVariant::BucketEntryType => r.with_limited_depth(|r| { - Ok(Self::BucketEntryType(Box::new(BucketEntryType::read_xdr( - r, - )?))) - }), - TypeVariant::HotArchiveBucketEntryType => r.with_limited_depth(|r| { - Ok(Self::HotArchiveBucketEntryType(Box::new( - HotArchiveBucketEntryType::read_xdr(r)?, - ))) - }), - TypeVariant::BucketMetadata => r.with_limited_depth(|r| { - Ok(Self::BucketMetadata(Box::new(BucketMetadata::read_xdr(r)?))) - }), - TypeVariant::BucketMetadataExt => r.with_limited_depth(|r| { - Ok(Self::BucketMetadataExt(Box::new( - BucketMetadataExt::read_xdr(r)?, - ))) - }), - TypeVariant::BucketEntry => { - r.with_limited_depth(|r| Ok(Self::BucketEntry(Box::new(BucketEntry::read_xdr(r)?)))) - } - TypeVariant::HotArchiveBucketEntry => r.with_limited_depth(|r| { - Ok(Self::HotArchiveBucketEntry(Box::new( - HotArchiveBucketEntry::read_xdr(r)?, - ))) - }), TypeVariant::TxSetComponentType => r.with_limited_depth(|r| { Ok(Self::TxSetComponentType(Box::new( TxSetComponentType::read_xdr(r)?, @@ -51076,6 +52146,32 @@ impl Type { r, )?))) }), + TypeVariant::ArchivalProofType => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofType(Box::new( + ArchivalProofType::read_xdr(r)?, + ))) + }), + TypeVariant::ArchivalProofNode => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofNode(Box::new( + ArchivalProofNode::read_xdr(r)?, + ))) + }), + TypeVariant::ProofLevel => { + r.with_limited_depth(|r| Ok(Self::ProofLevel(Box::new(ProofLevel::read_xdr(r)?)))) + } + TypeVariant::ArchivalProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProof(Box::new(ArchivalProof::read_xdr(r)?))) + }), + TypeVariant::ArchivalProofExistenceProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofExistenceProof(Box::new( + ArchivalProofExistenceProof::read_xdr(r)?, + ))) + }), + TypeVariant::ArchivalProofNonexistenceProof => r.with_limited_depth(|r| { + Ok(Self::ArchivalProofNonexistenceProof(Box::new( + ArchivalProofNonexistenceProof::read_xdr(r)?, + ))) + }), TypeVariant::SorobanResources => r.with_limited_depth(|r| { Ok(Self::SorobanResources(Box::new( SorobanResources::read_xdr(r)?, @@ -51086,6 +52182,11 @@ impl Type { SorobanTransactionData::read_xdr(r)?, ))) }), + TypeVariant::SorobanTransactionDataExt => r.with_limited_depth(|r| { + Ok(Self::SorobanTransactionDataExt(Box::new( + SorobanTransactionDataExt::read_xdr(r)?, + ))) + }), TypeVariant::TransactionV0 => r.with_limited_depth(|r| { Ok(Self::TransactionV0(Box::new(TransactionV0::read_xdr(r)?))) }), @@ -52319,6 +53420,58 @@ impl Type { ReadXdrIter::<_, EnvelopeType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, BucketListType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, BucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, BucketMetadata>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, BucketMetadataExt>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, BucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveArchivedLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveDeletedLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveBoundaryLeaf>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, ColdArchiveHashEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, UpgradeType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t)))), @@ -52375,34 +53528,6 @@ impl Type { ReadXdrIter::<_, ConfigUpgradeSet>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, BucketListType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, BucketEntryType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntryType>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, BucketMetadata>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, BucketMetadataExt>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, BucketEntry>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntry>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, TxSetComponentType>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t)))), @@ -53053,6 +54178,33 @@ impl Type { ReadXdrIter::<_, LedgerFootprint>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, ArchivalProofType>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, ArchivalProofNode>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, ProofLevel>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, ArchivalProof>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofExistenceProof>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofNonexistenceProof>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, SorobanResources>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t)))), @@ -53061,6 +54213,10 @@ impl Type { ReadXdrIter::<_, SorobanTransactionData>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanTransactionData(Box::new(t)))), ), + TypeVariant::SorobanTransactionDataExt => Box::new( + ReadXdrIter::<_, SorobanTransactionDataExt>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::SorobanTransactionDataExt(Box::new(t)))), + ), TypeVariant::TransactionV0 => Box::new( ReadXdrIter::<_, TransactionV0>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TransactionV0(Box::new(t)))), @@ -54338,6 +55494,76 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t.0)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t.0)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t.0)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t.0)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t.0)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t.0)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t.0)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t.0)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t.0)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t.0)))), @@ -54403,37 +55629,6 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t.0)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t.0)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t.0)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, Frame>::new( - &mut r.inner, - r.limits.clone(), - ) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t.0)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t.0)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t.0)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t.0)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t.0)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t.0)))), @@ -55197,6 +56392,36 @@ impl Type { ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t.0)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t.0)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t.0)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t.0)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t.0)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t.0)))), @@ -55208,6 +56433,13 @@ impl Type { ) .map(|r| r.map(|t| Self::SorobanTransactionData(Box::new(t.0)))), ), + TypeVariant::SorobanTransactionDataExt => Box::new( + ReadXdrIter::<_, Frame>::new( + &mut r.inner, + r.limits.clone(), + ) + .map(|r| r.map(|t| Self::SorobanTransactionDataExt(Box::new(t.0)))), + ), TypeVariant::TransactionV0 => Box::new( ReadXdrIter::<_, Frame>::new(&mut r.inner, r.limits.clone()) .map(|r| r.map(|t| Self::TransactionV0(Box::new(t.0)))), @@ -56471,6 +57703,58 @@ impl Type { ReadXdrIter::<_, EnvelopeType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::EnvelopeType(Box::new(t)))), ), + TypeVariant::BucketListType => Box::new( + ReadXdrIter::<_, BucketListType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), + ), + TypeVariant::BucketEntryType => Box::new( + ReadXdrIter::<_, BucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntryType => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntryType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntryType(Box::new(t)))), + ), + TypeVariant::BucketMetadata => Box::new( + ReadXdrIter::<_, BucketMetadata>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), + ), + TypeVariant::BucketMetadataExt => Box::new( + ReadXdrIter::<_, BucketMetadataExt>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), + ), + TypeVariant::BucketEntry => Box::new( + ReadXdrIter::<_, BucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), + ), + TypeVariant::HotArchiveBucketEntry => Box::new( + ReadXdrIter::<_, HotArchiveBucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveArchivedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveArchivedLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveArchivedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveDeletedLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveDeletedLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveDeletedLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveBoundaryLeaf => Box::new( + ReadXdrIter::<_, ColdArchiveBoundaryLeaf>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBoundaryLeaf(Box::new(t)))), + ), + TypeVariant::ColdArchiveHashEntry => Box::new( + ReadXdrIter::<_, ColdArchiveHashEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveHashEntry(Box::new(t)))), + ), + TypeVariant::ColdArchiveBucketEntry => Box::new( + ReadXdrIter::<_, ColdArchiveBucketEntry>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ColdArchiveBucketEntry(Box::new(t)))), + ), TypeVariant::UpgradeType => Box::new( ReadXdrIter::<_, UpgradeType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::UpgradeType(Box::new(t)))), @@ -56527,34 +57811,6 @@ impl Type { ReadXdrIter::<_, ConfigUpgradeSet>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::ConfigUpgradeSet(Box::new(t)))), ), - TypeVariant::BucketListType => Box::new( - ReadXdrIter::<_, BucketListType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketListType(Box::new(t)))), - ), - TypeVariant::BucketEntryType => Box::new( - ReadXdrIter::<_, BucketEntryType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntryType(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntryType => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntryType>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntryType(Box::new(t)))), - ), - TypeVariant::BucketMetadata => Box::new( - ReadXdrIter::<_, BucketMetadata>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadata(Box::new(t)))), - ), - TypeVariant::BucketMetadataExt => Box::new( - ReadXdrIter::<_, BucketMetadataExt>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketMetadataExt(Box::new(t)))), - ), - TypeVariant::BucketEntry => Box::new( - ReadXdrIter::<_, BucketEntry>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::BucketEntry(Box::new(t)))), - ), - TypeVariant::HotArchiveBucketEntry => Box::new( - ReadXdrIter::<_, HotArchiveBucketEntry>::new(dec, r.limits.clone()) - .map(|r| r.map(|t| Self::HotArchiveBucketEntry(Box::new(t)))), - ), TypeVariant::TxSetComponentType => Box::new( ReadXdrIter::<_, TxSetComponentType>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::TxSetComponentType(Box::new(t)))), @@ -57166,6 +58422,30 @@ impl Type { ReadXdrIter::<_, LedgerFootprint>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::LedgerFootprint(Box::new(t)))), ), + TypeVariant::ArchivalProofType => Box::new( + ReadXdrIter::<_, ArchivalProofType>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofType(Box::new(t)))), + ), + TypeVariant::ArchivalProofNode => Box::new( + ReadXdrIter::<_, ArchivalProofNode>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNode(Box::new(t)))), + ), + TypeVariant::ProofLevel => Box::new( + ReadXdrIter::<_, ProofLevel>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ProofLevel(Box::new(t)))), + ), + TypeVariant::ArchivalProof => Box::new( + ReadXdrIter::<_, ArchivalProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofExistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofExistenceProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofExistenceProof(Box::new(t)))), + ), + TypeVariant::ArchivalProofNonexistenceProof => Box::new( + ReadXdrIter::<_, ArchivalProofNonexistenceProof>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::ArchivalProofNonexistenceProof(Box::new(t)))), + ), TypeVariant::SorobanResources => Box::new( ReadXdrIter::<_, SorobanResources>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanResources(Box::new(t)))), @@ -57174,6 +58454,10 @@ impl Type { ReadXdrIter::<_, SorobanTransactionData>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::SorobanTransactionData(Box::new(t)))), ), + TypeVariant::SorobanTransactionDataExt => Box::new( + ReadXdrIter::<_, SorobanTransactionDataExt>::new(dec, r.limits.clone()) + .map(|r| r.map(|t| Self::SorobanTransactionDataExt(Box::new(t)))), + ), TypeVariant::TransactionV0 => Box::new( ReadXdrIter::<_, TransactionV0>::new(dec, r.limits.clone()) .map(|r| r.map(|t| Self::TransactionV0(Box::new(t)))), @@ -58076,6 +59360,45 @@ impl Type { TypeVariant::EnvelopeType => { Ok(Self::EnvelopeType(Box::new(serde_json::from_reader(r)?))) } + TypeVariant::BucketListType => { + Ok(Self::BucketListType(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::BucketEntryType => { + Ok(Self::BucketEntryType(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::HotArchiveBucketEntryType => Ok(Self::HotArchiveBucketEntryType( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::ColdArchiveBucketEntryType => Ok(Self::ColdArchiveBucketEntryType( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::BucketMetadata => { + Ok(Self::BucketMetadata(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::BucketMetadataExt => Ok(Self::BucketMetadataExt(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::BucketEntry => { + Ok(Self::BucketEntry(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::HotArchiveBucketEntry => Ok(Self::HotArchiveBucketEntry(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveArchivedLeaf => Ok(Self::ColdArchiveArchivedLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveDeletedLeaf => Ok(Self::ColdArchiveDeletedLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveBoundaryLeaf => Ok(Self::ColdArchiveBoundaryLeaf(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveHashEntry => Ok(Self::ColdArchiveHashEntry(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ColdArchiveBucketEntry => Ok(Self::ColdArchiveBucketEntry(Box::new( + serde_json::from_reader(r)?, + ))), TypeVariant::UpgradeType => { Ok(Self::UpgradeType(Box::new(serde_json::from_reader(r)?))) } @@ -58118,27 +59441,6 @@ impl Type { TypeVariant::ConfigUpgradeSet => Ok(Self::ConfigUpgradeSet(Box::new( serde_json::from_reader(r)?, ))), - TypeVariant::BucketListType => { - Ok(Self::BucketListType(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::BucketEntryType => { - Ok(Self::BucketEntryType(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::HotArchiveBucketEntryType => Ok(Self::HotArchiveBucketEntryType( - Box::new(serde_json::from_reader(r)?), - )), - TypeVariant::BucketMetadata => { - Ok(Self::BucketMetadata(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::BucketMetadataExt => Ok(Self::BucketMetadataExt(Box::new( - serde_json::from_reader(r)?, - ))), - TypeVariant::BucketEntry => { - Ok(Self::BucketEntry(Box::new(serde_json::from_reader(r)?))) - } - TypeVariant::HotArchiveBucketEntry => Ok(Self::HotArchiveBucketEntry(Box::new( - serde_json::from_reader(r)?, - ))), TypeVariant::TxSetComponentType => Ok(Self::TxSetComponentType(Box::new( serde_json::from_reader(r)?, ))), @@ -58563,12 +59865,31 @@ impl Type { TypeVariant::LedgerFootprint => { Ok(Self::LedgerFootprint(Box::new(serde_json::from_reader(r)?))) } + TypeVariant::ArchivalProofType => Ok(Self::ArchivalProofType(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ArchivalProofNode => Ok(Self::ArchivalProofNode(Box::new( + serde_json::from_reader(r)?, + ))), + TypeVariant::ProofLevel => Ok(Self::ProofLevel(Box::new(serde_json::from_reader(r)?))), + TypeVariant::ArchivalProof => { + Ok(Self::ArchivalProof(Box::new(serde_json::from_reader(r)?))) + } + TypeVariant::ArchivalProofExistenceProof => Ok(Self::ArchivalProofExistenceProof( + Box::new(serde_json::from_reader(r)?), + )), + TypeVariant::ArchivalProofNonexistenceProof => Ok( + Self::ArchivalProofNonexistenceProof(Box::new(serde_json::from_reader(r)?)), + ), TypeVariant::SorobanResources => Ok(Self::SorobanResources(Box::new( serde_json::from_reader(r)?, ))), TypeVariant::SorobanTransactionData => Ok(Self::SorobanTransactionData(Box::new( serde_json::from_reader(r)?, ))), + TypeVariant::SorobanTransactionDataExt => Ok(Self::SorobanTransactionDataExt( + Box::new(serde_json::from_reader(r)?), + )), TypeVariant::TransactionV0 => { Ok(Self::TransactionV0(Box::new(serde_json::from_reader(r)?))) } @@ -59057,6 +60378,19 @@ impl Type { Self::LedgerKeyConfigSetting(ref v) => v.as_ref(), Self::LedgerKeyTtl(ref v) => v.as_ref(), Self::EnvelopeType(ref v) => v.as_ref(), + Self::BucketListType(ref v) => v.as_ref(), + Self::BucketEntryType(ref v) => v.as_ref(), + Self::HotArchiveBucketEntryType(ref v) => v.as_ref(), + Self::ColdArchiveBucketEntryType(ref v) => v.as_ref(), + Self::BucketMetadata(ref v) => v.as_ref(), + Self::BucketMetadataExt(ref v) => v.as_ref(), + Self::BucketEntry(ref v) => v.as_ref(), + Self::HotArchiveBucketEntry(ref v) => v.as_ref(), + Self::ColdArchiveArchivedLeaf(ref v) => v.as_ref(), + Self::ColdArchiveDeletedLeaf(ref v) => v.as_ref(), + Self::ColdArchiveBoundaryLeaf(ref v) => v.as_ref(), + Self::ColdArchiveHashEntry(ref v) => v.as_ref(), + Self::ColdArchiveBucketEntry(ref v) => v.as_ref(), Self::UpgradeType(ref v) => v.as_ref(), Self::StellarValueType(ref v) => v.as_ref(), Self::LedgerCloseValueSignature(ref v) => v.as_ref(), @@ -59071,13 +60405,6 @@ impl Type { Self::ConfigUpgradeSetKey(ref v) => v.as_ref(), Self::LedgerUpgrade(ref v) => v.as_ref(), Self::ConfigUpgradeSet(ref v) => v.as_ref(), - Self::BucketListType(ref v) => v.as_ref(), - Self::BucketEntryType(ref v) => v.as_ref(), - Self::HotArchiveBucketEntryType(ref v) => v.as_ref(), - Self::BucketMetadata(ref v) => v.as_ref(), - Self::BucketMetadataExt(ref v) => v.as_ref(), - Self::BucketEntry(ref v) => v.as_ref(), - Self::HotArchiveBucketEntry(ref v) => v.as_ref(), Self::TxSetComponentType(ref v) => v.as_ref(), Self::TxExecutionThread(ref v) => v.as_ref(), Self::ParallelTxExecutionStage(ref v) => v.as_ref(), @@ -59228,8 +60555,15 @@ impl Type { Self::PreconditionType(ref v) => v.as_ref(), Self::Preconditions(ref v) => v.as_ref(), Self::LedgerFootprint(ref v) => v.as_ref(), + Self::ArchivalProofType(ref v) => v.as_ref(), + Self::ArchivalProofNode(ref v) => v.as_ref(), + Self::ProofLevel(ref v) => v.as_ref(), + Self::ArchivalProof(ref v) => v.as_ref(), + Self::ArchivalProofExistenceProof(ref v) => v.as_ref(), + Self::ArchivalProofNonexistenceProof(ref v) => v.as_ref(), Self::SorobanResources(ref v) => v.as_ref(), Self::SorobanTransactionData(ref v) => v.as_ref(), + Self::SorobanTransactionDataExt(ref v) => v.as_ref(), Self::TransactionV0(ref v) => v.as_ref(), Self::TransactionV0Ext(ref v) => v.as_ref(), Self::TransactionV0Envelope(ref v) => v.as_ref(), @@ -59520,6 +60854,19 @@ impl Type { Self::LedgerKeyConfigSetting(_) => "LedgerKeyConfigSetting", Self::LedgerKeyTtl(_) => "LedgerKeyTtl", Self::EnvelopeType(_) => "EnvelopeType", + Self::BucketListType(_) => "BucketListType", + Self::BucketEntryType(_) => "BucketEntryType", + Self::HotArchiveBucketEntryType(_) => "HotArchiveBucketEntryType", + Self::ColdArchiveBucketEntryType(_) => "ColdArchiveBucketEntryType", + Self::BucketMetadata(_) => "BucketMetadata", + Self::BucketMetadataExt(_) => "BucketMetadataExt", + Self::BucketEntry(_) => "BucketEntry", + Self::HotArchiveBucketEntry(_) => "HotArchiveBucketEntry", + Self::ColdArchiveArchivedLeaf(_) => "ColdArchiveArchivedLeaf", + Self::ColdArchiveDeletedLeaf(_) => "ColdArchiveDeletedLeaf", + Self::ColdArchiveBoundaryLeaf(_) => "ColdArchiveBoundaryLeaf", + Self::ColdArchiveHashEntry(_) => "ColdArchiveHashEntry", + Self::ColdArchiveBucketEntry(_) => "ColdArchiveBucketEntry", Self::UpgradeType(_) => "UpgradeType", Self::StellarValueType(_) => "StellarValueType", Self::LedgerCloseValueSignature(_) => "LedgerCloseValueSignature", @@ -59534,13 +60881,6 @@ impl Type { Self::ConfigUpgradeSetKey(_) => "ConfigUpgradeSetKey", Self::LedgerUpgrade(_) => "LedgerUpgrade", Self::ConfigUpgradeSet(_) => "ConfigUpgradeSet", - Self::BucketListType(_) => "BucketListType", - Self::BucketEntryType(_) => "BucketEntryType", - Self::HotArchiveBucketEntryType(_) => "HotArchiveBucketEntryType", - Self::BucketMetadata(_) => "BucketMetadata", - Self::BucketMetadataExt(_) => "BucketMetadataExt", - Self::BucketEntry(_) => "BucketEntry", - Self::HotArchiveBucketEntry(_) => "HotArchiveBucketEntry", Self::TxSetComponentType(_) => "TxSetComponentType", Self::TxExecutionThread(_) => "TxExecutionThread", Self::ParallelTxExecutionStage(_) => "ParallelTxExecutionStage", @@ -59701,8 +61041,15 @@ impl Type { Self::PreconditionType(_) => "PreconditionType", Self::Preconditions(_) => "Preconditions", Self::LedgerFootprint(_) => "LedgerFootprint", + Self::ArchivalProofType(_) => "ArchivalProofType", + Self::ArchivalProofNode(_) => "ArchivalProofNode", + Self::ProofLevel(_) => "ProofLevel", + Self::ArchivalProof(_) => "ArchivalProof", + Self::ArchivalProofExistenceProof(_) => "ArchivalProofExistenceProof", + Self::ArchivalProofNonexistenceProof(_) => "ArchivalProofNonexistenceProof", Self::SorobanResources(_) => "SorobanResources", Self::SorobanTransactionData(_) => "SorobanTransactionData", + Self::SorobanTransactionDataExt(_) => "SorobanTransactionDataExt", Self::TransactionV0(_) => "TransactionV0", Self::TransactionV0Ext(_) => "TransactionV0Ext", Self::TransactionV0Envelope(_) => "TransactionV0Envelope", @@ -59830,7 +61177,7 @@ impl Type { #[must_use] #[allow(clippy::too_many_lines)] - pub const fn variants() -> [TypeVariant; 448] { + pub const fn variants() -> [TypeVariant; 461] { Self::VARIANTS } @@ -60017,6 +61364,19 @@ impl Type { Self::LedgerKeyConfigSetting(_) => TypeVariant::LedgerKeyConfigSetting, Self::LedgerKeyTtl(_) => TypeVariant::LedgerKeyTtl, Self::EnvelopeType(_) => TypeVariant::EnvelopeType, + Self::BucketListType(_) => TypeVariant::BucketListType, + Self::BucketEntryType(_) => TypeVariant::BucketEntryType, + Self::HotArchiveBucketEntryType(_) => TypeVariant::HotArchiveBucketEntryType, + Self::ColdArchiveBucketEntryType(_) => TypeVariant::ColdArchiveBucketEntryType, + Self::BucketMetadata(_) => TypeVariant::BucketMetadata, + Self::BucketMetadataExt(_) => TypeVariant::BucketMetadataExt, + Self::BucketEntry(_) => TypeVariant::BucketEntry, + Self::HotArchiveBucketEntry(_) => TypeVariant::HotArchiveBucketEntry, + Self::ColdArchiveArchivedLeaf(_) => TypeVariant::ColdArchiveArchivedLeaf, + Self::ColdArchiveDeletedLeaf(_) => TypeVariant::ColdArchiveDeletedLeaf, + Self::ColdArchiveBoundaryLeaf(_) => TypeVariant::ColdArchiveBoundaryLeaf, + Self::ColdArchiveHashEntry(_) => TypeVariant::ColdArchiveHashEntry, + Self::ColdArchiveBucketEntry(_) => TypeVariant::ColdArchiveBucketEntry, Self::UpgradeType(_) => TypeVariant::UpgradeType, Self::StellarValueType(_) => TypeVariant::StellarValueType, Self::LedgerCloseValueSignature(_) => TypeVariant::LedgerCloseValueSignature, @@ -60031,13 +61391,6 @@ impl Type { Self::ConfigUpgradeSetKey(_) => TypeVariant::ConfigUpgradeSetKey, Self::LedgerUpgrade(_) => TypeVariant::LedgerUpgrade, Self::ConfigUpgradeSet(_) => TypeVariant::ConfigUpgradeSet, - Self::BucketListType(_) => TypeVariant::BucketListType, - Self::BucketEntryType(_) => TypeVariant::BucketEntryType, - Self::HotArchiveBucketEntryType(_) => TypeVariant::HotArchiveBucketEntryType, - Self::BucketMetadata(_) => TypeVariant::BucketMetadata, - Self::BucketMetadataExt(_) => TypeVariant::BucketMetadataExt, - Self::BucketEntry(_) => TypeVariant::BucketEntry, - Self::HotArchiveBucketEntry(_) => TypeVariant::HotArchiveBucketEntry, Self::TxSetComponentType(_) => TypeVariant::TxSetComponentType, Self::TxExecutionThread(_) => TypeVariant::TxExecutionThread, Self::ParallelTxExecutionStage(_) => TypeVariant::ParallelTxExecutionStage, @@ -60212,8 +61565,15 @@ impl Type { Self::PreconditionType(_) => TypeVariant::PreconditionType, Self::Preconditions(_) => TypeVariant::Preconditions, Self::LedgerFootprint(_) => TypeVariant::LedgerFootprint, + Self::ArchivalProofType(_) => TypeVariant::ArchivalProofType, + Self::ArchivalProofNode(_) => TypeVariant::ArchivalProofNode, + Self::ProofLevel(_) => TypeVariant::ProofLevel, + Self::ArchivalProof(_) => TypeVariant::ArchivalProof, + Self::ArchivalProofExistenceProof(_) => TypeVariant::ArchivalProofExistenceProof, + Self::ArchivalProofNonexistenceProof(_) => TypeVariant::ArchivalProofNonexistenceProof, Self::SorobanResources(_) => TypeVariant::SorobanResources, Self::SorobanTransactionData(_) => TypeVariant::SorobanTransactionData, + Self::SorobanTransactionDataExt(_) => TypeVariant::SorobanTransactionDataExt, Self::TransactionV0(_) => TypeVariant::TransactionV0, Self::TransactionV0Ext(_) => TypeVariant::TransactionV0Ext, Self::TransactionV0Envelope(_) => TypeVariant::TransactionV0Envelope, @@ -60537,6 +61897,19 @@ impl WriteXdr for Type { Self::LedgerKeyConfigSetting(v) => v.write_xdr(w), Self::LedgerKeyTtl(v) => v.write_xdr(w), Self::EnvelopeType(v) => v.write_xdr(w), + Self::BucketListType(v) => v.write_xdr(w), + Self::BucketEntryType(v) => v.write_xdr(w), + Self::HotArchiveBucketEntryType(v) => v.write_xdr(w), + Self::ColdArchiveBucketEntryType(v) => v.write_xdr(w), + Self::BucketMetadata(v) => v.write_xdr(w), + Self::BucketMetadataExt(v) => v.write_xdr(w), + Self::BucketEntry(v) => v.write_xdr(w), + Self::HotArchiveBucketEntry(v) => v.write_xdr(w), + Self::ColdArchiveArchivedLeaf(v) => v.write_xdr(w), + Self::ColdArchiveDeletedLeaf(v) => v.write_xdr(w), + Self::ColdArchiveBoundaryLeaf(v) => v.write_xdr(w), + Self::ColdArchiveHashEntry(v) => v.write_xdr(w), + Self::ColdArchiveBucketEntry(v) => v.write_xdr(w), Self::UpgradeType(v) => v.write_xdr(w), Self::StellarValueType(v) => v.write_xdr(w), Self::LedgerCloseValueSignature(v) => v.write_xdr(w), @@ -60551,13 +61924,6 @@ impl WriteXdr for Type { Self::ConfigUpgradeSetKey(v) => v.write_xdr(w), Self::LedgerUpgrade(v) => v.write_xdr(w), Self::ConfigUpgradeSet(v) => v.write_xdr(w), - Self::BucketListType(v) => v.write_xdr(w), - Self::BucketEntryType(v) => v.write_xdr(w), - Self::HotArchiveBucketEntryType(v) => v.write_xdr(w), - Self::BucketMetadata(v) => v.write_xdr(w), - Self::BucketMetadataExt(v) => v.write_xdr(w), - Self::BucketEntry(v) => v.write_xdr(w), - Self::HotArchiveBucketEntry(v) => v.write_xdr(w), Self::TxSetComponentType(v) => v.write_xdr(w), Self::TxExecutionThread(v) => v.write_xdr(w), Self::ParallelTxExecutionStage(v) => v.write_xdr(w), @@ -60708,8 +62074,15 @@ impl WriteXdr for Type { Self::PreconditionType(v) => v.write_xdr(w), Self::Preconditions(v) => v.write_xdr(w), Self::LedgerFootprint(v) => v.write_xdr(w), + Self::ArchivalProofType(v) => v.write_xdr(w), + Self::ArchivalProofNode(v) => v.write_xdr(w), + Self::ProofLevel(v) => v.write_xdr(w), + Self::ArchivalProof(v) => v.write_xdr(w), + Self::ArchivalProofExistenceProof(v) => v.write_xdr(w), + Self::ArchivalProofNonexistenceProof(v) => v.write_xdr(w), Self::SorobanResources(v) => v.write_xdr(w), Self::SorobanTransactionData(v) => v.write_xdr(w), + Self::SorobanTransactionDataExt(v) => v.write_xdr(w), Self::TransactionV0(v) => v.write_xdr(w), Self::TransactionV0Ext(v) => v.write_xdr(w), Self::TransactionV0Envelope(v) => v.write_xdr(w), diff --git a/xdr/curr b/xdr/curr index 72868e9c..8a043555 160000 --- a/xdr/curr +++ b/xdr/curr @@ -1 +1 @@ -Subproject commit 72868e9ca22a57eec9a21610c9df67e07705f8fb +Subproject commit 8a043555feac0596b268e99800347911512772cb diff --git a/xdr/curr-version b/xdr/curr-version index 8195b908..28d22135 100644 --- a/xdr/curr-version +++ b/xdr/curr-version @@ -1 +1 @@ -72868e9ca22a57eec9a21610c9df67e07705f8fb \ No newline at end of file +8a043555feac0596b268e99800347911512772cb \ No newline at end of file diff --git a/xdr/next b/xdr/next index e303b4c8..8c8251cd 160000 --- a/xdr/next +++ b/xdr/next @@ -1 +1 @@ -Subproject commit e303b4c8e7d823822511a3de88d51eacf4875975 +Subproject commit 8c8251cd491ba73d5868012596762447b9d52bf3 diff --git a/xdr/next-version b/xdr/next-version index b397d30c..7535a11f 100644 --- a/xdr/next-version +++ b/xdr/next-version @@ -1 +1 @@ -e303b4c8e7d823822511a3de88d51eacf4875975 \ No newline at end of file +8c8251cd491ba73d5868012596762447b9d52bf3 \ No newline at end of file