-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathxserver_response_code.h
More file actions
82 lines (80 loc) · 2.5 KB
/
xserver_response_code.h
File metadata and controls
82 lines (80 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright (c) 2017-2018 Telos Foundation & contributors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <string>
#include <unordered_map>
namespace top
{
namespace httpserver
{
#define DO_TX_ACTION 100
enum xhttp_action
{
account_balance = 0,
account_info,
account_history,
account_pending,
last_digest,
tps_query,
query_property,
query_all_property,
query_online_tx,
query_reward,
account_create = DO_TX_ACTION,
transfer_out,
transfer_in,
give,
set_property,
publish_contract,
exec_contract
};
static std::unordered_map<std::string, xhttp_action> g_action_map = {\
{"account_balance", account_balance},\
{"account_info", account_info},\
{"account_create", account_create},\
{"transfer_out", transfer_out},\
{"transfer_in", transfer_in},\
{"account_history", account_history},\
{"account_pending", account_pending},\
{"last_digest", last_digest},\
{"tps_query", tps_query},\
{"set_property", set_property},\
{"query_property", query_property},\
{"query_all_property", query_all_property},\
{"give", give},\
{"query_online_tx", query_online_tx},\
{"query_reward", query_reward},\
{"publish_contract", publish_contract},\
{"exec_contract", exec_contract}
};
enum xhttp_error_code
{
ok = 0,
json_parser_error,
action_not_find,
account_is_empty,
property_key_is_empty,
account_is_not_exist,
property_key_is_not_exist,
account_is_exist,
signature_verify_fail,
balance_is_not_enough,
source_and_destination_same,
last_hash_is_not_equal,
miss_parameter,
per_page_too_large,
property_key_not_valid,
already_give,
server_unknown_error,
request_time_out,
};
class xserver_response_code
{
public:
std::string to_string() const;
public:
xhttp_error_code m_code;
};
}
}