BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet 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, protocol_ids, ticket_object_type > graphene::db::base_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, 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< objectclone () 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< objectclone () 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
 

Detailed Description

a ticket for governance voting

Definition at line 62 of file ticket_object.hpp.

Member Function Documentation

◆ adjust_amount()

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.

◆ auto_update()

void ticket_object::auto_update ( ticket_version  version)

Update the ticket when it's time.

Definition at line 101 of file ticket_object.cpp.

◆ init_new()

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.

◆ init_split()

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.

◆ seconds_to_downgrade()

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

Definition at line 82 of file ticket_object.hpp.

◆ update_target_type()

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.

◆ value_multiplier()

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

Definition at line 86 of file ticket_object.hpp.

Member Data Documentation

◆ account

account_id_type graphene::chain::ticket_object::account

The account who owns the ticket.

Definition at line 65 of file ticket_object.hpp.

◆ amount

asset graphene::chain::ticket_object::amount

The token type and amount in the ticket.

Definition at line 67 of file ticket_object.hpp.

◆ current_type

ticket_type graphene::chain::ticket_object::current_type

The current type of the ticket.

Definition at line 69 of file ticket_object.hpp.

◆ lock_forever_update_steps

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

Definition at line 78 of file ticket_object.hpp.

◆ next_auto_update_time

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.

◆ next_type_downgrade_time

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.

◆ seconds_per_charging_step

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

Definition at line 80 of file ticket_object.hpp.

◆ seconds_per_lock_forever_update_step

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

Definition at line 79 of file ticket_object.hpp.

◆ seconds_to_cancel_charging

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

Definition at line 81 of file ticket_object.hpp.

◆ status

ticket_status graphene::chain::ticket_object::status

The status of the ticket.

Definition at line 70 of file ticket_object.hpp.

◆ target_type

ticket_type graphene::chain::ticket_object::target_type

The target type of the ticket.

Definition at line 66 of file ticket_object.hpp.

◆ value

share_type graphene::chain::ticket_object::value

The current value of the ticket.

Definition at line 71 of file ticket_object.hpp.


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