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

Add SCContractCode and update related types #17

Merged
merged 1 commit into from
Aug 11, 2022
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
21 changes: 19 additions & 2 deletions Stellar-contract.x
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
};
Expand Down Expand Up @@ -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<SCVAL_LIMIT>;
case SCCONTRACT_CODE_TOKEN:
void;
};

union SCObject switch (SCObjectType type)
{
case SCO_VEC:
Expand All @@ -274,5 +289,7 @@ case SCO_HASH:
SCHash hash;
case SCO_PUBLIC_KEY:
PublicKey publicKey;
case SCO_CONTRACT_CODE:
SCContractCode contractCode;
};
}