Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning and Infotext Fixes #1959

Merged
merged 2 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/chain/db_maint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void database::initialize_budget_record( fc::time_point_sec now, budget_record&
// be able to use the entire reserve
budget_u128 += ((uint64_t(1) << GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS) - 1);
budget_u128 >>= GRAPHENE_CORE_ASSET_CYCLE_RATE_BITS;
if( budget_u128 < reserve.value )
if( budget_u128 < static_cast<fc::uint128_t>(reserve.value) )
rec.total_budget = share_type(static_cast<uint64_t>(budget_u128));
else
rec.total_budget = reserve;
Expand Down Expand Up @@ -492,7 +492,7 @@ void database::process_budget()
worker_budget_u128 /= 60*60*24;

share_type worker_budget;
if( worker_budget_u128 >= available_funds.value )
if( worker_budget_u128 >= static_cast<fc::uint128_t>(available_funds.value) )
worker_budget = available_funds;
else
worker_budget = static_cast<uint64_t>(worker_budget_u128);
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/vesting_balance_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ asset cdd_vesting_policy::get_allowed_withdraw(const vesting_policy_context& ctx
return asset(0, ctx.balance.asset_id);
fc::uint128_t cs_earned = compute_coin_seconds_earned(ctx);
fc::uint128_t withdraw_available = cs_earned / std::max(vesting_seconds, 1u);
assert(withdraw_available <= ctx.balance.amount.value);
assert(withdraw_available <= static_cast<fc::uint128_t>(ctx.balance.amount.value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assert only works for debug build. I guess we want to remove it or change it to FC_ASSERT, but it belongs to a new PR (see #511).

return asset(static_cast<uint64_t>(withdraw_available), ctx.balance.asset_id);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/htlc_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ try {
// Alice puts a contract on the blockchain
{
graphene::chain::htlc_create_operation create_operation;
BOOST_TEST_MESSAGE("Alice (who has 100 coins, is transferring 2 coins to Bob");
BOOST_TEST_MESSAGE("Alice (who has 100 coins, is transferring 3 coins to Bob");
create_operation.amount = graphene::chain::asset( 3 * GRAPHENE_BLOCKCHAIN_PRECISION );
create_operation.to = bob_id;
create_operation.claim_period_seconds = 60;
Expand Down