32 #include <boost/multi_index/composite_key.hpp> 34 namespace graphene {
namespace chain {
78 static constexpr uint32_t lock_forever_update_steps = 4;
79 static constexpr uint32_t seconds_per_lock_forever_update_step = 180 * 86400;
80 static constexpr uint32_t seconds_per_charging_step = 15 * 86400;
81 static constexpr uint32_t seconds_to_cancel_charging = 7 * 86400;
83 static constexpr uint32_t _seconds_to_downgrade[] = { 180 * 86400, 180 * 86400, 360 * 86400 };
84 return _seconds_to_downgrade[
static_cast<uint8_t
>(i) ];
87 static constexpr uint8_t _value_multiplier_v1[] = { 1, 2, 4, 8, 8, 0 };
88 static constexpr uint8_t _value_multiplier_v2[] = { 0, 2, 4, 8, 8, 0 };
89 return ( version ==
ticket_v1 ? _value_multiplier_v1[ static_cast<uint8_t>(i) ]
90 : _value_multiplier_v2[ static_cast<uint8_t>(i) ] );
116 struct by_next_update;
122 typedef multi_index_container<
125 ordered_unique< tag<by_id>, member< object, object_id_type, &object::id > >,
126 ordered_unique< tag<by_next_update>,
127 composite_key< ticket_object,
128 member< ticket_object, time_point_sec, &ticket_object::next_auto_update_time>,
129 member< object, object_id_type, &object::id>
132 ordered_unique< tag<by_account>,
133 composite_key< ticket_object,
134 member< ticket_object, account_id_type, &ticket_object::account>,
135 member< object, object_id_type, &object::id>
generic_index< ticket_object, ticket_multi_index_type > ticket_index
static uint8_t value_multiplier(ticket_type i, ticket_version version)
ticket_type
Type of a ticket.
ticket_type target_type
The target type of the ticket.
multi_index_container< ticket_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_next_update >, composite_key< ticket_object, member< ticket_object, time_point_sec, &ticket_object::next_auto_update_time >, member< object, object_id_type, &object::id > > >, ordered_unique< tag< by_account >, composite_key< ticket_object, member< ticket_object, account_id_type, &ticket_object::account >, member< object, object_id_type, &object::id > > > >> ticket_multi_index_type
static uint32_t seconds_to_downgrade(ticket_type i)
#define MAP_OBJECT_ID_TO_TYPE(OBJECT)
FC_REFLECT_TYPENAME(fc::log_message)
FC_REFLECT_ENUM(graphene::net::core_message_type_enum,(trx_message_type)(block_message_type)(core_message_type_first)(item_ids_inventory_message_type)(blockchain_item_ids_inventory_message_type)(fetch_blockchain_item_ids_message_type)(fetch_items_message_type)(item_not_available_message_type)(hello_message_type)(connection_accepted_message_type)(connection_rejected_message_type)(address_request_message_type)(address_message_type)(closing_connection_message_type)(current_time_request_message_type)(current_time_reply_message_type)(check_firewall_message_type)(check_firewall_reply_message_type)(get_current_connections_request_message_type)(get_current_connections_reply_message_type)(core_message_type_last))(different_chain)(already_connected)(connected_to_self)(not_accepting_connections)(blocked)(invalid_hello_message)(client_too_old))(inbound)(outbound))(firewalled)(not_firewalled))(unable_to_connect)(connection_successful)) namespace std
static time_point_sec maximum()
time_point_sec next_auto_update_time
The next time that the ticket will be automatically updated.
asset amount
The token type and amount in the ticket.
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
ticket_type current_type
The current type of the ticket.
ticket_status status
The status of the ticket.
ticket_status
Status of a ticket.
ticket_version
Version of a ticket.
account_id_type account
The account who owns the ticket.
a ticket for governance voting
share_type value
The current value of the ticket.