added cancel_bet to the wallet
This commit is contained in:
parent
f3290a8827
commit
ec08259b7d
3 changed files with 26 additions and 0 deletions
|
|
@ -227,6 +227,7 @@ void database::initialize_evaluators()
|
||||||
register_evaluator<betting_market_create_evaluator>();
|
register_evaluator<betting_market_create_evaluator>();
|
||||||
register_evaluator<betting_market_update_evaluator>();
|
register_evaluator<betting_market_update_evaluator>();
|
||||||
register_evaluator<bet_place_evaluator>();
|
register_evaluator<bet_place_evaluator>();
|
||||||
|
register_evaluator<bet_cancel_evaluator>();
|
||||||
register_evaluator<betting_market_group_resolve_evaluator>();
|
register_evaluator<betting_market_group_resolve_evaluator>();
|
||||||
register_evaluator<betting_market_group_cancel_unmatched_bets_evaluator>();
|
register_evaluator<betting_market_group_cancel_unmatched_bets_evaluator>();
|
||||||
register_evaluator<tournament_create_evaluator>();
|
register_evaluator<tournament_create_evaluator>();
|
||||||
|
|
|
||||||
|
|
@ -1704,6 +1704,10 @@ class wallet_api
|
||||||
double backer_multiplier,
|
double backer_multiplier,
|
||||||
bool broadcast = false);
|
bool broadcast = false);
|
||||||
|
|
||||||
|
signed_transaction cancel_bet(string betting_account,
|
||||||
|
bet_id_type bet_id,
|
||||||
|
bool broadcast = false);
|
||||||
|
|
||||||
signed_transaction propose_resolve_betting_market_group(
|
signed_transaction propose_resolve_betting_market_group(
|
||||||
const string& proposing_account,
|
const string& proposing_account,
|
||||||
fc::time_point_sec expiration_time,
|
fc::time_point_sec expiration_time,
|
||||||
|
|
@ -2001,6 +2005,7 @@ FC_API( graphene::wallet::wallet_api,
|
||||||
(propose_update_betting_market_group)
|
(propose_update_betting_market_group)
|
||||||
(propose_update_betting_market)
|
(propose_update_betting_market)
|
||||||
(place_bet)
|
(place_bet)
|
||||||
|
(cancel_bet)
|
||||||
(propose_resolve_betting_market_group)
|
(propose_resolve_betting_market_group)
|
||||||
(tournament_create)
|
(tournament_create)
|
||||||
(tournament_join)
|
(tournament_join)
|
||||||
|
|
|
||||||
|
|
@ -5481,6 +5481,26 @@ signed_transaction wallet_api::place_bet(string betting_account,
|
||||||
return my->sign_transaction(tx, broadcast);
|
return my->sign_transaction(tx, broadcast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signed_transaction wallet_api::cancel_bet(string betting_account,
|
||||||
|
bet_id_type bet_id,
|
||||||
|
bool broadcast /*= false*/)
|
||||||
|
{
|
||||||
|
FC_ASSERT( !is_locked() );
|
||||||
|
|
||||||
|
const chain_parameters& current_params = get_global_properties().parameters;
|
||||||
|
|
||||||
|
bet_cancel_operation bet_cancel_op;
|
||||||
|
bet_cancel_op.bettor_id = get_account(betting_account).id;
|
||||||
|
bet_cancel_op.bet_to_cancel = bet_id;
|
||||||
|
|
||||||
|
signed_transaction tx;
|
||||||
|
tx.operations.push_back(bet_cancel_op);
|
||||||
|
my->set_operation_fees(tx, current_params.current_fees);
|
||||||
|
tx.validate();
|
||||||
|
|
||||||
|
return my->sign_transaction(tx, broadcast);
|
||||||
|
}
|
||||||
|
|
||||||
signed_transaction wallet_api::propose_resolve_betting_market_group(
|
signed_transaction wallet_api::propose_resolve_betting_market_group(
|
||||||
const string& proposing_account,
|
const string& proposing_account,
|
||||||
fc::time_point_sec expiration_time,
|
fc::time_point_sec expiration_time,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue