From 45a7d6174d7ad8fc45fde2010f120e0241746d6a Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 28 Apr 2023 13:09:18 -0700 Subject: [PATCH] Replace ContractAuth addressWithNonce option with explicit union --- Stellar-transaction.x | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Stellar-transaction.x b/Stellar-transaction.x index d4ad0d9..9e8ffb6 100644 --- a/Stellar-transaction.x +++ b/Stellar-transaction.x @@ -540,9 +540,23 @@ struct AddressWithNonce uint64 nonce; }; +enum AuthorizerType +{ + AUTHORIZER_SOURCE_ACCOUNT = 0, + AUTHORIZER_ADDRESS = 1, +}; + +union Authorizer switch (AuthorizerType type) +{ +case AUTHORIZER_SOURCE_ACCOUNT: + void; +case AUTHORIZER_ADDRESS: + AddressWithNonce address; +}; + struct ContractAuth { - AddressWithNonce* addressWithNonce; // not present for invoker + Authorizer authorizer; AuthorizedInvocation rootInvocation; SCVec signatureArgs; };