Skip to content

Commit

Permalink
Fix build errors converting and comparing to int. (#4633)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu authored May 23, 2024
1 parent eb141ba commit 1dc5458
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nano/core_test/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ TEST (ledger, process_send)
ASSERT_EQ (2, send->sideband ().height);
ASSERT_EQ (nano::dev::constants.genesis_amount - 50, ledger.any.block_amount (transaction, hash1));
ASSERT_EQ (nano::dev::genesis_key.pub, send->account ());
ASSERT_EQ (50, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub));
ASSERT_EQ (50, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub).value ().number ());
ASSERT_EQ (nano::dev::constants.genesis_amount - 50, ledger.account_receivable (transaction, key2.pub));
auto info2 = ledger.any.account_get (transaction, nano::dev::genesis_key.pub);
ASSERT_TRUE (info2);
Expand Down Expand Up @@ -265,17 +265,17 @@ TEST (ledger, process_receive)
ASSERT_EQ (key2.pub, receive->sideband ().account);
ASSERT_EQ (nano::dev::constants.genesis_amount - 25, receive->sideband ().balance.number ());
ASSERT_EQ (2, receive->sideband ().height);
ASSERT_EQ (25, ledger.any.block_amount (transaction, hash4));
ASSERT_EQ (25, ledger.any.block_amount (transaction, hash4).value ().number ());
ASSERT_EQ (nano::block_status::progress, return2);
ASSERT_EQ (key2.pub, receive->account ());
ASSERT_EQ (hash4, ledger.any.account_head (transaction, key2.pub));
ASSERT_EQ (25, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub));
ASSERT_EQ (25, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub).value ().number ());
ASSERT_EQ (0, ledger.account_receivable (transaction, key2.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount - 25, ledger.any.account_balance (transaction, key2.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount - 25, ledger.weight (key3.pub));
ASSERT_FALSE (ledger.rollback (transaction, hash4));
ASSERT_FALSE (ledger.any.block_successor (transaction, hash2));
ASSERT_EQ (25, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub));
ASSERT_EQ (25, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub).value ().number ());
ASSERT_EQ (25, ledger.account_receivable (transaction, key2.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount - 50, ledger.any.account_balance (transaction, key2.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount - 50, ledger.weight (key3.pub));
Expand Down Expand Up @@ -320,7 +320,7 @@ TEST (ledger, rollback_receiver)
nano::block_hash hash2 (open->hash ());
ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, open));
ASSERT_EQ (hash2, ledger.any.account_head (transaction, key2.pub));
ASSERT_EQ (50, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub));
ASSERT_EQ (50, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub).value ().number ());
ASSERT_EQ (nano::dev::constants.genesis_amount - 50, ledger.any.account_balance (transaction, key2.pub));
ASSERT_EQ (50, ledger.weight (nano::dev::genesis_key.pub));
ASSERT_EQ (0, ledger.weight (key2.pub));
Expand Down Expand Up @@ -528,7 +528,7 @@ TEST (ledger, representative_change)
.build ();
auto return1 (ledger.process (transaction, block));
ASSERT_EQ (nano::block_status::progress, return1);
ASSERT_EQ (0, ledger.any.block_amount (transaction, block->hash ()));
ASSERT_EQ (0, ledger.any.block_amount (transaction, block->hash ()).value ().number ());
ASSERT_EQ (nano::dev::genesis_key.pub, block->account ());
ASSERT_EQ (0, ledger.weight (nano::dev::genesis_key.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (key2.pub));
Expand Down Expand Up @@ -2540,7 +2540,7 @@ TEST (ledger, state_rep_change)
ASSERT_NE (nullptr, change2);
ASSERT_EQ (*change1, *change2);
ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.any.block_balance (transaction, change1->hash ()));
ASSERT_EQ (0, ledger.any.block_amount (transaction, change1->hash ()));
ASSERT_EQ (0, ledger.any.block_amount (transaction, change1->hash ()).value ().number ());
ASSERT_EQ (0, ledger.weight (nano::dev::genesis_key.pub));
ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (rep.pub));
ASSERT_EQ (2, change2->sideband ().height);
Expand Down Expand Up @@ -3560,7 +3560,7 @@ TEST (ledger, epoch_blocks_v1_general)
ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive2));
ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().details.epoch);
ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().source_epoch);
ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch4->hash ()));
ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch4->hash ()).value ().number ());
ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, receive2->hash ()));
ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive2->hash ()));
ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub));
Expand Down Expand Up @@ -3728,7 +3728,7 @@ TEST (ledger, epoch_blocks_v2_general)
ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive2));
ASSERT_EQ (nano::epoch::epoch_2, receive2->sideband ().details.epoch);
ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().source_epoch);
ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch6->hash ()));
ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch6->hash ()).value ().number ());
ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, receive2->hash ()));
ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive2->hash ()));
ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub));
Expand Down

0 comments on commit 1dc5458

Please sign in to comment.