-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblockaid.hpp
More file actions
63 lines (42 loc) · 1.71 KB
/
Copy pathblockaid.hpp
File metadata and controls
63 lines (42 loc) · 1.71 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
/**
* @file
* @copyright defined in eos/LICENSE.txt
*/
#pragma once
#include <eosiolib/time.hpp>
namespace blockaid {
using eosio::contract;
class blockaid : public contract {
public:
explicit blockaid(account_name self);
//@abi table userdata i64
struct user_data {
uint64_t info_id;
std::string packed_data;
time update_time = now();
auto primary_key()const { return info_id; }
EOSLIB_SERIALIZE( user_data, (info_id)(packed_data)(update_time) )
};
typedef eosio::multi_index< N(userdata), user_data > user_data_table;
//@abi table requests i64
struct requests {
uint64_t req_id;
uint64_t info_id;
std::string status;
time update_time = now();
auto primary_key()const { return req_id; }
EOSLIB_SERIALIZE( requests, (req_id)(info_id)(status)(update_time) )
};
typedef eosio::multi_index< N(requests), requests > request_table;
public:
//@abi action
void uploadinfo( account_name user, std::string packed_data, std::string memo);
//@abi action
void updateinfo( account_name user, uint64_t info_id, std::string packed_data, std::string memo);
//@abi action
void reqremove( account_name user, uint64_t reg_info_id, std::string memo);
//@abi action
void updatereq(account_name user, uint64_t req_id, std::string new_status, std::string memo);
};
}
EOSIO_ABI( blockaid::blockaid, (uploadinfo)(updateinfo)(reqremove)(updatereq) )