-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.h
199 lines (164 loc) · 3.47 KB
/
Common.h
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#pragma once
#include <afx.h>
#include <iostream>
#include <memory>
#include <thread>
#include <mutex>
#include <map>
//JSON Header
#include <rapidjson.h>
#include <document.h>
#include <writer.h>
#include <reader.h>
#include <stringbuffer.h>
#include <stringbuffer.h>
#include <filewritestream.h>
#include <prettywriter.h>
#include <curl/curl.h>
#include "CppSQLite3.h"
static const char* Wallet_DB_Name = "Wallet.db";
static const char* Reward_DB_Name = "Reward.db";
static const char* Result_DB_Name = "Result.db";
typedef enum eDB_Type : unsigned int
{
DB_WALLET = 0,
DB_NETWORK,
DB_PROJECT,
DB_REWARD,
DB_RESULT,
DB_END
}DB_Type;
typedef enum eFile_Type : unsigned int
{
FILE_TYPE_REWARD = 0,
FILE_TYPE_RESULT,
FILE_TYPE_END
}File_Type;
#pragma pack(push, 1)
typedef struct StErrorCode
{
CString Code;
CString Msg;
CString Hex;
StErrorCode()
{
Code.Empty();
Msg.Empty();
Hex.Empty();
}
}ErrorCode;
typedef struct StReward_Result
{
CString Wallet_Address;
CString TransactionHash;
CString ErrorCode;
CString ErrorMsg;
long double Total_Reward_Coin;
long double Price;
__int64 Work_Time;
bool bState;
StReward_Result()
{
Total_Reward_Coin = 0.0f;
Price = 0.0f;
Work_Time = 0;
Wallet_Address.Empty();
TransactionHash.Empty();
ErrorCode.Empty();
ErrorMsg.Empty();
bState = false;
}
}Reward_Result;
typedef struct StReward_Info
{
long double Price;
__int64 Work_Time;
CString Wallet_addr;
CString Time_Unit;
CString Project_ID;
CString SubTask_ID;
StReward_Info()
{
Price = 0.0f;
Work_Time = 0;
Time_Unit.Empty();
Wallet_addr.Empty();
Project_ID.Empty();
SubTask_ID.Empty();
}
}Reward_Info;
typedef struct StRewardList
{
CString Wallet_Address;
CString TxHash;
CString Price;
CString ErrorCode;
CString ErrorMsg;
StRewardList()
{
Wallet_Address.Empty();
TxHash.Empty();
Price.Empty();
ErrorCode.Empty();
ErrorMsg.Empty();
}
}RewardList;
typedef struct StSumReward_Info
{
long double Price;
CString Wallet_addr;
StSumReward_Info()
{
Price = 0.0f;
Wallet_addr.Empty();
}
}SumReward_Info;
typedef struct StReward
{
CString Project_Flag; // RUNNING or DONE
CString Master_Wallet_Addr;
CString Master_Wallet_Privatekey;
std::multimap<CString, struct StReward_Info> Reward_List;
StReward()
{
Project_Flag.Empty();
Master_Wallet_Addr.Empty();
Reward_List.clear();
}
}Reward;
//토큰 재전송을 위해 사용하는 구조체
typedef struct StReReward
{
CString Master_Wallet_Addr;
CString Master_Wallet_Privatekey;
std::map<CString, StRewardList> ReReward_List;
StReReward()
{
Master_Wallet_Addr.Empty();
Master_Wallet_Privatekey.Empty();
ReReward_List.clear();
}
}ReReward;
typedef struct stBalanceInfo
{
long double Balance;
stBalanceInfo()
{
Balance = 0.0f;
}
}BalanceInfo;
typedef struct stReward_Merge
{
CString szWallet_Address;
long double szTotal_Token;
CString szGas_Price;
CString szGas_Limit;
stReward_Merge()
{
szWallet_Address.Empty();
szTotal_Token = 0.0f;
szGas_Price.Empty();
szGas_Limit.Empty();
}
}Reward_Merge;
#pragma pack(pop)