30 #include <graphene/chain/hardfork.hpp> 34 namespace graphene {
namespace chain {
41 FC_ASSERT( HARDFORK_CORE_2103_PASSED(block_time),
"Not allowed until hardfork 2103" );
63 aso.total_pol_value += new_ticket_object.
value;
66 return new_ticket_object.id;
75 FC_ASSERT( _ticket->account == op.
account,
"Ticket is not owned by the account" );
77 FC_ASSERT( _ticket->current_type !=
lock_forever,
"Can not to update a ticket that is locked forever" );
79 FC_ASSERT( static_cast<uint64_t>(_ticket->target_type) != op.
target_type,
"Target type does not change" );
107 obj.init_split( block_time, *_ticket, op.
target_type, *op.amount_for_new_target, version );
115 delta_value = new_ticket_object.
value + _ticket->value - old_value;
122 delta_value = _ticket->
value - old_value;
126 if( delta_value != 0 )
flat_set< object_id_type > new_objects
share_type total_core_pol
Total amount of core token in other tickets.
void modify(const T &obj, const Lambda &m)
void adjust_amount(const asset &delta_amount, ticket_version version)
Adjust amount and update member variables accordingly.
void adjust_balance(account_id_type account, asset delta)
Adjust a particular account's balance in a given asset by a delta.
asset amount
The amount of the ticket.
object_id_type do_apply(const ticket_create_operation &op)
time_point_sec head_block_time() const
ticket_type target_type
The target type of the ticket.
tracks the blockchain state in an extensible manner
ticket_id_type ticket
The ticket to update.
void_result do_evaluate(const ticket_update_operation &op)
share_type total_pol_value
Total value of tickets whose current type is not lock_forever.
Updates an existing ticket.
void_result do_evaluate(const ticket_create_operation &op)
asset amount
The token type and amount in the ticket.
generic_operation_result do_apply(const ticket_update_operation &op)
account_id_type account
The account who owns the ticket.
optional< asset > amount_for_new_target
The amount to be used for the new target.
#define FC_CAPTURE_AND_RETHROW(...)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
time_point_sec next_maintenance_time
unsigned_int target_type
New target ticket type, see ticket_type.
flat_set< object_id_type > removed_objects
const account_statistics_object & get_account_stats_by_owner(account_id_type owner) const
generic_operation_result process_tickets()
flat_set< object_id_type > updated_objects
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.
const dynamic_global_property_object & get_dynamic_global_properties() const
account_id_type account
The account who creates the ticket.
ticket_version
Version of a ticket.
account_id_type account
The account who owns the ticket.
a ticket for governance voting
const T & create(F &&constructor)