drt_sc/
err_msg.rs

1pub const PANIC_OCCURRED: &str = "panic occurred";
2pub const MEM_ALLOC_ERROR: &str = "memory allocation error";
3
4pub const NON_PAYABLE_FUNC_DCDT: &str = "function does not accept DCDT payment";
5pub const BAD_TOKEN_PROVIDED: &str = "bad call value token provided";
6pub const BAD_TOKEN_TICKER_FORMAT: &str = "bad token ticker format";
7pub const SINGLE_DCDT_EXPECTED: &str = "function expects single DCDT payment";
8pub const TOO_MANY_DCDT_TRANSFERS: &str = "too many DCDT transfers";
9pub const DCDT_INVALID_TOKEN_INDEX: &str = "invalid token index";
10pub const INCORRECT_NUM_DCDT_TRANSFERS: &str = "incorrect number of DCDT transfers";
11pub static FUNGIBLE_TOKEN_EXPECTED_ERR_MSG: &str = "fungible DCDT token expected";
12
13pub const ARG_WRONG_NUMBER: &str = "wrong number of arguments";
14pub const ARG_ASYNC_WRONG_NUMBER: &str = "wrong number of arguments provided to async call";
15pub const ARG_ASYNC_RETURN_WRONG_NUMBER: &str = "wrong number of arguments returned by async call";
16pub const ARG_CALLBACK_TOO_FEW: &str = "too few callback arguments provided";
17pub const ARG_CALLBACK_TOO_MANY: &str = "too many callback arguments provided";
18
19pub const ARG_OUT_OF_RANGE: &str = "argument out of range";
20pub const ARG_BAD_LENGTH: &str = "argument has wrong length";
21pub const ARG_BAD_LENGTH_32: &str = "argument has wrong length: 32 bytes expected";
22pub const ARG_DECODE_ERROR_1: &str = "argument decode error (";
23pub const ARG_DECODE_ERROR_2: &str = "): ";
24pub const STORAGE_VALUE_OUT_OF_RANGE: &str = "storage value out of range";
25pub const STORAGE_DECODE_ERROR_1: &str = "storage decode error (key: ";
26pub const STORAGE_DECODE_ERROR_2: &str = "): ";
27pub const STORAGE_ENCODE_ERROR: &str = "storage encode error: ";
28pub const STORAGE_KEY_ENCODE_ERROR: &str = "storage key encode error: ";
29pub const STORAGE_VALUE_EXCEEDS_BUFFER: &str = "storage value exceeds buffer";
30pub const FINISH_ENCODE_ERROR: &str = "endpoint result encode error: ";
31pub const SERIALIZER_DECODE_ERROR: &str = "serializer decode error: ";
32pub const SERIALIZER_ENCODE_ERROR: &str = "serializer encode error: ";
33pub const FORMATTER_ENCODE_ERROR: &str = "formatter encode error: ";
34pub const LOG_TOPIC_ENCODE_ERROR: &str = "log topic encode error: ";
35pub const LOG_DATA_ENCODE_ERROR: &str = "log data encode error: ";
36pub const CONTRACT_CALL_ENCODE_ERROR: &str = "contract call encode error: ";
37
38pub const VALUE_EXCEEDS_SLICE: &str = "value exceeds target slice";
39pub const CAST_TO_I64_ERROR: &str = "cast to i64 error";
40pub const BIG_UINT_EXCEEDS_SLICE: &str = "big uint as_bytes exceed target slice";
41pub const BIG_UINT_SUB_NEGATIVE: &str = "cannot subtract because result would be negative";
42pub const UNSIGNED_NEGATIVE: &str = "cannot convert to unsigned, number is negative";
43
44pub const DESERIALIZATION_INVALID_BYTE: &str = "call data deserialization error: not a valid byte";
45pub const DESERIALIZATION_NOT_32_BYTES: &str =
46    "call data deserialization error: 32 as_bytes expected";
47pub const DESERIALIZATION_ODD_DIGITS: &str =
48    "call data deserialization error: odd number of digits in hex representation";
49pub const DESERIALIZATION_ARG_OUT_OF_RANGE: &str =
50    "call data deserialization error: argument out of range";
51
52pub const CALLBACK_BAD_FUNC: &str = "no callback function with that name exists in contract";
53
54pub const RECIPIENT_ADDRESS_NOT_SET: &str = "recipient address not set";
55pub static ONLY_OWNER_CALLER: &str = "Endpoint can only be called by owner";
56pub static ONLY_USER_ACCOUNT_CALLER: &str = "Endpoint can only be called by user accounts";
57
58pub const STORAGE_NOT_I64: &str = "storage not i64";
59pub const STORAGE_NOT_32_BYTES: &str = "32 bytes of data expected in storage at key";
60
61/// An additional non-VM status, meant just to signal an error in the debugger infrastructure of in the tests.
62pub const DEBUG_API_ERR_STATUS: u64 = 100;
63pub const DEBUG_API_ERR_HANDLE_STALE: &str =
64    "VMHooksApi misuse: operation called with a handle that does not point to the top context of the call stack";
65pub const DEBUG_API_ERR_HANDLE_CONTEXT_MISMATCH: &str =
66    "VMHooksApi misuse: operation called with handles from 2 different contexts";