aboutsummaryrefslogtreecommitdiff
path: root/tests/trezor/daemon.cpp
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2023-09-29 19:13:37 +0200
committerDusan Klinec <dusan.klinec@gmail.com>2023-09-30 09:01:10 +0200
commitc444a7e002036e834bfb4c68f04a121ce1af5825 (patch)
tree7c4d291132a4b9fc4f8eebcb53c003c82023cb23 /tests/trezor/daemon.cpp
parentfix chaingen tests (diff)
downloadmonero-c444a7e002036e834bfb4c68f04a121ce1af5825.tar.xz
trezor: support v2.5.2+, add more trezor tests, fix chaingen and tests
- passphrase logic: remove backward compatibility for 2.4.3, code cleanup. - fix LibUSB cmake for static builds on OSX - tests: all tests now work with passphrase logic enabled. Passphrase test added with different passphrase. no_passphrase test added, Trezor pin test added. Testing wallet opening with correct and incorrect passphrase. Trezor test chain revamp, cleanup. Smaller chain, chain file versioning added. - tests: Trezor tests support TEST_MINING_ENABLED, TEST_MINING_TIMEOUT env vars to change mining-related tests behaviour. - requires protobuf@21 on osx for now (c++14), building with unlinked protobuf: `CMAKE_PREFIX_PATH=$(find /opt/homebrew/Cellar/protobuf@21 -maxdepth 1 -type d -name "21.*" -print -quit) \ make debug-test-trezor -j8`
Diffstat (limited to 'tests/trezor/daemon.cpp')
-rw-r--r--tests/trezor/daemon.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/trezor/daemon.cpp b/tests/trezor/daemon.cpp
index 47c0cde9b..de4f9bc51 100644
--- a/tests/trezor/daemon.cpp
+++ b/tests/trezor/daemon.cpp
@@ -309,11 +309,10 @@ void mock_daemon::stop_p2p()
m_server.send_stop_signal();
}
-void mock_daemon::mine_blocks(size_t num_blocks, const std::string &miner_address)
+void mock_daemon::mine_blocks(size_t num_blocks, const std::string &miner_address, std::chrono::seconds timeout)
{
bool blocks_mined = false;
const uint64_t start_height = get_height();
- const auto mining_timeout = std::chrono::seconds(360);
MDEBUG("Current height before mining: " << start_height);
start_mining(miner_address);
@@ -331,14 +330,14 @@ void mock_daemon::mine_blocks(size_t num_blocks, const std::string &miner_addres
}
auto current_time = std::chrono::system_clock::now();
- if (mining_timeout < current_time - mining_started)
+ if (timeout < current_time - mining_started)
{
break;
}
}
stop_mining();
- CHECK_AND_ASSERT_THROW_MES(blocks_mined, "Mining failed in the time limit");
+ CHECK_AND_ASSERT_THROW_MES(blocks_mined, "Mining failed in the time limit: " << timeout.count());
}
constexpr const std::chrono::seconds mock_daemon::rpc_timeout;