default initialize rpc structures

This commit is contained in:
moneromooo-monero 2019-01-18 01:05:58 +00:00
parent ef93b0995c
commit e396146aee
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
12 changed files with 658 additions and 330 deletions

View file

@ -128,7 +128,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 1;
struct request
struct request_t
{
block_complete_entry b;
uint64_t current_blockchain_height;
@ -138,6 +138,7 @@ namespace cryptonote
KV_SERIALIZE(current_blockchain_height)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
/************************************************************************/
@ -147,7 +148,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 2;
struct request
struct request_t
{
std::vector<blobdata> txs;
std::string _; // padding
@ -157,6 +158,7 @@ namespace cryptonote
KV_SERIALIZE(_)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
/************************************************************************/
/* */
@ -165,7 +167,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 3;
struct request
struct request_t
{
std::vector<crypto::hash> txs;
std::vector<crypto::hash> blocks;
@ -175,13 +177,14 @@ namespace cryptonote
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(blocks)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
struct NOTIFY_RESPONSE_GET_OBJECTS
{
const static int ID = BC_COMMANDS_POOL_BASE + 4;
struct request
struct request_t
{
std::vector<blobdata> txs;
std::vector<block_complete_entry> blocks;
@ -195,6 +198,7 @@ namespace cryptonote
KV_SERIALIZE(current_blockchain_height)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
@ -219,7 +223,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 6;
struct request
struct request_t
{
std::list<crypto::hash> block_ids; /*IDs of the first 10 blocks are sequential, next goes with pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
@ -227,13 +231,14 @@ namespace cryptonote
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(block_ids)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
struct NOTIFY_RESPONSE_CHAIN_ENTRY
{
const static int ID = BC_COMMANDS_POOL_BASE + 7;
struct request
struct request_t
{
uint64_t start_height;
uint64_t total_height;
@ -247,6 +252,7 @@ namespace cryptonote
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(m_block_ids)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
/************************************************************************/
@ -256,7 +262,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 8;
struct request
struct request_t
{
block_complete_entry b;
uint64_t current_blockchain_height;
@ -266,6 +272,7 @@ namespace cryptonote
KV_SERIALIZE(current_blockchain_height)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
/************************************************************************/
@ -275,7 +282,7 @@ namespace cryptonote
{
const static int ID = BC_COMMANDS_POOL_BASE + 9;
struct request
struct request_t
{
crypto::hash block_hash;
uint64_t current_blockchain_height;
@ -287,6 +294,7 @@ namespace cryptonote
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(missing_tx_indices)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;
};
}