Skip to content

Commit

Permalink
brought updates from mainnet branch (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbattu123 committed Feb 12, 2020
1 parent 62b8bde commit 11919cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ namespace graphene { namespace chain { struct fee_schedule; } }
namespace graphene { namespace chain {
struct parameter_extension
{
optional< bet_multiplier_type > min_bet_multiplier = GRAPHENE_DEFAULT_MIN_BET_MULTIPLIER;
optional< bet_multiplier_type > max_bet_multiplier = GRAPHENE_DEFAULT_MAX_BET_MULTIPLIER;
optional< uint16_t > betting_rake_fee_percentage = GRAPHENE_DEFAULT_RAKE_FEE_PERCENTAGE;
optional< flat_map<bet_multiplier_type, bet_multiplier_type> >
permitted_betting_odds_increments = flat_map<bet_multiplier_type, bet_multiplier_type>(GRAPHENE_DEFAULT_PERMITTED_BETTING_ODDS_INCREMENTS);
optional< uint16_t > live_betting_delay_time = GRAPHENE_DEFAULT_LIVE_BETTING_DELAY_TIME;
optional< bet_multiplier_type > min_bet_multiplier;
optional< bet_multiplier_type > max_bet_multiplier;
optional< uint16_t > betting_rake_fee_percentage;
optional< flat_map<bet_multiplier_type, bet_multiplier_type> > permitted_betting_odds_increments;
optional< uint16_t > live_betting_delay_time;
optional< uint16_t > sweeps_distribution_percentage = SWEEPS_DEFAULT_DISTRIBUTION_PERCENTAGE;
optional< asset_id_type > sweeps_distribution_asset = SWEEPS_DEFAULT_DISTRIBUTION_ASSET;
optional< account_id_type > sweeps_vesting_accumulator_account= SWEEPS_ACCUMULATOR_ACCOUNT;
Expand Down Expand Up @@ -148,6 +147,7 @@ FC_REFLECT( graphene::chain::parameter_extension,
(min_bet_multiplier)
(max_bet_multiplier)
(betting_rake_fee_percentage)
(permitted_betting_odds_increments)
(live_betting_delay_time)
(sweeps_distribution_percentage)
(sweeps_distribution_asset)
Expand Down
8 changes: 4 additions & 4 deletions libraries/plugins/bookie/bookie_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ void bookie_plugin_impl::on_block_applied( const signed_block& )
assert(bet_iter != persistent_bets_by_bet_id.end());
if (bet_iter != persistent_bets_by_bet_id.end())
{
ilog("Adding bet_canceled_operation ${canceled_id} to bet ${bet_id}'s associated operations",
("canceled_id", op.id)("bet_id", bet_canceled_op.bet_id));
// ilog("Adding bet_canceled_operation ${canceled_id} to bet ${bet_id}'s associated operations",
// ("canceled_id", op.id)("bet_id", bet_canceled_op.bet_id));
if (is_operation_history_object_stored(op.id))
db.modify(*bet_iter, [&]( persistent_bet_object& obj ) {
obj.associated_operations.emplace_back(op.id);
Expand All @@ -386,8 +386,8 @@ void bookie_plugin_impl::on_block_applied( const signed_block& )
assert(bet_iter != persistent_bets_by_bet_id.end());
if (bet_iter != persistent_bets_by_bet_id.end())
{
ilog("Adding bet_adjusted_operation ${adjusted_id} to bet ${bet_id}'s associated operations",
("adjusted_id", op.id)("bet_id", bet_adjusted_op.bet_id));
// ilog("Adding bet_adjusted_operation ${adjusted_id} to bet ${bet_id}'s associated operations",
// ("adjusted_id", op.id)("bet_id", bet_adjusted_op.bet_id));
if (is_operation_history_object_stored(op.id))
db.modify(*bet_iter, [&]( persistent_bet_object& obj ) {
obj.associated_operations.emplace_back(op.id);
Expand Down
9 changes: 8 additions & 1 deletion libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ class wallet_api_impl

asset_object asset_obj = get_asset( asset_symbol );
vector< vesting_balance_object > vbos;
vesting_balance_object vbo;
fc::optional<vesting_balance_id_type> vbid = maybe_id<vesting_balance_id_type>(account_name);
if( !vbid )
{
Expand All @@ -2134,7 +2135,13 @@ class wallet_api_impl
if(!vbos.size())
vbos.emplace_back( get_object<vesting_balance_object>(*vbid) );

const vesting_balance_object& vbo = vbos.front();
for (const vesting_balance_object& vesting_balance_obj: vbos) {
if(vesting_balance_obj.balance_type == vesting_balance_type::gpos)
{
vbo = vesting_balance_obj;
break;
}
}

vesting_balance_withdraw_operation vesting_balance_withdraw_op;

Expand Down

0 comments on commit 11919cd

Please sign in to comment.