Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unit/void case explicit and support more tuples in union spec #67

Merged
merged 2 commits into from
Feb 4, 2023
Merged
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
24 changes: 22 additions & 2 deletions Stellar-contract-spec.x
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,31 @@ struct SCSpecUDTStructV0
SCSpecUDTStructFieldV0 fields<40>;
};

struct SCSpecUDTUnionCaseV0
struct SCSpecUDTUnionCaseVoidV0
{
string doc<SC_SPEC_DOC_LIMIT>;
string name<60>;
SCSpecTypeDef *type;
};

struct SCSpecUDTUnionCaseTupleV0
{
string doc<SC_SPEC_DOC_LIMIT>;
string name<60>;
SCSpecTypeDef type<12>;
};

enum SCSpecUDTUnionCaseV0Kind
{
SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0,
SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1,
};

union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind)
{
case SC_SPEC_UDT_UNION_CASE_VOID_V0:
SCSpecUDTUnionCaseVoidV0 voidCase;
case SC_SPEC_UDT_UNION_CASE_TUPLE_V0:
SCSpecUDTUnionCaseTupleV0 tupleCase;
};

struct SCSpecUDTUnionV0
Expand Down