From 5dcd59556958110504d65d91c97d6adf502bf0a7 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:56:13 -0700 Subject: [PATCH 1/2] Add XDR types for contract meta --- Stellar-contract-meta.x | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Stellar-contract-meta.x diff --git a/Stellar-contract-meta.x b/Stellar-contract-meta.x new file mode 100644 index 0000000..6ee745f --- /dev/null +++ b/Stellar-contract-meta.x @@ -0,0 +1,23 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// 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 + +// The contract spec XDR is highly experimental, incomplete, and still being +// iterated on. Breaking changes expected. + +% #include "xdr/Stellar-types.h" +namespace stellar +{ + +enum SCMetaKind +{ + SC_META_KIND_SDK = 0 +}; + +union SCMetaEntry switch (SCMetaKind kind) +{ +case SC_META_KIND_SDK: + string sdk<256>; +}; + +} From 48f04e0d563a22e362b99393e8ad139e92bd1efc Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:59:13 -0700 Subject: [PATCH 2/2] generic --- Stellar-contract-meta.x | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Stellar-contract-meta.x b/Stellar-contract-meta.x index 6ee745f..dd14e5d 100644 --- a/Stellar-contract-meta.x +++ b/Stellar-contract-meta.x @@ -9,15 +9,21 @@ namespace stellar { +struct SCMetaV0 +{ + string key<10>; + string val<256>; +}; + enum SCMetaKind { - SC_META_KIND_SDK = 0 + SC_META_V0 = 0 }; union SCMetaEntry switch (SCMetaKind kind) { -case SC_META_KIND_SDK: - string sdk<256>; +case SC_META_V0: + SCMetaV0 v0; }; }