BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
graphene::chain::ticket_object Class Reference

a ticket for governance voting More...

#include <ticket_object.hpp>

Inheritance diagram for graphene::chain::ticket_object:
graphene::db::abstract_object< ticket_object > graphene::db::object

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 >
virtual unique_ptr< objectclone () const
 these methods are implemented for derived classes by inheriting abstract_object<DerivedClass> More...
 
virtual void move_from (object &obj)
 
virtual variant to_variant () const
 
virtual vector< char > pack () const
 
- Public Member Functions inherited from graphene::db::object
 object ()
 
virtual ~object ()
 

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 uint8_t space_id = protocol_ids
 
static constexpr uint8_t type_id = ticket_object_type
 
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
 

Detailed Description

a ticket for governance voting

Definition at line 62 of file ticket_object.hpp.

Member Function Documentation

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.

static uint32_t graphene::chain::ticket_object::seconds_to_downgrade ( ticket_type  i)
inlinestatic

Definition at line 85 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.

static uint8_t graphene::chain::ticket_object::value_multiplier ( ticket_type  i,
ticket_version  version 
)
inlinestatic

Definition at line 89 of file ticket_object.hpp.

Member Data Documentation

account_id_type graphene::chain::ticket_object::account

The account who owns the ticket.

Definition at line 68 of file ticket_object.hpp.

asset graphene::chain::ticket_object::amount

The token type and amount in the ticket.

Definition at line 70 of file ticket_object.hpp.

ticket_type graphene::chain::ticket_object::current_type

The current type of the ticket.

Definition at line 72 of file ticket_object.hpp.

constexpr uint32_t graphene::chain::ticket_object::lock_forever_update_steps = 4
static

Definition at line 81 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 75 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 78 of file ticket_object.hpp.

constexpr uint32_t graphene::chain::ticket_object::seconds_per_charging_step = 15 * 86400
static

Definition at line 83 of file ticket_object.hpp.

constexpr uint32_t graphene::chain::ticket_object::seconds_per_lock_forever_update_step = 180 * 86400
static

Definition at line 82 of file ticket_object.hpp.

constexpr uint32_t graphene::chain::ticket_object::seconds_to_cancel_charging = 7 * 86400
static

Definition at line 84 of file ticket_object.hpp.

constexpr uint8_t graphene::chain::ticket_object::space_id = protocol_ids
static

Definition at line 65 of file ticket_object.hpp.

ticket_status graphene::chain::ticket_object::status

The status of the ticket.

Definition at line 73 of file ticket_object.hpp.

ticket_type graphene::chain::ticket_object::target_type

The target type of the ticket.

Definition at line 69 of file ticket_object.hpp.

constexpr uint8_t graphene::chain::ticket_object::type_id = ticket_object_type
static

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 74 of file ticket_object.hpp.


The documentation for this class was generated from the following files: