From 1cb4c760a0dad8935114d42017776fd255b85665 Mon Sep 17 00:00:00 2001 From: Jonathan Jove Date: Thu, 11 Aug 2022 10:48:20 -0500 Subject: [PATCH] Add SCContractCode and update related types --- Stellar-contract.x | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Stellar-contract.x b/Stellar-contract.x index 2f47e1a..7a88631 100644 --- a/Stellar-contract.x +++ b/Stellar-contract.x @@ -65,7 +65,7 @@ enum SCStatic SCS_VOID = 0, SCS_TRUE = 1, SCS_FALSE = 2, - SCS_LEDGER_KEY_CONTRACT_CODE_WASM = 3 + SCS_LEDGER_KEY_CONTRACT_CODE = 3 }; enum SCStatusType @@ -213,7 +213,8 @@ enum SCObjectType SCO_BYTES = 4, SCO_BIG_INT = 5, SCO_HASH = 6, - SCO_PUBLIC_KEY = 7 + SCO_PUBLIC_KEY = 7, + SCO_CONTRACT_CODE = 8 // TODO: add more }; @@ -256,6 +257,20 @@ case SCHASH_SHA256: Hash sha256; }; +enum SCContractCodeType +{ + SCCONTRACT_CODE_WASM = 0, + SCCONTRACT_CODE_TOKEN = 1 +}; + +union SCContractCode switch (SCContractCodeType type) +{ +case SCCONTRACT_CODE_WASM: + opaque wasm; +case SCCONTRACT_CODE_TOKEN: + void; +}; + union SCObject switch (SCObjectType type) { case SCO_VEC: @@ -274,5 +289,7 @@ case SCO_HASH: SCHash hash; case SCO_PUBLIC_KEY: PublicKey publicKey; +case SCO_CONTRACT_CODE: + SCContractCode contractCode; }; }