diff --git a/Cargo.toml b/Cargo.toml index 20d1cda7..b536f781 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ arbitrary = ["std", "dep:arbitrary"] hex = [] # Features for the CLI. -cli = ["std", "curr", "next", "base64", "serde", "serde_json", "dep:clap", "dep:thiserror"] +cli = ["std", "curr", "next", "base64", "serde", "serde_json", "schemars", "dep:clap", "dep:thiserror"] [package.metadata.docs.rs] all-features = true diff --git a/Makefile b/Makefile index ac6f750a..237e3471 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CARGO_HACK_ARGS=--feature-powerset --exclude-features default --group-features b CARGO_DOC_ARGS?=--open -XDRGEN_VERSION=3f37191c1b26b39a4a8265a3824df6c3236cb120 +XDRGEN_VERSION=87d633c780260e2a30a28d7dc9571a790f5138fa # XDRGEN_LOCAL=1 XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12 XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12 @@ -23,7 +23,7 @@ doc: RUSTDOCFLAGS="--cfg docs" cargo +nightly doc --package stellar-xdr --all-features $(CARGO_DOC_ARGS) install: - cargo install --path . --force --features cli + cargo install --locked --path . --force --features cli readme: cargo readme > README.md diff --git a/src/bin/stellar-xdr/main.rs b/src/bin/stellar-xdr/main.rs index 78ff30f3..2873708b 100644 --- a/src/bin/stellar-xdr/main.rs +++ b/src/bin/stellar-xdr/main.rs @@ -6,7 +6,10 @@ fn main() { if let Err(e) = cli::run(env::args_os()) { match e { cli::Error::Clap(e) => e.exit(), - cli::Error::Guess(_) | cli::Error::Decode(_) | cli::Error::Encode(_) => { + cli::Error::Types(_) + | cli::Error::Guess(_) + | cli::Error::Decode(_) + | cli::Error::Encode(_) => { Error::raw(clap::error::ErrorKind::ValueValidation, e).exit() } } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index f8da43ad..9db33de0 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -34,7 +34,7 @@ impl Root { /// If the root command is configured with state that is invalid. pub fn run(&self) -> Result<(), Error> { match &self.cmd { - Cmd::Types(c) => c.run(&self.channel), + Cmd::Types(c) => c.run(&self.channel)?, Cmd::Guess(c) => c.run(&self.channel)?, Cmd::Decode(c) => c.run(&self.channel)?, Cmd::Encode(c) => c.run(&self.channel)?, @@ -77,6 +77,8 @@ pub enum Cmd { pub enum Error { #[error("{0}")] Clap(#[from] clap::Error), + #[error("{0}")] + Types(#[from] types::Error), #[error("error decoding XDR: {0}")] Guess(#[from] guess::Error), #[error("error reading file: {0}")] diff --git a/src/cli/types.rs b/src/cli/types.rs index a0ad2790..893a4c75 100644 --- a/src/cli/types.rs +++ b/src/cli/types.rs @@ -1,9 +1,16 @@ mod list; +mod schema; use clap::{Args, Subcommand}; use crate::cli::Channel; +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("{0}")] + SchemaError(#[from] schema::Error), +} + #[derive(Args, Debug, Clone)] #[command()] pub struct Cmd { @@ -14,12 +21,15 @@ pub struct Cmd { #[derive(Subcommand, Clone, Debug)] pub enum Sub { List(list::Cmd), + Schema(schema::Cmd), } impl Cmd { - pub fn run(&self, channel: &Channel) { + pub fn run(&self, channel: &Channel) -> Result<(), Error> { match &self.sub { Sub::List(c) => c.run(channel), + Sub::Schema(c) => c.run(channel)?, } + Ok(()) } } diff --git a/src/cli/types/schema.rs b/src/cli/types/schema.rs new file mode 100644 index 00000000..3354513b --- /dev/null +++ b/src/cli/types/schema.rs @@ -0,0 +1,73 @@ +use clap::{Args, ValueEnum}; + +use crate::cli::Channel; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("unknown type {0}, choose one of {1:?}")] + UnknownType(String, &'static [&'static str]), + #[error("error generating JSON: {0}")] + GenerateJson(#[from] serde_json::Error), +} + +#[derive(Args, Debug, Clone)] +#[command()] +pub struct Cmd { + /// XDR type to decode + #[arg(long)] + r#type: String, + + // Output format + #[arg(long, value_enum, default_value_t)] + output: OutputFormat, +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] +pub enum OutputFormat { + JsonSchemaDraft7, +} + +impl Default for OutputFormat { + fn default() -> Self { + Self::JsonSchemaDraft7 + } +} + +macro_rules! run_x_case_for_type { + ($type:tt, $m:tt, $type_name:expr, $output:expr) => { + if $type_name == stringify!($type) { + match $output { + OutputFormat::JsonSchemaDraft7 => { + let schema = schemars::schema_for!(crate::$m::$type); + println!("{}", serde_json::to_string_pretty(&schema)?); + }, + } + } + }; +} + +macro_rules! run_x { + ($f:ident, $m:ident) => { + fn $f(&self) -> Result<(), Error> { + use std::str::FromStr; + let _ = crate::$m::TypeVariant::from_str(&self.r#type).map_err(|_| { + Error::UnknownType(self.r#type.clone(), &crate::$m::TypeVariant::VARIANTS_STR) + })?; + crate::$m::call_macro_with_each_type! { run_x_case_for_type, $m, {&self.r#type}, {self.output} } + Ok(()) + } + }; +} + +impl Cmd { + pub fn run(&self, channel: &Channel) -> Result<(), Error> { + match channel { + Channel::Curr => self.run_curr()?, + Channel::Next => self.run_next()?, + } + Ok(()) + } + + run_x!(run_curr, curr); + run_x!(run_next, next); +} diff --git a/src/curr/generated.rs b/src/curr/generated.rs index f9c57ea9..a38445e5 100644 --- a/src/curr/generated.rs +++ b/src/curr/generated.rs @@ -42814,6 +42814,852 @@ impl WriteXdr for HmacSha256Mac { } } +#[doc(hidden)] +#[macro_export] +macro_rules! _call_macro_with_each_type_8b45a57eccbfd886a69e4462ad26dd8a94d8874f8cc9ceb6a6de8c91abcb1289 { + // The x-macro takes a single ident, the name of a macro to call ... + ($macro_to_call_back:ident, $($context:tt),*) => {{ + // ... and calls it back, once for each XDR type. + $macro_to_call_back!(Value, $($context),*); + + $macro_to_call_back!(ScpBallot, $($context),*); + + $macro_to_call_back!(ScpStatementType, $($context),*); + + $macro_to_call_back!(ScpNomination, $($context),*); + + $macro_to_call_back!(ScpStatement, $($context),*); + + $macro_to_call_back!(ScpStatementPledges, $($context),*); + + $macro_to_call_back!(ScpStatementPrepare, $($context),*); + + $macro_to_call_back!(ScpStatementConfirm, $($context),*); + + $macro_to_call_back!(ScpStatementExternalize, $($context),*); + + $macro_to_call_back!(ScpEnvelope, $($context),*); + + $macro_to_call_back!(ScpQuorumSet, $($context),*); + + $macro_to_call_back!(ConfigSettingContractExecutionLanesV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractComputeV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractLedgerCostV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractHistoricalDataV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractEventsV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractBandwidthV0, $($context),*); + + $macro_to_call_back!(ContractCostType, $($context),*); + + $macro_to_call_back!(ContractCostParamEntry, $($context),*); + + $macro_to_call_back!(StateArchivalSettings, $($context),*); + + $macro_to_call_back!(EvictionIterator, $($context),*); + + $macro_to_call_back!(ContractCostParams, $($context),*); + + $macro_to_call_back!(ConfigSettingId, $($context),*); + + $macro_to_call_back!(ConfigSettingEntry, $($context),*); + + $macro_to_call_back!(ScEnvMetaKind, $($context),*); + + $macro_to_call_back!(ScEnvMetaEntry, $($context),*); + + $macro_to_call_back!(ScMetaV0, $($context),*); + + $macro_to_call_back!(ScMetaKind, $($context),*); + + $macro_to_call_back!(ScMetaEntry, $($context),*); + + $macro_to_call_back!(ScSpecType, $($context),*); + + $macro_to_call_back!(ScSpecTypeOption, $($context),*); + + $macro_to_call_back!(ScSpecTypeResult, $($context),*); + + $macro_to_call_back!(ScSpecTypeVec, $($context),*); + + $macro_to_call_back!(ScSpecTypeMap, $($context),*); + + $macro_to_call_back!(ScSpecTypeTuple, $($context),*); + + $macro_to_call_back!(ScSpecTypeBytesN, $($context),*); + + $macro_to_call_back!(ScSpecTypeUdt, $($context),*); + + $macro_to_call_back!(ScSpecTypeDef, $($context),*); + + $macro_to_call_back!(ScSpecUdtStructFieldV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtStructV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseVoidV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseTupleV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseV0Kind, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtEnumCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtEnumV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtErrorEnumCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtErrorEnumV0, $($context),*); + + $macro_to_call_back!(ScSpecFunctionInputV0, $($context),*); + + $macro_to_call_back!(ScSpecFunctionV0, $($context),*); + + $macro_to_call_back!(ScSpecEntryKind, $($context),*); + + $macro_to_call_back!(ScSpecEntry, $($context),*); + + $macro_to_call_back!(ScValType, $($context),*); + + $macro_to_call_back!(ScErrorType, $($context),*); + + $macro_to_call_back!(ScErrorCode, $($context),*); + + $macro_to_call_back!(ScError, $($context),*); + + $macro_to_call_back!(UInt128Parts, $($context),*); + + $macro_to_call_back!(Int128Parts, $($context),*); + + $macro_to_call_back!(UInt256Parts, $($context),*); + + $macro_to_call_back!(Int256Parts, $($context),*); + + $macro_to_call_back!(ContractExecutableType, $($context),*); + + $macro_to_call_back!(ContractExecutable, $($context),*); + + $macro_to_call_back!(ScAddressType, $($context),*); + + $macro_to_call_back!(ScAddress, $($context),*); + + $macro_to_call_back!(ScVec, $($context),*); + + $macro_to_call_back!(ScMap, $($context),*); + + $macro_to_call_back!(ScBytes, $($context),*); + + $macro_to_call_back!(ScString, $($context),*); + + $macro_to_call_back!(ScSymbol, $($context),*); + + $macro_to_call_back!(ScNonceKey, $($context),*); + + $macro_to_call_back!(ScContractInstance, $($context),*); + + $macro_to_call_back!(ScVal, $($context),*); + + $macro_to_call_back!(ScMapEntry, $($context),*); + + $macro_to_call_back!(StoredTransactionSet, $($context),*); + + $macro_to_call_back!(StoredDebugTransactionSet, $($context),*); + + $macro_to_call_back!(PersistedScpStateV0, $($context),*); + + $macro_to_call_back!(PersistedScpStateV1, $($context),*); + + $macro_to_call_back!(PersistedScpState, $($context),*); + + $macro_to_call_back!(Thresholds, $($context),*); + + $macro_to_call_back!(String32, $($context),*); + + $macro_to_call_back!(String64, $($context),*); + + $macro_to_call_back!(SequenceNumber, $($context),*); + + $macro_to_call_back!(DataValue, $($context),*); + + $macro_to_call_back!(PoolId, $($context),*); + + $macro_to_call_back!(AssetCode4, $($context),*); + + $macro_to_call_back!(AssetCode12, $($context),*); + + $macro_to_call_back!(AssetType, $($context),*); + + $macro_to_call_back!(AssetCode, $($context),*); + + $macro_to_call_back!(AlphaNum4, $($context),*); + + $macro_to_call_back!(AlphaNum12, $($context),*); + + $macro_to_call_back!(Asset, $($context),*); + + $macro_to_call_back!(Price, $($context),*); + + $macro_to_call_back!(Liabilities, $($context),*); + + $macro_to_call_back!(ThresholdIndexes, $($context),*); + + $macro_to_call_back!(LedgerEntryType, $($context),*); + + $macro_to_call_back!(Signer, $($context),*); + + $macro_to_call_back!(AccountFlags, $($context),*); + + $macro_to_call_back!(SponsorshipDescriptor, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV3, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV2, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV2Ext, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV1, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(AccountEntry, $($context),*); + + $macro_to_call_back!(AccountEntryExt, $($context),*); + + $macro_to_call_back!(TrustLineFlags, $($context),*); + + $macro_to_call_back!(LiquidityPoolType, $($context),*); + + $macro_to_call_back!(TrustLineAsset, $($context),*); + + $macro_to_call_back!(TrustLineEntryExtensionV2, $($context),*); + + $macro_to_call_back!(TrustLineEntryExtensionV2Ext, $($context),*); + + $macro_to_call_back!(TrustLineEntry, $($context),*); + + $macro_to_call_back!(TrustLineEntryExt, $($context),*); + + $macro_to_call_back!(TrustLineEntryV1, $($context),*); + + $macro_to_call_back!(TrustLineEntryV1Ext, $($context),*); + + $macro_to_call_back!(OfferEntryFlags, $($context),*); + + $macro_to_call_back!(OfferEntry, $($context),*); + + $macro_to_call_back!(OfferEntryExt, $($context),*); + + $macro_to_call_back!(DataEntry, $($context),*); + + $macro_to_call_back!(DataEntryExt, $($context),*); + + $macro_to_call_back!(ClaimPredicateType, $($context),*); + + $macro_to_call_back!(ClaimPredicate, $($context),*); + + $macro_to_call_back!(ClaimantType, $($context),*); + + $macro_to_call_back!(Claimant, $($context),*); + + $macro_to_call_back!(ClaimantV0, $($context),*); + + $macro_to_call_back!(ClaimableBalanceIdType, $($context),*); + + $macro_to_call_back!(ClaimableBalanceId, $($context),*); + + $macro_to_call_back!(ClaimableBalanceFlags, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExtensionV1, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntry, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExt, $($context),*); + + $macro_to_call_back!(LiquidityPoolConstantProductParameters, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntry, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntryBody, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntryConstantProduct, $($context),*); + + $macro_to_call_back!(ContractDataDurability, $($context),*); + + $macro_to_call_back!(ContractDataEntry, $($context),*); + + $macro_to_call_back!(ContractCodeEntry, $($context),*); + + $macro_to_call_back!(TtlEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryExtensionV1, $($context),*); + + $macro_to_call_back!(LedgerEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(LedgerEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryData, $($context),*); + + $macro_to_call_back!(LedgerEntryExt, $($context),*); + + $macro_to_call_back!(LedgerKey, $($context),*); + + $macro_to_call_back!(LedgerKeyAccount, $($context),*); + + $macro_to_call_back!(LedgerKeyTrustLine, $($context),*); + + $macro_to_call_back!(LedgerKeyOffer, $($context),*); + + $macro_to_call_back!(LedgerKeyData, $($context),*); + + $macro_to_call_back!(LedgerKeyClaimableBalance, $($context),*); + + $macro_to_call_back!(LedgerKeyLiquidityPool, $($context),*); + + $macro_to_call_back!(LedgerKeyContractData, $($context),*); + + $macro_to_call_back!(LedgerKeyContractCode, $($context),*); + + $macro_to_call_back!(LedgerKeyConfigSetting, $($context),*); + + $macro_to_call_back!(LedgerKeyTtl, $($context),*); + + $macro_to_call_back!(EnvelopeType, $($context),*); + + $macro_to_call_back!(UpgradeType, $($context),*); + + $macro_to_call_back!(StellarValueType, $($context),*); + + $macro_to_call_back!(LedgerCloseValueSignature, $($context),*); + + $macro_to_call_back!(StellarValue, $($context),*); + + $macro_to_call_back!(StellarValueExt, $($context),*); + + $macro_to_call_back!(LedgerHeaderFlags, $($context),*); + + $macro_to_call_back!(LedgerHeaderExtensionV1, $($context),*); + + $macro_to_call_back!(LedgerHeaderExtensionV1Ext, $($context),*); + + $macro_to_call_back!(LedgerHeader, $($context),*); + + $macro_to_call_back!(LedgerHeaderExt, $($context),*); + + $macro_to_call_back!(LedgerUpgradeType, $($context),*); + + $macro_to_call_back!(ConfigUpgradeSetKey, $($context),*); + + $macro_to_call_back!(LedgerUpgrade, $($context),*); + + $macro_to_call_back!(ConfigUpgradeSet, $($context),*); + + $macro_to_call_back!(BucketEntryType, $($context),*); + + $macro_to_call_back!(BucketMetadata, $($context),*); + + $macro_to_call_back!(BucketMetadataExt, $($context),*); + + $macro_to_call_back!(BucketEntry, $($context),*); + + $macro_to_call_back!(TxSetComponentType, $($context),*); + + $macro_to_call_back!(TxSetComponent, $($context),*); + + $macro_to_call_back!(TxSetComponentTxsMaybeDiscountedFee, $($context),*); + + $macro_to_call_back!(TransactionPhase, $($context),*); + + $macro_to_call_back!(TransactionSet, $($context),*); + + $macro_to_call_back!(TransactionSetV1, $($context),*); + + $macro_to_call_back!(GeneralizedTransactionSet, $($context),*); + + $macro_to_call_back!(TransactionResultPair, $($context),*); + + $macro_to_call_back!(TransactionResultSet, $($context),*); + + $macro_to_call_back!(TransactionHistoryEntry, $($context),*); + + $macro_to_call_back!(TransactionHistoryEntryExt, $($context),*); + + $macro_to_call_back!(TransactionHistoryResultEntry, $($context),*); + + $macro_to_call_back!(TransactionHistoryResultEntryExt, $($context),*); + + $macro_to_call_back!(LedgerHeaderHistoryEntry, $($context),*); + + $macro_to_call_back!(LedgerHeaderHistoryEntryExt, $($context),*); + + $macro_to_call_back!(LedgerScpMessages, $($context),*); + + $macro_to_call_back!(ScpHistoryEntryV0, $($context),*); + + $macro_to_call_back!(ScpHistoryEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryChangeType, $($context),*); + + $macro_to_call_back!(LedgerEntryChange, $($context),*); + + $macro_to_call_back!(LedgerEntryChanges, $($context),*); + + $macro_to_call_back!(OperationMeta, $($context),*); + + $macro_to_call_back!(TransactionMetaV1, $($context),*); + + $macro_to_call_back!(TransactionMetaV2, $($context),*); + + $macro_to_call_back!(ContractEventType, $($context),*); + + $macro_to_call_back!(ContractEvent, $($context),*); + + $macro_to_call_back!(ContractEventBody, $($context),*); + + $macro_to_call_back!(ContractEventV0, $($context),*); + + $macro_to_call_back!(DiagnosticEvent, $($context),*); + + $macro_to_call_back!(SorobanTransactionMeta, $($context),*); + + $macro_to_call_back!(TransactionMetaV3, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionSuccessPreImage, $($context),*); + + $macro_to_call_back!(TransactionMeta, $($context),*); + + $macro_to_call_back!(TransactionResultMeta, $($context),*); + + $macro_to_call_back!(UpgradeEntryMeta, $($context),*); + + $macro_to_call_back!(LedgerCloseMetaV0, $($context),*); + + $macro_to_call_back!(LedgerCloseMetaV1, $($context),*); + + $macro_to_call_back!(LedgerCloseMeta, $($context),*); + + $macro_to_call_back!(ErrorCode, $($context),*); + + $macro_to_call_back!(SError, $($context),*); + + $macro_to_call_back!(SendMore, $($context),*); + + $macro_to_call_back!(SendMoreExtended, $($context),*); + + $macro_to_call_back!(AuthCert, $($context),*); + + $macro_to_call_back!(Hello, $($context),*); + + $macro_to_call_back!(Auth, $($context),*); + + $macro_to_call_back!(IpAddrType, $($context),*); + + $macro_to_call_back!(PeerAddress, $($context),*); + + $macro_to_call_back!(PeerAddressIp, $($context),*); + + $macro_to_call_back!(MessageType, $($context),*); + + $macro_to_call_back!(DontHave, $($context),*); + + $macro_to_call_back!(SurveyMessageCommandType, $($context),*); + + $macro_to_call_back!(SurveyMessageResponseType, $($context),*); + + $macro_to_call_back!(SurveyRequestMessage, $($context),*); + + $macro_to_call_back!(SignedSurveyRequestMessage, $($context),*); + + $macro_to_call_back!(EncryptedBody, $($context),*); + + $macro_to_call_back!(SurveyResponseMessage, $($context),*); + + $macro_to_call_back!(SignedSurveyResponseMessage, $($context),*); + + $macro_to_call_back!(PeerStats, $($context),*); + + $macro_to_call_back!(PeerStatList, $($context),*); + + $macro_to_call_back!(TopologyResponseBodyV0, $($context),*); + + $macro_to_call_back!(TopologyResponseBodyV1, $($context),*); + + $macro_to_call_back!(SurveyResponseBody, $($context),*); + + $macro_to_call_back!(TxAdvertVector, $($context),*); + + $macro_to_call_back!(FloodAdvert, $($context),*); + + $macro_to_call_back!(TxDemandVector, $($context),*); + + $macro_to_call_back!(FloodDemand, $($context),*); + + $macro_to_call_back!(StellarMessage, $($context),*); + + $macro_to_call_back!(AuthenticatedMessage, $($context),*); + + $macro_to_call_back!(AuthenticatedMessageV0, $($context),*); + + $macro_to_call_back!(LiquidityPoolParameters, $($context),*); + + $macro_to_call_back!(MuxedAccount, $($context),*); + + $macro_to_call_back!(MuxedAccountMed25519, $($context),*); + + $macro_to_call_back!(DecoratedSignature, $($context),*); + + $macro_to_call_back!(OperationType, $($context),*); + + $macro_to_call_back!(CreateAccountOp, $($context),*); + + $macro_to_call_back!(PaymentOp, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveOp, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendOp, $($context),*); + + $macro_to_call_back!(ManageSellOfferOp, $($context),*); + + $macro_to_call_back!(ManageBuyOfferOp, $($context),*); + + $macro_to_call_back!(CreatePassiveSellOfferOp, $($context),*); + + $macro_to_call_back!(SetOptionsOp, $($context),*); + + $macro_to_call_back!(ChangeTrustAsset, $($context),*); + + $macro_to_call_back!(ChangeTrustOp, $($context),*); + + $macro_to_call_back!(AllowTrustOp, $($context),*); + + $macro_to_call_back!(ManageDataOp, $($context),*); + + $macro_to_call_back!(BumpSequenceOp, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesOp, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipType, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipOp, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipOpSigner, $($context),*); + + $macro_to_call_back!(ClawbackOp, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsOp, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositOp, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawOp, $($context),*); + + $macro_to_call_back!(HostFunctionType, $($context),*); + + $macro_to_call_back!(ContractIdPreimageType, $($context),*); + + $macro_to_call_back!(ContractIdPreimage, $($context),*); + + $macro_to_call_back!(ContractIdPreimageFromAddress, $($context),*); + + $macro_to_call_back!(CreateContractArgs, $($context),*); + + $macro_to_call_back!(InvokeContractArgs, $($context),*); + + $macro_to_call_back!(HostFunction, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedFunctionType, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedFunction, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedInvocation, $($context),*); + + $macro_to_call_back!(SorobanAddressCredentials, $($context),*); + + $macro_to_call_back!(SorobanCredentialsType, $($context),*); + + $macro_to_call_back!(SorobanCredentials, $($context),*); + + $macro_to_call_back!(SorobanAuthorizationEntry, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionOp, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlOp, $($context),*); + + $macro_to_call_back!(RestoreFootprintOp, $($context),*); + + $macro_to_call_back!(Operation, $($context),*); + + $macro_to_call_back!(OperationBody, $($context),*); + + $macro_to_call_back!(HashIdPreimage, $($context),*); + + $macro_to_call_back!(HashIdPreimageOperationId, $($context),*); + + $macro_to_call_back!(HashIdPreimageRevokeId, $($context),*); + + $macro_to_call_back!(HashIdPreimageContractId, $($context),*); + + $macro_to_call_back!(HashIdPreimageSorobanAuthorization, $($context),*); + + $macro_to_call_back!(MemoType, $($context),*); + + $macro_to_call_back!(Memo, $($context),*); + + $macro_to_call_back!(TimeBounds, $($context),*); + + $macro_to_call_back!(LedgerBounds, $($context),*); + + $macro_to_call_back!(PreconditionsV2, $($context),*); + + $macro_to_call_back!(PreconditionType, $($context),*); + + $macro_to_call_back!(Preconditions, $($context),*); + + $macro_to_call_back!(LedgerFootprint, $($context),*); + + $macro_to_call_back!(SorobanResources, $($context),*); + + $macro_to_call_back!(SorobanTransactionData, $($context),*); + + $macro_to_call_back!(TransactionV0, $($context),*); + + $macro_to_call_back!(TransactionV0Ext, $($context),*); + + $macro_to_call_back!(TransactionV0Envelope, $($context),*); + + $macro_to_call_back!(Transaction, $($context),*); + + $macro_to_call_back!(TransactionExt, $($context),*); + + $macro_to_call_back!(TransactionV1Envelope, $($context),*); + + $macro_to_call_back!(FeeBumpTransaction, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionInnerTx, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionExt, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionEnvelope, $($context),*); + + $macro_to_call_back!(TransactionEnvelope, $($context),*); + + $macro_to_call_back!(TransactionSignaturePayload, $($context),*); + + $macro_to_call_back!(TransactionSignaturePayloadTaggedTransaction, $($context),*); + + $macro_to_call_back!(ClaimAtomType, $($context),*); + + $macro_to_call_back!(ClaimOfferAtomV0, $($context),*); + + $macro_to_call_back!(ClaimOfferAtom, $($context),*); + + $macro_to_call_back!(ClaimLiquidityAtom, $($context),*); + + $macro_to_call_back!(ClaimAtom, $($context),*); + + $macro_to_call_back!(CreateAccountResultCode, $($context),*); + + $macro_to_call_back!(CreateAccountResult, $($context),*); + + $macro_to_call_back!(PaymentResultCode, $($context),*); + + $macro_to_call_back!(PaymentResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResultCode, $($context),*); + + $macro_to_call_back!(SimplePaymentResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResultSuccess, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResultCode, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResultSuccess, $($context),*); + + $macro_to_call_back!(ManageSellOfferResultCode, $($context),*); + + $macro_to_call_back!(ManageOfferEffect, $($context),*); + + $macro_to_call_back!(ManageOfferSuccessResult, $($context),*); + + $macro_to_call_back!(ManageOfferSuccessResultOffer, $($context),*); + + $macro_to_call_back!(ManageSellOfferResult, $($context),*); + + $macro_to_call_back!(ManageBuyOfferResultCode, $($context),*); + + $macro_to_call_back!(ManageBuyOfferResult, $($context),*); + + $macro_to_call_back!(SetOptionsResultCode, $($context),*); + + $macro_to_call_back!(SetOptionsResult, $($context),*); + + $macro_to_call_back!(ChangeTrustResultCode, $($context),*); + + $macro_to_call_back!(ChangeTrustResult, $($context),*); + + $macro_to_call_back!(AllowTrustResultCode, $($context),*); + + $macro_to_call_back!(AllowTrustResult, $($context),*); + + $macro_to_call_back!(AccountMergeResultCode, $($context),*); + + $macro_to_call_back!(AccountMergeResult, $($context),*); + + $macro_to_call_back!(InflationResultCode, $($context),*); + + $macro_to_call_back!(InflationPayout, $($context),*); + + $macro_to_call_back!(InflationResult, $($context),*); + + $macro_to_call_back!(ManageDataResultCode, $($context),*); + + $macro_to_call_back!(ManageDataResult, $($context),*); + + $macro_to_call_back!(BumpSequenceResultCode, $($context),*); + + $macro_to_call_back!(BumpSequenceResult, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesResultCode, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesResult, $($context),*); + + $macro_to_call_back!(EndSponsoringFutureReservesResultCode, $($context),*); + + $macro_to_call_back!(EndSponsoringFutureReservesResult, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipResultCode, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipResult, $($context),*); + + $macro_to_call_back!(ClawbackResultCode, $($context),*); + + $macro_to_call_back!(ClawbackResult, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsResultCode, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsResult, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositResultCode, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositResult, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawResultCode, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawResult, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionResultCode, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionResult, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlResultCode, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlResult, $($context),*); + + $macro_to_call_back!(RestoreFootprintResultCode, $($context),*); + + $macro_to_call_back!(RestoreFootprintResult, $($context),*); + + $macro_to_call_back!(OperationResultCode, $($context),*); + + $macro_to_call_back!(OperationResult, $($context),*); + + $macro_to_call_back!(OperationResultTr, $($context),*); + + $macro_to_call_back!(TransactionResultCode, $($context),*); + + $macro_to_call_back!(InnerTransactionResult, $($context),*); + + $macro_to_call_back!(InnerTransactionResultResult, $($context),*); + + $macro_to_call_back!(InnerTransactionResultExt, $($context),*); + + $macro_to_call_back!(InnerTransactionResultPair, $($context),*); + + $macro_to_call_back!(TransactionResult, $($context),*); + + $macro_to_call_back!(TransactionResultResult, $($context),*); + + $macro_to_call_back!(TransactionResultExt, $($context),*); + + $macro_to_call_back!(Hash, $($context),*); + + $macro_to_call_back!(Uint256, $($context),*); + + $macro_to_call_back!(Uint32, $($context),*); + + $macro_to_call_back!(Int32, $($context),*); + + $macro_to_call_back!(Uint64, $($context),*); + + $macro_to_call_back!(Int64, $($context),*); + + $macro_to_call_back!(TimePoint, $($context),*); + + $macro_to_call_back!(Duration, $($context),*); + + $macro_to_call_back!(ExtensionPoint, $($context),*); + + $macro_to_call_back!(CryptoKeyType, $($context),*); + + $macro_to_call_back!(PublicKeyType, $($context),*); + + $macro_to_call_back!(SignerKeyType, $($context),*); + + $macro_to_call_back!(PublicKey, $($context),*); + + $macro_to_call_back!(SignerKey, $($context),*); + + $macro_to_call_back!(SignerKeyEd25519SignedPayload, $($context),*); + + $macro_to_call_back!(Signature, $($context),*); + + $macro_to_call_back!(SignatureHint, $($context),*); + + $macro_to_call_back!(NodeId, $($context),*); + + $macro_to_call_back!(AccountId, $($context),*); + + $macro_to_call_back!(Curve25519Secret, $($context),*); + + $macro_to_call_back!(Curve25519Public, $($context),*); + + $macro_to_call_back!(HmacSha256Key, $($context),*); + + $macro_to_call_back!(HmacSha256Mac, $($context),*); + + + }}; +} +pub use _call_macro_with_each_type_8b45a57eccbfd886a69e4462ad26dd8a94d8874f8cc9ceb6a6de8c91abcb1289 as call_macro_with_each_type; #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr( all(feature = "serde", feature = "alloc"), diff --git a/src/next/generated.rs b/src/next/generated.rs index d7a2201c..e8547b1d 100644 --- a/src/next/generated.rs +++ b/src/next/generated.rs @@ -42814,6 +42814,852 @@ impl WriteXdr for HmacSha256Mac { } } +#[doc(hidden)] +#[macro_export] +macro_rules! _call_macro_with_each_type_bac0bd9a01f0eecd4c0ebd32e9b5e6c490d95cdc2dcdebbad617637359bef05f { + // The x-macro takes a single ident, the name of a macro to call ... + ($macro_to_call_back:ident, $($context:tt),*) => {{ + // ... and calls it back, once for each XDR type. + $macro_to_call_back!(Value, $($context),*); + + $macro_to_call_back!(ScpBallot, $($context),*); + + $macro_to_call_back!(ScpStatementType, $($context),*); + + $macro_to_call_back!(ScpNomination, $($context),*); + + $macro_to_call_back!(ScpStatement, $($context),*); + + $macro_to_call_back!(ScpStatementPledges, $($context),*); + + $macro_to_call_back!(ScpStatementPrepare, $($context),*); + + $macro_to_call_back!(ScpStatementConfirm, $($context),*); + + $macro_to_call_back!(ScpStatementExternalize, $($context),*); + + $macro_to_call_back!(ScpEnvelope, $($context),*); + + $macro_to_call_back!(ScpQuorumSet, $($context),*); + + $macro_to_call_back!(ConfigSettingContractExecutionLanesV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractComputeV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractLedgerCostV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractHistoricalDataV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractEventsV0, $($context),*); + + $macro_to_call_back!(ConfigSettingContractBandwidthV0, $($context),*); + + $macro_to_call_back!(ContractCostType, $($context),*); + + $macro_to_call_back!(ContractCostParamEntry, $($context),*); + + $macro_to_call_back!(StateArchivalSettings, $($context),*); + + $macro_to_call_back!(EvictionIterator, $($context),*); + + $macro_to_call_back!(ContractCostParams, $($context),*); + + $macro_to_call_back!(ConfigSettingId, $($context),*); + + $macro_to_call_back!(ConfigSettingEntry, $($context),*); + + $macro_to_call_back!(ScEnvMetaKind, $($context),*); + + $macro_to_call_back!(ScEnvMetaEntry, $($context),*); + + $macro_to_call_back!(ScMetaV0, $($context),*); + + $macro_to_call_back!(ScMetaKind, $($context),*); + + $macro_to_call_back!(ScMetaEntry, $($context),*); + + $macro_to_call_back!(ScSpecType, $($context),*); + + $macro_to_call_back!(ScSpecTypeOption, $($context),*); + + $macro_to_call_back!(ScSpecTypeResult, $($context),*); + + $macro_to_call_back!(ScSpecTypeVec, $($context),*); + + $macro_to_call_back!(ScSpecTypeMap, $($context),*); + + $macro_to_call_back!(ScSpecTypeTuple, $($context),*); + + $macro_to_call_back!(ScSpecTypeBytesN, $($context),*); + + $macro_to_call_back!(ScSpecTypeUdt, $($context),*); + + $macro_to_call_back!(ScSpecTypeDef, $($context),*); + + $macro_to_call_back!(ScSpecUdtStructFieldV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtStructV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseVoidV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseTupleV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseV0Kind, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtUnionV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtEnumCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtEnumV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtErrorEnumCaseV0, $($context),*); + + $macro_to_call_back!(ScSpecUdtErrorEnumV0, $($context),*); + + $macro_to_call_back!(ScSpecFunctionInputV0, $($context),*); + + $macro_to_call_back!(ScSpecFunctionV0, $($context),*); + + $macro_to_call_back!(ScSpecEntryKind, $($context),*); + + $macro_to_call_back!(ScSpecEntry, $($context),*); + + $macro_to_call_back!(ScValType, $($context),*); + + $macro_to_call_back!(ScErrorType, $($context),*); + + $macro_to_call_back!(ScErrorCode, $($context),*); + + $macro_to_call_back!(ScError, $($context),*); + + $macro_to_call_back!(UInt128Parts, $($context),*); + + $macro_to_call_back!(Int128Parts, $($context),*); + + $macro_to_call_back!(UInt256Parts, $($context),*); + + $macro_to_call_back!(Int256Parts, $($context),*); + + $macro_to_call_back!(ContractExecutableType, $($context),*); + + $macro_to_call_back!(ContractExecutable, $($context),*); + + $macro_to_call_back!(ScAddressType, $($context),*); + + $macro_to_call_back!(ScAddress, $($context),*); + + $macro_to_call_back!(ScVec, $($context),*); + + $macro_to_call_back!(ScMap, $($context),*); + + $macro_to_call_back!(ScBytes, $($context),*); + + $macro_to_call_back!(ScString, $($context),*); + + $macro_to_call_back!(ScSymbol, $($context),*); + + $macro_to_call_back!(ScNonceKey, $($context),*); + + $macro_to_call_back!(ScContractInstance, $($context),*); + + $macro_to_call_back!(ScVal, $($context),*); + + $macro_to_call_back!(ScMapEntry, $($context),*); + + $macro_to_call_back!(StoredTransactionSet, $($context),*); + + $macro_to_call_back!(StoredDebugTransactionSet, $($context),*); + + $macro_to_call_back!(PersistedScpStateV0, $($context),*); + + $macro_to_call_back!(PersistedScpStateV1, $($context),*); + + $macro_to_call_back!(PersistedScpState, $($context),*); + + $macro_to_call_back!(Thresholds, $($context),*); + + $macro_to_call_back!(String32, $($context),*); + + $macro_to_call_back!(String64, $($context),*); + + $macro_to_call_back!(SequenceNumber, $($context),*); + + $macro_to_call_back!(DataValue, $($context),*); + + $macro_to_call_back!(PoolId, $($context),*); + + $macro_to_call_back!(AssetCode4, $($context),*); + + $macro_to_call_back!(AssetCode12, $($context),*); + + $macro_to_call_back!(AssetType, $($context),*); + + $macro_to_call_back!(AssetCode, $($context),*); + + $macro_to_call_back!(AlphaNum4, $($context),*); + + $macro_to_call_back!(AlphaNum12, $($context),*); + + $macro_to_call_back!(Asset, $($context),*); + + $macro_to_call_back!(Price, $($context),*); + + $macro_to_call_back!(Liabilities, $($context),*); + + $macro_to_call_back!(ThresholdIndexes, $($context),*); + + $macro_to_call_back!(LedgerEntryType, $($context),*); + + $macro_to_call_back!(Signer, $($context),*); + + $macro_to_call_back!(AccountFlags, $($context),*); + + $macro_to_call_back!(SponsorshipDescriptor, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV3, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV2, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV2Ext, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV1, $($context),*); + + $macro_to_call_back!(AccountEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(AccountEntry, $($context),*); + + $macro_to_call_back!(AccountEntryExt, $($context),*); + + $macro_to_call_back!(TrustLineFlags, $($context),*); + + $macro_to_call_back!(LiquidityPoolType, $($context),*); + + $macro_to_call_back!(TrustLineAsset, $($context),*); + + $macro_to_call_back!(TrustLineEntryExtensionV2, $($context),*); + + $macro_to_call_back!(TrustLineEntryExtensionV2Ext, $($context),*); + + $macro_to_call_back!(TrustLineEntry, $($context),*); + + $macro_to_call_back!(TrustLineEntryExt, $($context),*); + + $macro_to_call_back!(TrustLineEntryV1, $($context),*); + + $macro_to_call_back!(TrustLineEntryV1Ext, $($context),*); + + $macro_to_call_back!(OfferEntryFlags, $($context),*); + + $macro_to_call_back!(OfferEntry, $($context),*); + + $macro_to_call_back!(OfferEntryExt, $($context),*); + + $macro_to_call_back!(DataEntry, $($context),*); + + $macro_to_call_back!(DataEntryExt, $($context),*); + + $macro_to_call_back!(ClaimPredicateType, $($context),*); + + $macro_to_call_back!(ClaimPredicate, $($context),*); + + $macro_to_call_back!(ClaimantType, $($context),*); + + $macro_to_call_back!(Claimant, $($context),*); + + $macro_to_call_back!(ClaimantV0, $($context),*); + + $macro_to_call_back!(ClaimableBalanceIdType, $($context),*); + + $macro_to_call_back!(ClaimableBalanceId, $($context),*); + + $macro_to_call_back!(ClaimableBalanceFlags, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExtensionV1, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntry, $($context),*); + + $macro_to_call_back!(ClaimableBalanceEntryExt, $($context),*); + + $macro_to_call_back!(LiquidityPoolConstantProductParameters, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntry, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntryBody, $($context),*); + + $macro_to_call_back!(LiquidityPoolEntryConstantProduct, $($context),*); + + $macro_to_call_back!(ContractDataDurability, $($context),*); + + $macro_to_call_back!(ContractDataEntry, $($context),*); + + $macro_to_call_back!(ContractCodeEntry, $($context),*); + + $macro_to_call_back!(TtlEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryExtensionV1, $($context),*); + + $macro_to_call_back!(LedgerEntryExtensionV1Ext, $($context),*); + + $macro_to_call_back!(LedgerEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryData, $($context),*); + + $macro_to_call_back!(LedgerEntryExt, $($context),*); + + $macro_to_call_back!(LedgerKey, $($context),*); + + $macro_to_call_back!(LedgerKeyAccount, $($context),*); + + $macro_to_call_back!(LedgerKeyTrustLine, $($context),*); + + $macro_to_call_back!(LedgerKeyOffer, $($context),*); + + $macro_to_call_back!(LedgerKeyData, $($context),*); + + $macro_to_call_back!(LedgerKeyClaimableBalance, $($context),*); + + $macro_to_call_back!(LedgerKeyLiquidityPool, $($context),*); + + $macro_to_call_back!(LedgerKeyContractData, $($context),*); + + $macro_to_call_back!(LedgerKeyContractCode, $($context),*); + + $macro_to_call_back!(LedgerKeyConfigSetting, $($context),*); + + $macro_to_call_back!(LedgerKeyTtl, $($context),*); + + $macro_to_call_back!(EnvelopeType, $($context),*); + + $macro_to_call_back!(UpgradeType, $($context),*); + + $macro_to_call_back!(StellarValueType, $($context),*); + + $macro_to_call_back!(LedgerCloseValueSignature, $($context),*); + + $macro_to_call_back!(StellarValue, $($context),*); + + $macro_to_call_back!(StellarValueExt, $($context),*); + + $macro_to_call_back!(LedgerHeaderFlags, $($context),*); + + $macro_to_call_back!(LedgerHeaderExtensionV1, $($context),*); + + $macro_to_call_back!(LedgerHeaderExtensionV1Ext, $($context),*); + + $macro_to_call_back!(LedgerHeader, $($context),*); + + $macro_to_call_back!(LedgerHeaderExt, $($context),*); + + $macro_to_call_back!(LedgerUpgradeType, $($context),*); + + $macro_to_call_back!(ConfigUpgradeSetKey, $($context),*); + + $macro_to_call_back!(LedgerUpgrade, $($context),*); + + $macro_to_call_back!(ConfigUpgradeSet, $($context),*); + + $macro_to_call_back!(BucketEntryType, $($context),*); + + $macro_to_call_back!(BucketMetadata, $($context),*); + + $macro_to_call_back!(BucketMetadataExt, $($context),*); + + $macro_to_call_back!(BucketEntry, $($context),*); + + $macro_to_call_back!(TxSetComponentType, $($context),*); + + $macro_to_call_back!(TxSetComponent, $($context),*); + + $macro_to_call_back!(TxSetComponentTxsMaybeDiscountedFee, $($context),*); + + $macro_to_call_back!(TransactionPhase, $($context),*); + + $macro_to_call_back!(TransactionSet, $($context),*); + + $macro_to_call_back!(TransactionSetV1, $($context),*); + + $macro_to_call_back!(GeneralizedTransactionSet, $($context),*); + + $macro_to_call_back!(TransactionResultPair, $($context),*); + + $macro_to_call_back!(TransactionResultSet, $($context),*); + + $macro_to_call_back!(TransactionHistoryEntry, $($context),*); + + $macro_to_call_back!(TransactionHistoryEntryExt, $($context),*); + + $macro_to_call_back!(TransactionHistoryResultEntry, $($context),*); + + $macro_to_call_back!(TransactionHistoryResultEntryExt, $($context),*); + + $macro_to_call_back!(LedgerHeaderHistoryEntry, $($context),*); + + $macro_to_call_back!(LedgerHeaderHistoryEntryExt, $($context),*); + + $macro_to_call_back!(LedgerScpMessages, $($context),*); + + $macro_to_call_back!(ScpHistoryEntryV0, $($context),*); + + $macro_to_call_back!(ScpHistoryEntry, $($context),*); + + $macro_to_call_back!(LedgerEntryChangeType, $($context),*); + + $macro_to_call_back!(LedgerEntryChange, $($context),*); + + $macro_to_call_back!(LedgerEntryChanges, $($context),*); + + $macro_to_call_back!(OperationMeta, $($context),*); + + $macro_to_call_back!(TransactionMetaV1, $($context),*); + + $macro_to_call_back!(TransactionMetaV2, $($context),*); + + $macro_to_call_back!(ContractEventType, $($context),*); + + $macro_to_call_back!(ContractEvent, $($context),*); + + $macro_to_call_back!(ContractEventBody, $($context),*); + + $macro_to_call_back!(ContractEventV0, $($context),*); + + $macro_to_call_back!(DiagnosticEvent, $($context),*); + + $macro_to_call_back!(SorobanTransactionMeta, $($context),*); + + $macro_to_call_back!(TransactionMetaV3, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionSuccessPreImage, $($context),*); + + $macro_to_call_back!(TransactionMeta, $($context),*); + + $macro_to_call_back!(TransactionResultMeta, $($context),*); + + $macro_to_call_back!(UpgradeEntryMeta, $($context),*); + + $macro_to_call_back!(LedgerCloseMetaV0, $($context),*); + + $macro_to_call_back!(LedgerCloseMetaV1, $($context),*); + + $macro_to_call_back!(LedgerCloseMeta, $($context),*); + + $macro_to_call_back!(ErrorCode, $($context),*); + + $macro_to_call_back!(SError, $($context),*); + + $macro_to_call_back!(SendMore, $($context),*); + + $macro_to_call_back!(SendMoreExtended, $($context),*); + + $macro_to_call_back!(AuthCert, $($context),*); + + $macro_to_call_back!(Hello, $($context),*); + + $macro_to_call_back!(Auth, $($context),*); + + $macro_to_call_back!(IpAddrType, $($context),*); + + $macro_to_call_back!(PeerAddress, $($context),*); + + $macro_to_call_back!(PeerAddressIp, $($context),*); + + $macro_to_call_back!(MessageType, $($context),*); + + $macro_to_call_back!(DontHave, $($context),*); + + $macro_to_call_back!(SurveyMessageCommandType, $($context),*); + + $macro_to_call_back!(SurveyMessageResponseType, $($context),*); + + $macro_to_call_back!(SurveyRequestMessage, $($context),*); + + $macro_to_call_back!(SignedSurveyRequestMessage, $($context),*); + + $macro_to_call_back!(EncryptedBody, $($context),*); + + $macro_to_call_back!(SurveyResponseMessage, $($context),*); + + $macro_to_call_back!(SignedSurveyResponseMessage, $($context),*); + + $macro_to_call_back!(PeerStats, $($context),*); + + $macro_to_call_back!(PeerStatList, $($context),*); + + $macro_to_call_back!(TopologyResponseBodyV0, $($context),*); + + $macro_to_call_back!(TopologyResponseBodyV1, $($context),*); + + $macro_to_call_back!(SurveyResponseBody, $($context),*); + + $macro_to_call_back!(TxAdvertVector, $($context),*); + + $macro_to_call_back!(FloodAdvert, $($context),*); + + $macro_to_call_back!(TxDemandVector, $($context),*); + + $macro_to_call_back!(FloodDemand, $($context),*); + + $macro_to_call_back!(StellarMessage, $($context),*); + + $macro_to_call_back!(AuthenticatedMessage, $($context),*); + + $macro_to_call_back!(AuthenticatedMessageV0, $($context),*); + + $macro_to_call_back!(LiquidityPoolParameters, $($context),*); + + $macro_to_call_back!(MuxedAccount, $($context),*); + + $macro_to_call_back!(MuxedAccountMed25519, $($context),*); + + $macro_to_call_back!(DecoratedSignature, $($context),*); + + $macro_to_call_back!(OperationType, $($context),*); + + $macro_to_call_back!(CreateAccountOp, $($context),*); + + $macro_to_call_back!(PaymentOp, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveOp, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendOp, $($context),*); + + $macro_to_call_back!(ManageSellOfferOp, $($context),*); + + $macro_to_call_back!(ManageBuyOfferOp, $($context),*); + + $macro_to_call_back!(CreatePassiveSellOfferOp, $($context),*); + + $macro_to_call_back!(SetOptionsOp, $($context),*); + + $macro_to_call_back!(ChangeTrustAsset, $($context),*); + + $macro_to_call_back!(ChangeTrustOp, $($context),*); + + $macro_to_call_back!(AllowTrustOp, $($context),*); + + $macro_to_call_back!(ManageDataOp, $($context),*); + + $macro_to_call_back!(BumpSequenceOp, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesOp, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipType, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipOp, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipOpSigner, $($context),*); + + $macro_to_call_back!(ClawbackOp, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceOp, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsOp, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositOp, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawOp, $($context),*); + + $macro_to_call_back!(HostFunctionType, $($context),*); + + $macro_to_call_back!(ContractIdPreimageType, $($context),*); + + $macro_to_call_back!(ContractIdPreimage, $($context),*); + + $macro_to_call_back!(ContractIdPreimageFromAddress, $($context),*); + + $macro_to_call_back!(CreateContractArgs, $($context),*); + + $macro_to_call_back!(InvokeContractArgs, $($context),*); + + $macro_to_call_back!(HostFunction, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedFunctionType, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedFunction, $($context),*); + + $macro_to_call_back!(SorobanAuthorizedInvocation, $($context),*); + + $macro_to_call_back!(SorobanAddressCredentials, $($context),*); + + $macro_to_call_back!(SorobanCredentialsType, $($context),*); + + $macro_to_call_back!(SorobanCredentials, $($context),*); + + $macro_to_call_back!(SorobanAuthorizationEntry, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionOp, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlOp, $($context),*); + + $macro_to_call_back!(RestoreFootprintOp, $($context),*); + + $macro_to_call_back!(Operation, $($context),*); + + $macro_to_call_back!(OperationBody, $($context),*); + + $macro_to_call_back!(HashIdPreimage, $($context),*); + + $macro_to_call_back!(HashIdPreimageOperationId, $($context),*); + + $macro_to_call_back!(HashIdPreimageRevokeId, $($context),*); + + $macro_to_call_back!(HashIdPreimageContractId, $($context),*); + + $macro_to_call_back!(HashIdPreimageSorobanAuthorization, $($context),*); + + $macro_to_call_back!(MemoType, $($context),*); + + $macro_to_call_back!(Memo, $($context),*); + + $macro_to_call_back!(TimeBounds, $($context),*); + + $macro_to_call_back!(LedgerBounds, $($context),*); + + $macro_to_call_back!(PreconditionsV2, $($context),*); + + $macro_to_call_back!(PreconditionType, $($context),*); + + $macro_to_call_back!(Preconditions, $($context),*); + + $macro_to_call_back!(LedgerFootprint, $($context),*); + + $macro_to_call_back!(SorobanResources, $($context),*); + + $macro_to_call_back!(SorobanTransactionData, $($context),*); + + $macro_to_call_back!(TransactionV0, $($context),*); + + $macro_to_call_back!(TransactionV0Ext, $($context),*); + + $macro_to_call_back!(TransactionV0Envelope, $($context),*); + + $macro_to_call_back!(Transaction, $($context),*); + + $macro_to_call_back!(TransactionExt, $($context),*); + + $macro_to_call_back!(TransactionV1Envelope, $($context),*); + + $macro_to_call_back!(FeeBumpTransaction, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionInnerTx, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionExt, $($context),*); + + $macro_to_call_back!(FeeBumpTransactionEnvelope, $($context),*); + + $macro_to_call_back!(TransactionEnvelope, $($context),*); + + $macro_to_call_back!(TransactionSignaturePayload, $($context),*); + + $macro_to_call_back!(TransactionSignaturePayloadTaggedTransaction, $($context),*); + + $macro_to_call_back!(ClaimAtomType, $($context),*); + + $macro_to_call_back!(ClaimOfferAtomV0, $($context),*); + + $macro_to_call_back!(ClaimOfferAtom, $($context),*); + + $macro_to_call_back!(ClaimLiquidityAtom, $($context),*); + + $macro_to_call_back!(ClaimAtom, $($context),*); + + $macro_to_call_back!(CreateAccountResultCode, $($context),*); + + $macro_to_call_back!(CreateAccountResult, $($context),*); + + $macro_to_call_back!(PaymentResultCode, $($context),*); + + $macro_to_call_back!(PaymentResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResultCode, $($context),*); + + $macro_to_call_back!(SimplePaymentResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictReceiveResultSuccess, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResultCode, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResult, $($context),*); + + $macro_to_call_back!(PathPaymentStrictSendResultSuccess, $($context),*); + + $macro_to_call_back!(ManageSellOfferResultCode, $($context),*); + + $macro_to_call_back!(ManageOfferEffect, $($context),*); + + $macro_to_call_back!(ManageOfferSuccessResult, $($context),*); + + $macro_to_call_back!(ManageOfferSuccessResultOffer, $($context),*); + + $macro_to_call_back!(ManageSellOfferResult, $($context),*); + + $macro_to_call_back!(ManageBuyOfferResultCode, $($context),*); + + $macro_to_call_back!(ManageBuyOfferResult, $($context),*); + + $macro_to_call_back!(SetOptionsResultCode, $($context),*); + + $macro_to_call_back!(SetOptionsResult, $($context),*); + + $macro_to_call_back!(ChangeTrustResultCode, $($context),*); + + $macro_to_call_back!(ChangeTrustResult, $($context),*); + + $macro_to_call_back!(AllowTrustResultCode, $($context),*); + + $macro_to_call_back!(AllowTrustResult, $($context),*); + + $macro_to_call_back!(AccountMergeResultCode, $($context),*); + + $macro_to_call_back!(AccountMergeResult, $($context),*); + + $macro_to_call_back!(InflationResultCode, $($context),*); + + $macro_to_call_back!(InflationPayout, $($context),*); + + $macro_to_call_back!(InflationResult, $($context),*); + + $macro_to_call_back!(ManageDataResultCode, $($context),*); + + $macro_to_call_back!(ManageDataResult, $($context),*); + + $macro_to_call_back!(BumpSequenceResultCode, $($context),*); + + $macro_to_call_back!(BumpSequenceResult, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(CreateClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(ClaimClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesResultCode, $($context),*); + + $macro_to_call_back!(BeginSponsoringFutureReservesResult, $($context),*); + + $macro_to_call_back!(EndSponsoringFutureReservesResultCode, $($context),*); + + $macro_to_call_back!(EndSponsoringFutureReservesResult, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipResultCode, $($context),*); + + $macro_to_call_back!(RevokeSponsorshipResult, $($context),*); + + $macro_to_call_back!(ClawbackResultCode, $($context),*); + + $macro_to_call_back!(ClawbackResult, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceResultCode, $($context),*); + + $macro_to_call_back!(ClawbackClaimableBalanceResult, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsResultCode, $($context),*); + + $macro_to_call_back!(SetTrustLineFlagsResult, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositResultCode, $($context),*); + + $macro_to_call_back!(LiquidityPoolDepositResult, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawResultCode, $($context),*); + + $macro_to_call_back!(LiquidityPoolWithdrawResult, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionResultCode, $($context),*); + + $macro_to_call_back!(InvokeHostFunctionResult, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlResultCode, $($context),*); + + $macro_to_call_back!(ExtendFootprintTtlResult, $($context),*); + + $macro_to_call_back!(RestoreFootprintResultCode, $($context),*); + + $macro_to_call_back!(RestoreFootprintResult, $($context),*); + + $macro_to_call_back!(OperationResultCode, $($context),*); + + $macro_to_call_back!(OperationResult, $($context),*); + + $macro_to_call_back!(OperationResultTr, $($context),*); + + $macro_to_call_back!(TransactionResultCode, $($context),*); + + $macro_to_call_back!(InnerTransactionResult, $($context),*); + + $macro_to_call_back!(InnerTransactionResultResult, $($context),*); + + $macro_to_call_back!(InnerTransactionResultExt, $($context),*); + + $macro_to_call_back!(InnerTransactionResultPair, $($context),*); + + $macro_to_call_back!(TransactionResult, $($context),*); + + $macro_to_call_back!(TransactionResultResult, $($context),*); + + $macro_to_call_back!(TransactionResultExt, $($context),*); + + $macro_to_call_back!(Hash, $($context),*); + + $macro_to_call_back!(Uint256, $($context),*); + + $macro_to_call_back!(Uint32, $($context),*); + + $macro_to_call_back!(Int32, $($context),*); + + $macro_to_call_back!(Uint64, $($context),*); + + $macro_to_call_back!(Int64, $($context),*); + + $macro_to_call_back!(TimePoint, $($context),*); + + $macro_to_call_back!(Duration, $($context),*); + + $macro_to_call_back!(ExtensionPoint, $($context),*); + + $macro_to_call_back!(CryptoKeyType, $($context),*); + + $macro_to_call_back!(PublicKeyType, $($context),*); + + $macro_to_call_back!(SignerKeyType, $($context),*); + + $macro_to_call_back!(PublicKey, $($context),*); + + $macro_to_call_back!(SignerKey, $($context),*); + + $macro_to_call_back!(SignerKeyEd25519SignedPayload, $($context),*); + + $macro_to_call_back!(Signature, $($context),*); + + $macro_to_call_back!(SignatureHint, $($context),*); + + $macro_to_call_back!(NodeId, $($context),*); + + $macro_to_call_back!(AccountId, $($context),*); + + $macro_to_call_back!(Curve25519Secret, $($context),*); + + $macro_to_call_back!(Curve25519Public, $($context),*); + + $macro_to_call_back!(HmacSha256Key, $($context),*); + + $macro_to_call_back!(HmacSha256Mac, $($context),*); + + + }}; +} +pub use _call_macro_with_each_type_bac0bd9a01f0eecd4c0ebd32e9b5e6c490d95cdc2dcdebbad617637359bef05f as call_macro_with_each_type; #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr( all(feature = "serde", feature = "alloc"),