#319 vote id type as map #666
4 changed files with 18 additions and 12 deletions
|
|
@ -1,24 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <fc/reflect/reflect.hpp>
|
||||
#include <fc/exception/exception.hpp>
|
||||
|
||||
namespace graphene { namespace chain {
|
||||
|
||||
enum class sidechain_type {
|
||||
unknown,
|
||||
bitcoin,
|
||||
ethereum,
|
||||
eos,
|
||||
peerplays,
|
||||
hive
|
||||
hive,
|
||||
SIDECHAIN_TYPE_COUNT
|
||||
};
|
||||
|
||||
inline size_t sidechain_type_to_size_t(sidechain_type sidechain){ return static_cast<size_t>(sidechain); }
|
||||
|
||||
inline sidechain_type size_t_to_sidechain_type(size_t sidechain)
|
||||
{
|
||||
if(sidechain >= static_cast<size_t>(sidechain_type::SIDECHAIN_TYPE_COUNT))
|
||||
FC_THROW("Wrong sidechain_type: ${sidechain}", ("sidechain", sidechain));
|
||||
|
||||
return static_cast<sidechain_type>(sidechain);
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
FC_REFLECT_ENUM(graphene::chain::sidechain_type,
|
||||
(unknown)
|
||||
(bitcoin)
|
||||
(ethereum)
|
||||
(eos)
|
||||
(peerplays)
|
||||
(hive)
|
||||
(peerplays) )
|
||||
(SIDECHAIN_TYPE_COUNT))
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace graphene { namespace chain {
|
|||
static const uint8_t type_id = sidechain_transaction_object_type;
|
||||
|
||||
time_point_sec timestamp;
|
||||
sidechain_type sidechain = sidechain_type::unknown;
|
||||
sidechain_type sidechain;
|
||||
object_id_type object_id;
|
||||
std::string transaction;
|
||||
std::vector<son_info> signers;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace graphene { namespace chain {
|
|||
|
||||
time_point_sec timestamp;
|
||||
uint32_t block_num;
|
||||
sidechain_type sidechain = sidechain_type::unknown;
|
||||
sidechain_type sidechain;
|
||||
std::string sidechain_uid;
|
||||
std::string sidechain_transaction_id;
|
||||
std::string sidechain_from;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace graphene { namespace chain {
|
|||
|
||||
time_point_sec timestamp;
|
||||
uint32_t block_num;
|
||||
sidechain_type sidechain = sidechain_type::unknown;
|
||||
sidechain_type sidechain;
|
||||
std::string peerplays_uid;
|
||||
std::string peerplays_transaction_id;
|
||||
chain::account_id_type peerplays_from;
|
||||
|
|
|
|||
Loading…
Reference in a new issue