Fix get blockchain height unit test

https://github.com/moneroexamples/openmonero/issues/
118#issuecomment-453022371
new_rpc
moneroexamples 5 years ago
parent 5ac844cd65
commit 0772b01431

@ -314,8 +314,8 @@ TEST_P(BCSTATUS_TEST, GetCurrentHeight)
{
uint64_t mock_current_height {1619148};
EXPECT_CALL(*mcore_ptr, get_current_blockchain_height())
.WillOnce(Return(mock_current_height));
EXPECT_CALL(*rpc_ptr, get_current_height(_))
.WillOnce(SetArgReferee<0>(mock_current_height));
bcs->update_current_blockchain_height();
@ -331,8 +331,8 @@ TEST_P(BCSTATUS_TEST, IsTxSpendtimeUnlockedScenario1)
const uint64_t mock_current_height {100};
EXPECT_CALL(*mcore_ptr, get_current_blockchain_height())
.WillOnce(Return(mock_current_height));
EXPECT_CALL(*rpc_ptr, get_current_height(_))
.WillOnce(SetArgReferee<0>(mock_current_height));
bcs->update_current_blockchain_height();
@ -364,7 +364,7 @@ TEST_P(BCSTATUS_TEST, IsTxSpendtimeUnlockedScenario1)
- CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE;
EXPECT_TRUE(bcs->is_tx_unlocked(tx_unlock_time,
not_used_block_height));
not_used_block_height));
// expected unlock time is same as as current height
// thus a tx is unlocked
@ -372,7 +372,7 @@ TEST_P(BCSTATUS_TEST, IsTxSpendtimeUnlockedScenario1)
tx_unlock_time = mock_current_height;
EXPECT_TRUE(bcs->is_tx_unlocked(tx_unlock_time,
not_used_block_height));
not_used_block_height));
}
@ -393,8 +393,8 @@ TEST_P(BCSTATUS_TEST, IsTxSpendtimeUnlockedScenario2)
const uint64_t mock_current_height {100};
EXPECT_CALL(*mcore_ptr, get_current_blockchain_height())
.WillOnce(Return(mock_current_height));
EXPECT_CALL(*rpc_ptr, get_current_height(_))
.WillOnce(SetArgReferee<0>(mock_current_height));
bcs->update_current_blockchain_height();

@ -123,6 +123,9 @@ public:
MOCK_METHOD3(commit_tx, bool(const string& tx_blob,
string& error_msg,
bool do_not_relay));
MOCK_METHOD1(get_current_height,
bool(uint64_t& current_height));
};
class MockTxSearch : public xmreg::TxSearch

Loading…
Cancel
Save