Merge branch 'develop' of https://github.com/peerplays-network/peerplays into develop
This commit is contained in:
commit
e6386ce034
5 changed files with 98 additions and 9 deletions
|
|
@ -1,7 +1,4 @@
|
|||
// SON HARDFORK Wednesday, January 1, 2020 12:00:00 AM - 1577836800
|
||||
// SON HARDFORK Monday, March 30, 2020 3:00:00 PM - 1585573200
|
||||
// SON HARDFORK Monday, September 21, 2020 1:43:11 PM - 1600695791
|
||||
// SON HARDFORK Tuesday, October 20, 2020 00:00:00 UTC
|
||||
#ifndef HARDFORK_SON_TIME
|
||||
#include <ctime>
|
||||
#define HARDFORK_SON_TIME (fc::time_point_sec( 1585573200 ))
|
||||
#endif
|
||||
#define HARDFORK_SON_TIME (fc::time_point_sec( 1603152000 ))
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ namespace graphene { namespace chain {
|
|||
struct chain_parameters
|
||||
{
|
||||
chain_parameters();
|
||||
chain_parameters(const chain_parameters& other);
|
||||
chain_parameters(chain_parameters&& other);
|
||||
chain_parameters& operator=(const chain_parameters& other);
|
||||
chain_parameters& operator=(chain_parameters&& other);
|
||||
/** using a smart ref breaks the circular dependency created between operations and the fee schedule */
|
||||
std::shared_ptr<fee_schedule> current_fees; ///< current schedule of fees
|
||||
uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks
|
||||
|
|
@ -208,6 +212,8 @@ namespace graphene { namespace chain {
|
|||
inline uint16_t maximum_son_count()const {
|
||||
return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS;
|
||||
}
|
||||
private:
|
||||
static void safe_copy(chain_parameters& to, const chain_parameters& from);
|
||||
};
|
||||
|
||||
} } // graphene::chain
|
||||
|
|
|
|||
|
|
@ -5,4 +5,88 @@ namespace graphene { namespace chain {
|
|||
chain_parameters::chain_parameters() {
|
||||
current_fees = std::make_shared<fee_schedule>();
|
||||
}
|
||||
|
||||
// copy constructor
|
||||
chain_parameters::chain_parameters(const chain_parameters& other)
|
||||
{
|
||||
current_fees = std::make_shared<fee_schedule>(*other.current_fees);
|
||||
safe_copy(*this, other);
|
||||
}
|
||||
|
||||
// copy assignment
|
||||
chain_parameters& chain_parameters::operator=(const chain_parameters& other)
|
||||
{
|
||||
if (&other != this)
|
||||
{
|
||||
current_fees = std::make_shared<fee_schedule>(*other.current_fees);
|
||||
safe_copy(*this, other);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// copies the easy stuff
|
||||
void chain_parameters::safe_copy(chain_parameters& to, const chain_parameters& from)
|
||||
{
|
||||
to.block_interval = from.block_interval;
|
||||
to.maintenance_interval = from.maintenance_interval;
|
||||
to.maintenance_skip_slots = from.maintenance_skip_slots;
|
||||
to.committee_proposal_review_period = from.committee_proposal_review_period;
|
||||
to.maximum_transaction_size = from.maximum_transaction_size;
|
||||
to.maximum_block_size = from.maximum_block_size;
|
||||
to.maximum_time_until_expiration = from.maximum_time_until_expiration;
|
||||
to.maximum_proposal_lifetime = from.maximum_proposal_lifetime;
|
||||
to.maximum_asset_whitelist_authorities = from.maximum_asset_whitelist_authorities;
|
||||
to.maximum_asset_feed_publishers = from.maximum_asset_feed_publishers;
|
||||
to.maximum_witness_count = from.maximum_witness_count;
|
||||
to.maximum_committee_count = from.maximum_committee_count;
|
||||
to.maximum_authority_membership = from.maximum_authority_membership;
|
||||
to.reserve_percent_of_fee = from.reserve_percent_of_fee;
|
||||
to.network_percent_of_fee = from.network_percent_of_fee;
|
||||
to.lifetime_referrer_percent_of_fee = from.lifetime_referrer_percent_of_fee;
|
||||
to.cashback_vesting_period_seconds = from.cashback_vesting_period_seconds;
|
||||
to.cashback_vesting_threshold = from.cashback_vesting_threshold;
|
||||
to.count_non_member_votes = from.count_non_member_votes;
|
||||
to.allow_non_member_whitelists = from.allow_non_member_whitelists;
|
||||
to.witness_pay_per_block = from.witness_pay_per_block;
|
||||
to.witness_pay_vesting_seconds = from.witness_pay_vesting_seconds;
|
||||
to.worker_budget_per_day = from.worker_budget_per_day;
|
||||
to.max_predicate_opcode = from.max_predicate_opcode;
|
||||
to.fee_liquidation_threshold = from.fee_liquidation_threshold;
|
||||
to.accounts_per_fee_scale = from.accounts_per_fee_scale;
|
||||
to.account_fee_scale_bitshifts = from.account_fee_scale_bitshifts;
|
||||
to.max_authority_depth = from.max_authority_depth;
|
||||
to.witness_schedule_algorithm= from.witness_schedule_algorithm;
|
||||
to.min_round_delay = from.min_round_delay;
|
||||
to.max_round_delay = from.max_round_delay;
|
||||
to.min_time_per_commit_move = from.min_time_per_commit_move;
|
||||
to.max_time_per_commit_move = from.max_time_per_commit_move;
|
||||
to.min_time_per_reveal_move = from.min_time_per_reveal_move;
|
||||
to.max_time_per_reveal_move = from.max_time_per_reveal_move;
|
||||
to.rake_fee_percentage = from.rake_fee_percentage;
|
||||
to.maximum_registration_deadline = from.maximum_registration_deadline;
|
||||
to.maximum_players_in_tournament = from.maximum_players_in_tournament;
|
||||
to.maximum_tournament_whitelist_length = from.maximum_tournament_whitelist_length;
|
||||
to.maximum_tournament_start_time_in_future= from.maximum_tournament_start_time_in_future;
|
||||
to.maximum_tournament_start_delay = from.maximum_tournament_start_delay;
|
||||
to.maximum_tournament_number_of_wins = from.maximum_tournament_number_of_wins;
|
||||
to.extensions = from.extensions;
|
||||
}
|
||||
|
||||
// move constructor
|
||||
chain_parameters::chain_parameters(chain_parameters&& other)
|
||||
{
|
||||
current_fees = std::move(other.current_fees);
|
||||
safe_copy(*this, other);
|
||||
}
|
||||
|
||||
// move assignment
|
||||
chain_parameters& chain_parameters::operator=(chain_parameters&& other)
|
||||
{
|
||||
if (&other != this)
|
||||
{
|
||||
current_fees = std::move(other.current_fees);
|
||||
safe_copy(*this, other);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ void transaction::get_required_authorities( flat_set<account_id_type>& active,
|
|||
|
||||
|
||||
|
||||
const flat_set<public_key_type> empty_keyset;
|
||||
|
||||
struct sign_state
|
||||
{
|
||||
|
|
@ -230,7 +231,7 @@ struct sign_state
|
|||
|
||||
sign_state( const flat_set<public_key_type>& sigs,
|
||||
const std::function<const authority*(account_id_type)>& a,
|
||||
const flat_set<public_key_type>& keys = flat_set<public_key_type>() )
|
||||
const flat_set<public_key_type>& keys = empty_keyset )
|
||||
:get_active(a),available_keys(keys)
|
||||
{
|
||||
for( const auto& key : sigs )
|
||||
|
|
@ -445,7 +446,7 @@ void signed_transaction::verify_authority(
|
|||
bool ignore_custom_operation_required_auths,
|
||||
uint32_t max_recursion )const
|
||||
{ try {
|
||||
graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, max_recursion );
|
||||
graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, ignore_custom_operation_required_auths, max_recursion );
|
||||
} FC_CAPTURE_AND_RETHROW( (*this) ) }
|
||||
|
||||
} } // graphene::chain
|
||||
|
|
|
|||
|
|
@ -1877,10 +1877,11 @@ BOOST_AUTO_TEST_CASE(event_group_delete_test_not_existed_event_group)
|
|||
try
|
||||
{
|
||||
CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0);
|
||||
event_group_id_type nhl_id = nhl.id;
|
||||
delete_event_group(nhl_id);
|
||||
|
||||
delete_event_group(nhl.id);
|
||||
|
||||
BOOST_CHECK_THROW(delete_event_group(nhl.id), fc::exception);
|
||||
BOOST_CHECK_THROW(delete_event_group(nhl_id), fc::exception);
|
||||
} FC_LOG_AND_RETHROW()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue