Merge branch 'bug/421-fix-double' into 'develop'

#421 fix double in consensus of nft_lottery_token_purchase

See merge request PBSA/peerplays!205
This commit is contained in:
serkixenos 2023-02-10 14:50:23 +00:00
commit 80d168e5b6
2 changed files with 4 additions and 4 deletions

View file

@ -18,7 +18,7 @@ namespace graphene
// Buyer purchasing lottery tickets
account_id_type buyer;
// count of tickets to buy
uint64_t tickets_to_buy;
share_type tickets_to_buy;
// amount that can spent
asset amount;

View file

@ -30,7 +30,7 @@ namespace graphene
auto lottery_options = lottery_md_obj.lottery_data->lottery_options;
FC_ASSERT(lottery_options.ticket_price.asset_id == op.amount.asset_id);
FC_ASSERT((double)op.amount.amount.value / lottery_options.ticket_price.amount.value == (double)op.tickets_to_buy);
FC_ASSERT(op.tickets_to_buy * lottery_options.ticket_price.amount.value == op.amount.amount.value);
return void_result();
}
FC_CAPTURE_AND_RETHROW((op))