#319 - return sidechain_type enum class
This commit is contained in:
parent
43cfcd07b2
commit
34608c1c9d
4 changed files with 14 additions and 18 deletions
|
|
@ -1,28 +1,24 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fc/reflect/reflect.hpp>
|
#include <fc/reflect/reflect.hpp>
|
||||||
#include <fc/exception/exception.hpp>
|
|
||||||
|
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
enum class sidechain_type {
|
enum class sidechain_type {
|
||||||
|
unknown,
|
||||||
bitcoin,
|
bitcoin,
|
||||||
|
ethereum,
|
||||||
|
eos,
|
||||||
peerplays,
|
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)
|
|
||||||
{
|
|
||||||
FC_ASSERT(sidechain < static_cast<size_t>(sidechain_type::SIDECHAIN_TYPE_COUNT), "Wrong sidechain_type: ${sidechain}", ("sidechain", sidechain));
|
|
||||||
return static_cast<sidechain_type>(sidechain);
|
|
||||||
}
|
|
||||||
|
|
||||||
} }
|
} }
|
||||||
|
|
||||||
FC_REFLECT_ENUM(graphene::chain::sidechain_type,
|
FC_REFLECT_ENUM(graphene::chain::sidechain_type,
|
||||||
(bitcoin)
|
(unknown)
|
||||||
(peerplays)
|
(bitcoin)
|
||||||
(hive)
|
(ethereum)
|
||||||
(SIDECHAIN_TYPE_COUNT))
|
(eos)
|
||||||
|
(hive)
|
||||||
|
(peerplays) )
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace graphene { namespace chain {
|
||||||
static const uint8_t type_id = sidechain_transaction_object_type;
|
static const uint8_t type_id = sidechain_transaction_object_type;
|
||||||
|
|
||||||
time_point_sec timestamp;
|
time_point_sec timestamp;
|
||||||
sidechain_type sidechain;
|
sidechain_type sidechain = sidechain_type::unknown;
|
||||||
object_id_type object_id;
|
object_id_type object_id;
|
||||||
std::string transaction;
|
std::string transaction;
|
||||||
std::vector<son_info> signers;
|
std::vector<son_info> signers;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
time_point_sec timestamp;
|
time_point_sec timestamp;
|
||||||
uint32_t block_num;
|
uint32_t block_num;
|
||||||
sidechain_type sidechain;
|
sidechain_type sidechain = sidechain_type::unknown;
|
||||||
std::string sidechain_uid;
|
std::string sidechain_uid;
|
||||||
std::string sidechain_transaction_id;
|
std::string sidechain_transaction_id;
|
||||||
std::string sidechain_from;
|
std::string sidechain_from;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace graphene { namespace chain {
|
||||||
|
|
||||||
time_point_sec timestamp;
|
time_point_sec timestamp;
|
||||||
uint32_t block_num;
|
uint32_t block_num;
|
||||||
sidechain_type sidechain;
|
sidechain_type sidechain = sidechain_type::unknown;
|
||||||
std::string peerplays_uid;
|
std::string peerplays_uid;
|
||||||
std::string peerplays_transaction_id;
|
std::string peerplays_transaction_id;
|
||||||
chain::account_id_type peerplays_from;
|
chain::account_id_type peerplays_from;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue