Skip to content

Commit

Permalink
Rename fee_parameters_type to fee_params_t
Browse files Browse the repository at this point in the history
to get around MinGW build "string table overflow" issue
  • Loading branch information
abitmore committed Mar 23, 2023
1 parent bf5934f commit d069614
Show file tree
Hide file tree
Showing 48 changed files with 424 additions and 424 deletions.
16 changes: 8 additions & 8 deletions libraries/protocol/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void account_options::validate() const
"May not specify fewer witnesses or committee members than the number voted for.");
}

share_type account_create_operation::calculate_fee( const fee_parameters_type& k )const
share_type account_create_operation::calculate_fee( const fee_params_t& k )const
{
auto core_fee_required = k.basic_fee;

Expand Down Expand Up @@ -215,7 +215,7 @@ void account_create_operation::validate()const
}
}

share_type account_update_operation::calculate_fee( const fee_parameters_type& k )const
share_type account_update_operation::calculate_fee( const fee_params_t& k )const
{
auto core_fee_required = k.fee;
if( new_options )
Expand Down Expand Up @@ -260,7 +260,7 @@ void account_update_operation::validate()const
validate_special_authority( *extensions.value.active_special_authority );
}

share_type account_upgrade_operation::calculate_fee(const fee_parameters_type& k) const
share_type account_upgrade_operation::calculate_fee(const fee_params_t& k) const
{
if( upgrade_to_lifetime_member )
return k.membership_lifetime_fee;
Expand All @@ -280,11 +280,11 @@ void account_transfer_operation::validate()const
} } // graphene::protocol

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_options )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_create_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_whitelist_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_update_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_upgrade_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_transfer_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_create_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_whitelist_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_update_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_upgrade_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_transfer_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_create_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_whitelist_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::account_update_operation )
Expand Down
4 changes: 2 additions & 2 deletions libraries/protocol/assert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ void assert_operation::validate()const
* The fee for assert operations is proportional to their size,
* but cheaper than a data fee because they require no storage
*/
share_type assert_operation::calculate_fee(const fee_parameters_type& k)const
share_type assert_operation::calculate_fee(const fee_params_t& k)const
{
return k.fee * predicates.size();
}

} } // namespace graphene::protocol

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::assert_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::assert_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::assert_operation )
32 changes: 16 additions & 16 deletions libraries/protocol/asset_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ bool is_valid_symbol( const string& symbol )
return true;
}

share_type asset_issue_operation::calculate_fee(const fee_parameters_type& k)const
share_type asset_issue_operation::calculate_fee(const fee_params_t& k)const
{
return k.fee + calculate_data_fee( fc::raw::pack_size(memo), k.price_per_kbyte );
}

share_type asset_create_operation::calculate_fee( const asset_create_operation::fee_parameters_type& param,
share_type asset_create_operation::calculate_fee( const asset_create_operation::fee_params_t& param,
const optional<uint64_t>& sub_asset_creation_fee )const
{
share_type core_fee_required = param.long_symbol;
Expand Down Expand Up @@ -157,7 +157,7 @@ void asset_update_issuer_operation::validate()const
FC_ASSERT( issuer != new_issuer );
}

share_type asset_update_operation::calculate_fee(const asset_update_operation::fee_parameters_type& k)const
share_type asset_update_operation::calculate_fee(const asset_update_operation::fee_params_t& k)const
{
return k.fee + calculate_data_fee( fc::raw::pack_size(*this), k.price_per_kbyte );
}
Expand Down Expand Up @@ -363,20 +363,20 @@ GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::additional_asset_
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_operation::ext )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_publish_feed_operation::ext )

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_create_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_global_settle_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_settle_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_fund_fee_pool_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_claim_pool_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_claim_fees_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_create_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_global_settle_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_settle_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_fund_fee_pool_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_claim_pool_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_claim_fees_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_claim_fees_operation::additional_options_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_issuer_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_bitasset_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_feed_producers_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_publish_feed_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_issue_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_reserve_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_issuer_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_bitasset_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_update_feed_producers_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_publish_feed_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_issue_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_reserve_operation::fee_params_t )

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_create_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::asset_global_settle_operation )
Expand Down
6 changes: 3 additions & 3 deletions libraries/protocol/committee_member.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ void committee_member_update_global_parameters_operation::validate() const

} } // graphene::protocol

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_create_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_global_parameters_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_create_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_global_parameters_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_create_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::committee_member_update_global_parameters_operation )
10 changes: 5 additions & 5 deletions libraries/protocol/confidential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void transfer_to_blind_operation::validate()const
}
}

share_type transfer_to_blind_operation::calculate_fee( const fee_parameters_type& k )const
share_type transfer_to_blind_operation::calculate_fee( const fee_params_t& k )const
{
return k.fee + outputs.size() * k.price_per_output;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ void blind_transfer_operation::validate()const
FC_ASSERT( fc::ecc::verify_sum( in, out, net_public ), "", ("net_public", net_public) );
} FC_CAPTURE_AND_RETHROW( (*this) ) }

share_type blind_transfer_operation::calculate_fee( const fee_parameters_type& k )const
share_type blind_transfer_operation::calculate_fee( const fee_params_t& k )const
{
return k.fee + outputs.size() * k.price_per_output;
}
Expand All @@ -156,9 +156,9 @@ stealth_confirmation::stealth_confirmation( const std::string& base58 )

} } // graphene::protocol

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_to_blind_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_from_blind_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::blind_transfer_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_to_blind_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_from_blind_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::blind_transfer_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_to_blind_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::transfer_from_blind_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::blind_transfer_operation )
16 changes: 8 additions & 8 deletions libraries/protocol/credit_offer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void credit_offer_create_operation::validate()const
validate_acceptable_borrowers( acceptable_borrowers );
}

share_type credit_offer_create_operation::calculate_fee( const fee_parameters_type& schedule )const
share_type credit_offer_create_operation::calculate_fee( const fee_params_t& schedule )const
{
share_type core_fee_required = schedule.fee;
core_fee_required += calculate_data_fee( fc::raw::pack_size(*this), schedule.price_per_kbyte );
Expand Down Expand Up @@ -134,7 +134,7 @@ void credit_offer_update_operation::validate()const
"Should change something - at least one of the optional data fields should be present" );
}

share_type credit_offer_update_operation::calculate_fee( const fee_parameters_type& schedule )const
share_type credit_offer_update_operation::calculate_fee( const fee_params_t& schedule )const
{
share_type core_fee_required = schedule.fee;
core_fee_required += calculate_data_fee( fc::raw::pack_size(*this), schedule.price_per_kbyte );
Expand Down Expand Up @@ -174,12 +174,12 @@ void credit_deal_update_operation::validate()const

} } // graphene::protocol

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_create_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_delete_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_update_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_accept_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_deal_repay_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_deal_update_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_create_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_delete_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_update_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_accept_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_deal_repay_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_deal_update_operation::fee_params_t )

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::credit_offer_accept_operation::ext )

Expand Down
4 changes: 2 additions & 2 deletions libraries/protocol/custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ void custom_operation::validate()const
{
FC_ASSERT( fee.amount > 0 );
}
share_type custom_operation::calculate_fee(const fee_parameters_type& k)const
share_type custom_operation::calculate_fee(const fee_params_t& k)const
{
return k.fee + calculate_data_fee( fc::raw::pack_size(*this), k.price_per_kbyte );
}

} }

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::custom_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::custom_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::custom_operation )
4 changes: 2 additions & 2 deletions libraries/protocol/custom_authority.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace graphene { namespace protocol {

share_type custom_authority_create_operation::calculate_fee(const fee_parameters_type& k)const {
share_type custom_authority_create_operation::calculate_fee(const fee_params_t& k)const {
share_type core_fee_required = k.basic_fee;
// Note: practically the `*` won't cause an integer overflow, because k.price_per_byte is 32 bit
// and the results of pack_size() won't be too big
Expand Down Expand Up @@ -58,7 +58,7 @@ void custom_authority_create_operation::validate()const {
get_restriction_predicate(restrictions, operation_type);
}

share_type custom_authority_update_operation::calculate_fee(const fee_parameters_type& k)const {
share_type custom_authority_update_operation::calculate_fee(const fee_params_t& k)const {
share_type core_fee_required = k.basic_fee;
// Note: practically the `*` won't cause an integer overflow, because k.price_per_byte is 32 bit
// and the results of pack_size() won't be too big
Expand Down
6 changes: 3 additions & 3 deletions libraries/protocol/fee_schedule_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace graphene { namespace protocol {
auto itr = param.parameters.find(params);
if( itr != param.parameters.end() )
params = *itr;
return op.calculate_fee( params.get<typename OpType::fee_parameters_type>() ).value;
return op.calculate_fee( params.get<typename OpType::fee_params_t>() ).value;
}
}
};
Expand All @@ -57,7 +57,7 @@ namespace graphene { namespace protocol {
uint64_t calc_fee_visitor::operator()(const htlc_create_operation& op)const
{
//TODO: refactor for performance (see https://github.com/bitshares/bitshares-core/issues/2150)
transfer_operation::fee_parameters_type t;
transfer_operation::fee_params_t t;
if (param.exists<transfer_operation>())
t = param.get<transfer_operation>();
return op.calculate_fee( param.get<htlc_create_operation>(), t.price_per_kbyte).value;
Expand All @@ -70,7 +70,7 @@ namespace graphene { namespace protocol {
optional<uint64_t> sub_asset_creation_fee;
if( param.exists<account_transfer_operation>() && param.exists<ticket_create_operation>() )
sub_asset_creation_fee = param.get<account_transfer_operation>().fee;
asset_create_operation::fee_parameters_type old_asset_creation_fee_params;
asset_create_operation::fee_params_t old_asset_creation_fee_params;
if( param.exists<asset_create_operation>() )
old_asset_creation_fee_params = param.get<asset_create_operation>();
return op.calculate_fee( old_asset_creation_fee_params, sub_asset_creation_fee ).value;
Expand Down
12 changes: 6 additions & 6 deletions libraries/protocol/htlc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace graphene { namespace protocol {
FC_ASSERT( amount.amount > 0, "HTLC amount should be greater than zero" );
}

share_type htlc_create_operation::calculate_fee( const fee_parameters_type& fee_params,
share_type htlc_create_operation::calculate_fee( const fee_params_t& fee_params,
uint32_t fee_per_kb )const
{
uint64_t days = ( claim_period_seconds + SECONDS_PER_DAY - 1 ) / SECONDS_PER_DAY;
Expand All @@ -50,7 +50,7 @@ namespace graphene { namespace protocol {
FC_ASSERT( fee.amount >= 0, "Fee amount should not be negative" );
}

share_type htlc_redeem_operation::calculate_fee( const fee_parameters_type& fee_params )const
share_type htlc_redeem_operation::calculate_fee( const fee_params_t& fee_params )const
{
uint64_t kb = ( preimage.size() + 1023 ) / 1024;
uint64_t product = kb * fee_params.fee_per_kb;
Expand All @@ -62,7 +62,7 @@ namespace graphene { namespace protocol {
FC_ASSERT( fee.amount >= 0 , "Fee amount should not be negative");
}

share_type htlc_extend_operation::calculate_fee( const fee_parameters_type& fee_params )const
share_type htlc_extend_operation::calculate_fee( const fee_params_t& fee_params )const
{
uint32_t days = ( seconds_to_add + SECONDS_PER_DAY - 1 ) / SECONDS_PER_DAY;
uint64_t per_day_fee = fee_params.fee_per_day * days;
Expand All @@ -71,10 +71,10 @@ namespace graphene { namespace protocol {
}
} }

GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_create_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_create_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_create_operation::additional_options_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_redeem_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_extend_operation::fee_parameters_type )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_redeem_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_extend_operation::fee_params_t )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_create_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_redeem_operation )
GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION( graphene::protocol::htlc_redeemed_operation )
Expand Down
Loading

0 comments on commit d069614

Please sign in to comment.