BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
a ticket for governance voting More...
#include <ticket_object.hpp>
Public Member Functions | |
void | init_new (time_point_sec now, account_id_type new_account, ticket_type new_target_type, const asset &new_amount, ticket_version version) |
Initialize member variables for a ticket newly created from account balance. More... | |
void | init_split (time_point_sec now, const ticket_object &old_ticket, ticket_type new_target_type, const asset &new_amount, ticket_version version) |
Initialize member variables for a ticket split from another ticket. More... | |
void | update_target_type (time_point_sec now, ticket_type new_target_type, ticket_version version) |
Set a new target type and update member variables accordingly. More... | |
void | adjust_amount (const asset &delta_amount, ticket_version version) |
Adjust amount and update member variables accordingly. More... | |
void | auto_update (ticket_version version) |
Update the ticket when it's time. More... | |
Public Member Functions inherited from graphene::db::abstract_object< ticket_object, protocol_ids, ticket_object_type > | |
abstract_object () | |
object_id< SpaceID, TypeID > | get_id () const |
Public Member Functions inherited from graphene::db::base_abstract_object< ticket_object > | |
std::unique_ptr< object > | clone () const override |
void | move_from (object &obj) override |
fc::variant | to_variant () const override |
std::vector< char > | pack () const override |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
Public Member Functions inherited from graphene::db::object | |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
virtual | ~object ()=default |
virtual std::unique_ptr< object > | clone () const =0 |
virtual fc::variant | to_variant () const =0 |
virtual std::vector< char > | pack () const =0 |
Static Public Member Functions | |
static uint32_t | seconds_to_downgrade (ticket_type i) |
static uint8_t | value_multiplier (ticket_type i, ticket_version version) |
Public Attributes | |
account_id_type | account |
The account who owns the ticket. More... | |
ticket_type | target_type |
The target type of the ticket. More... | |
asset | amount |
The token type and amount in the ticket. More... | |
ticket_type | current_type |
The current type of the ticket. More... | |
ticket_status | status |
The status of the ticket. More... | |
share_type | value |
The current value of the ticket. More... | |
time_point_sec | next_auto_update_time |
The next time that the ticket will be automatically updated. More... | |
time_point_sec | next_type_downgrade_time = time_point_sec::maximum() |
When the account has ever started a downgrade or withdrawal, the scheduled auto-update time is stored here. More... | |
Public Attributes inherited from graphene::db::object | |
object_id_type | id |
Static Public Attributes | |
static constexpr uint32_t | lock_forever_update_steps = 4 |
static constexpr uint32_t | seconds_per_lock_forever_update_step = 180 * 86400 |
static constexpr uint32_t | seconds_per_charging_step = 15 * 86400 |
static constexpr uint32_t | seconds_to_cancel_charging = 7 * 86400 |
Static Public Attributes inherited from graphene::db::abstract_object< ticket_object, protocol_ids, ticket_object_type > | |
static constexpr uint8_t | space_id |
static constexpr uint8_t | type_id |
a ticket for governance voting
Definition at line 62 of file ticket_object.hpp.
void ticket_object::adjust_amount | ( | const asset & | delta_amount, |
ticket_version | version | ||
) |
Adjust amount and update member variables accordingly.
Definition at line 95 of file ticket_object.cpp.
void ticket_object::auto_update | ( | ticket_version | version | ) |
Update the ticket when it's time.
Definition at line 101 of file ticket_object.cpp.
void ticket_object::init_new | ( | time_point_sec | now, |
account_id_type | new_account, | ||
ticket_type | new_target_type, | ||
const asset & | new_amount, | ||
ticket_version | version | ||
) |
Initialize member variables for a ticket newly created from account balance.
Definition at line 31 of file ticket_object.cpp.
void ticket_object::init_split | ( | time_point_sec | now, |
const ticket_object & | old_ticket, | ||
ticket_type | new_target_type, | ||
const asset & | new_amount, | ||
ticket_version | version | ||
) |
Initialize member variables for a ticket split from another ticket.
Definition at line 46 of file ticket_object.cpp.
|
inlinestatic |
Definition at line 82 of file ticket_object.hpp.
void ticket_object::update_target_type | ( | time_point_sec | now, |
ticket_type | new_target_type, | ||
ticket_version | version | ||
) |
Set a new target type and update member variables accordingly.
Definition at line 61 of file ticket_object.cpp.
|
inlinestatic |
Definition at line 86 of file ticket_object.hpp.
account_id_type graphene::chain::ticket_object::account |
The account who owns the ticket.
Definition at line 65 of file ticket_object.hpp.
asset graphene::chain::ticket_object::amount |
The token type and amount in the ticket.
Definition at line 67 of file ticket_object.hpp.
ticket_type graphene::chain::ticket_object::current_type |
The current type of the ticket.
Definition at line 69 of file ticket_object.hpp.
|
staticconstexpr |
Definition at line 78 of file ticket_object.hpp.
time_point_sec graphene::chain::ticket_object::next_auto_update_time |
The next time that the ticket will be automatically updated.
Definition at line 72 of file ticket_object.hpp.
time_point_sec graphene::chain::ticket_object::next_type_downgrade_time = time_point_sec::maximum() |
When the account has ever started a downgrade or withdrawal, the scheduled auto-update time is stored here.
Definition at line 75 of file ticket_object.hpp.
|
staticconstexpr |
Definition at line 80 of file ticket_object.hpp.
|
staticconstexpr |
Definition at line 79 of file ticket_object.hpp.
|
staticconstexpr |
Definition at line 81 of file ticket_object.hpp.
ticket_status graphene::chain::ticket_object::status |
The status of the ticket.
Definition at line 70 of file ticket_object.hpp.
ticket_type graphene::chain::ticket_object::target_type |
The target type of the ticket.
Definition at line 66 of file ticket_object.hpp.
share_type graphene::chain::ticket_object::value |
The current value of the ticket.
Definition at line 71 of file ticket_object.hpp.