Skip to content

Commit

Permalink
!fixup Removed multi-level nested structs/union from XDR.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh committed Nov 3, 2022
1 parent 34bba81 commit f239db8
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions core/cap-0046.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
Only in src/protocol-curr/xdr: Stellar-overlay.x.bak
diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xdr/Stellar-transaction.x src/protocol-next/xdr/Stellar-transaction.x
--- src/protocol-curr/xdr/Stellar-transaction.x 2022-11-01 19:19:35.771360700 -0400
+++ src/protocol-next/xdr/Stellar-transaction.x 2022-11-02 14:56:03.653227900 -0400
+++ src/protocol-next/xdr/Stellar-transaction.x 2022-11-03 14:34:08.450342900 -0400
@@ -2,6 +2,7 @@
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
Expand Down Expand Up @@ -514,7 +514,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
};

/* CreateAccount
@@ -465,6 +474,88 @@
@@ -465,6 +474,91 @@
int64 minAmountB; // minimum amount of second asset to withdraw
};

Expand Down Expand Up @@ -555,30 +555,33 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
+ InstallContractCodeArgs installContractCodeArgs;
+};
+
+struct CreateContractArgs
+union ContractIDPublicKey switch (ContractIDPublicKeyType type)
+{
+ union switch (ContractIDType type)
+case CONTRACT_ID_PUBLIC_KEY_SOURCE_ACCOUNT:
+ void;
+case CONTRACT_ID_PUBLIC_KEY_ED25519:
+ struct
+ {
+ case CONTRACT_ID_FROM_PUBLIC_KEY:
+ struct
+ {
+ union switch (ContractIDPublicKeyType type)
+ {
+ case CONTRACT_ID_PUBLIC_KEY_SOURCE_ACCOUNT:
+ void;
+ case CONTRACT_ID_PUBLIC_KEY_ED25519:
+ struct
+ {
+ uint256 key;
+ Signature signature;
+ } ed25519KeyWithSignature;
+ } keySource;
+ uint256 salt;
+ } publicKey;
+ case CONTRACT_ID_FROM_ASSET:
+ Asset asset;
+ } contractID;
+ uint256 key;
+ Signature signature;
+ } ed25519KeyWithSignature;
+};
+
+union ContractID switch (ContractIDType type)
+{
+case CONTRACT_ID_FROM_PUBLIC_KEY:
+ struct
+ {
+ ContractIDPublicKey keySource;
+ uint256 salt;
+ } publicKey;
+case CONTRACT_ID_FROM_ASSET:
+ Asset asset;
+};
+
+struct CreateContractArgs
+{
+ ContractID contractID;
+ CreateContractSource source;
+};
+
Expand All @@ -603,7 +606,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
/* An operation is the lowest unit of work that a transaction does */
struct Operation
{
@@ -523,6 +614,8 @@
@@ -523,6 +617,8 @@
LiquidityPoolDepositOp liquidityPoolDepositOp;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
Expand All @@ -612,7 +615,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
}
body;
};
@@ -545,6 +638,40 @@
@@ -545,6 +641,40 @@
PoolID liquidityPoolID;
Asset asset;
} revokeID;
Expand Down Expand Up @@ -653,7 +656,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
};

enum MemoType
@@ -1588,6 +1715,25 @@
@@ -1588,6 +1718,25 @@
void;
};

Expand All @@ -679,7 +682,7 @@ diff -ru '--exclude=*.h' '--exclude=.git*' '--exclude=*.md' src/protocol-curr/xd
/* High level Operation Result */
enum OperationResultCode
{
@@ -1654,6 +1800,8 @@
@@ -1654,6 +1803,8 @@
LiquidityPoolDepositResult liquidityPoolDepositResult;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
Expand Down

0 comments on commit f239db8

Please sign in to comment.