Skip to content

Commit

Permalink
[SON-24] - SON Rewards missing serialisations and end to end testing (#…
Browse files Browse the repository at this point in the history
…313)

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
  • Loading branch information
sierra19XX and sierra19XX authored Mar 20, 2020
1 parent ed4ebfd commit 096af5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace graphene { namespace chain {
time_point_sec last_budget_time;
share_type witness_budget;
//Last SON Payout time, it can be different to the maintenance interval time
time_point_sec last_son_payout_time;
time_point_sec last_son_payout_time = HARDFORK_SON_TIME;
share_type son_budget = 0;
uint32_t accounts_registered_this_interval = 0;
/**
Expand Down Expand Up @@ -138,6 +138,8 @@ FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::
(next_maintenance_time)
(last_budget_time)
(witness_budget)
(last_son_payout_time)
(son_budget)
(accounts_registered_this_interval)
(recently_missed_count)
(current_aslot)
Expand Down
4 changes: 4 additions & 0 deletions libraries/chain/son_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ object_id_type son_heartbeat_evaluator::do_apply(const son_heartbeat_operation&
{
sso.current_interval_downtime += op.ts.sec_since_epoch() - sso.last_down_timestamp.sec_since_epoch();
sso.last_active_timestamp = op.ts;
// TODO: Remove me after sidechain tx signing is finished
sso.txs_signed = sso.txs_signed + 1;
} );

db().modify(*itr, [&is_son_active](son_object &so) {
Expand All @@ -154,6 +156,8 @@ object_id_type son_heartbeat_evaluator::do_apply(const son_heartbeat_operation&
db().modify( itr->statistics( db() ), [&]( son_statistics_object& sso )
{
sso.last_active_timestamp = op.ts;
// TODO: Remove me after sidechain tx signing is finished
sso.txs_signed = sso.txs_signed + 1;
} );
}
}
Expand Down

0 comments on commit 096af5e

Please sign in to comment.