Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Stellar-contract.x
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ enum SCValType
// symbolic SCVals used as the key for ledger entries for a contract's
// instance and an address' nonce, respectively.
SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20,
#ifdef XDR_SPARSE_MAP
SCV_LEDGER_KEY_NONCE = 21,
SCV_SPARSE_MAP = 22
#else
SCV_LEDGER_KEY_NONCE = 21
#endif
};

enum SCErrorType
Expand Down Expand Up @@ -285,6 +290,11 @@ case SCV_LEDGER_KEY_CONTRACT_INSTANCE:
void;
case SCV_LEDGER_KEY_NONCE:
SCNonceKey nonce_key;

#ifdef XDR_SPARSE_MAP
case SCV_SPARSE_MAP:
SCMap *sparseMap;
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field name sparseMap uses camelCase, while other SCVal union arms use snake_case (e.g., nonce_key) or short identifiers (vec, map). Rename to a consistent style (e.g., sparse_map) to match the surrounding XDR conventions and generated bindings.

Suggested change
SCMap *sparseMap;
SCMap *sparse_map;

Copilot uses AI. Check for mistakes.
#endif
};

struct SCMapEntry
Expand Down
4 changes: 4 additions & 0 deletions Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ struct LedgerEntry
void;
case 1:
LedgerEntryExtensionV1 v1;
#ifdef XDR_LEDGER_ENTRY_EXT_V2
case 2:
ExtensionPoint v2;
#endif
}
ext;
};
Expand Down
25 changes: 24 additions & 1 deletion Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,26 @@ struct TransactionMetaV4
};


// This is in Stellar-ledger.x to due to a circular dependency
#ifdef XDR_TRANSACTION_META_V5
struct TransactionMetaV5
{
ExtensionPoint ext;

LedgerEntryChanges txChangesBefore; // tx level changes before operations
// are applied if any
OperationMetaV2 operations<>; // meta for each operation
LedgerEntryChanges txChangesAfter; // tx level changes after operations are
// applied if any
SorobanTransactionMetaV2* sorobanMeta; // Soroban-specific meta (only for
// Soroban transactions).

TransactionEvent events<>; // Used for transaction-level events (like fee payment)
DiagnosticEvent diagnosticEvents<>; // Used for all diagnostic information
uint32 txIndex; // Index of the transaction in the ledger
};
#endif

// This is in Stellar-ledger.x to due to a circular dependency
struct InvokeHostFunctionSuccessPreImage
{
SCVal returnValue;
Expand All @@ -543,6 +562,10 @@ case 3:
TransactionMetaV3 v3;
case 4:
TransactionMetaV4 v4;
#ifdef XDR_TRANSACTION_META_V5
case 5:
TransactionMetaV5 v5;
#endif
};

// This struct groups together changes on a per transaction basis
Expand Down
34 changes: 34 additions & 0 deletions Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ enum OperationType
LIQUIDITY_POOL_WITHDRAW = 23,
INVOKE_HOST_FUNCTION = 24,
EXTEND_FOOTPRINT_TTL = 25,
#ifdef XDR_HELLO_WORLD
RESTORE_FOOTPRINT = 26,
HELLO_WORLD = 27
#else
RESTORE_FOOTPRINT = 26
#endif
};

/* CreateAccount
Expand Down Expand Up @@ -695,6 +700,10 @@ struct Operation
ExtendFootprintTTLOp extendFootprintTTLOp;
case RESTORE_FOOTPRINT:
RestoreFootprintOp restoreFootprintOp;
#ifdef XDR_HELLO_WORLD
case HELLO_WORLD:
HelloWorldOp helloWorldOp;
#endif
}
body;
};
Expand Down Expand Up @@ -1892,6 +1901,27 @@ case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE:
void;
};

#ifdef XDR_HELLO_WORLD
struct HelloWorldOp
{
AccountID helloTo;
};

enum HelloWorldResultCode
{
HELLO_WORLD_SUCCESS = 0,
HELLO_WORLD_MALFORMED = -1
};

union HelloWorldResult switch (HelloWorldResultCode code)
{
case HELLO_WORLD_SUCCESS:
void;
case HELLO_WORLD_MALFORMED:
void;
};
#endif

/* High level Operation Result */
enum OperationResultCode
{
Expand Down Expand Up @@ -1964,6 +1994,10 @@ case opINNER:
ExtendFootprintTTLResult extendFootprintTTLResult;
case RESTORE_FOOTPRINT:
RestoreFootprintResult restoreFootprintResult;
#ifdef XDR_HELLO_WORLD
case HELLO_WORLD:
HelloWorldResult helloWorldResult;
#endif
}
tr;
case opBAD_AUTH:
Expand Down