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 auth errors #69

Merged
merged 2 commits into from
Feb 6, 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
13 changes: 12 additions & 1 deletion Stellar-contract.x
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ enum SCStatusType
SST_HOST_STORAGE_ERROR = 5,
SST_HOST_CONTEXT_ERROR = 6,
SST_VM_ERROR = 7,
SST_CONTRACT_ERROR = 8
SST_CONTRACT_ERROR = 8,
SST_HOST_AUTH_ERROR = 9
// TODO: add more
};

Expand Down Expand Up @@ -128,6 +129,14 @@ enum SCHostStorageErrorCode
HOST_STORAGE_GET_ON_DELETED_KEY = 5
};

enum SCHostAuthErrorCode
{
HOST_AUTH_UNKNOWN_ERROR = 0,
HOST_AUTH_NONCE_ERROR = 1,
HOST_AUTH_DUPLICATE_AUTHORIZATION = 2,
HOST_AUTH_NOT_AUTHORIZED = 3
};

enum SCHostContextErrorCode
{
HOST_CONTEXT_UNKNOWN_ERROR = 0,
Expand Down Expand Up @@ -182,6 +191,8 @@ case SST_VM_ERROR:
SCVmErrorCode vmCode;
case SST_CONTRACT_ERROR:
uint32 contractCode;
case SST_HOST_AUTH_ERROR:
SCHostAuthErrorCode authCode;
};

union SCVal switch (SCValType type)
Expand Down