Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests/trezor: HF9 and HF10 tests
- tests fixes for HF10, builder change, rct_config; fix_chain
- get_tx_key test
- proper testing after live refresh added
- live refresh synthetic test
- log available funds for easier test construction
- wallet::API tests with mocked daemon
  • Loading branch information
ph4r05 committed Mar 20, 2019
1 parent ff3bf36 commit 4bc27a5
Show file tree
Hide file tree
Showing 9 changed files with 1,241 additions and 83 deletions.
9 changes: 4 additions & 5 deletions tests/core_tests/chaingen.h
Expand Up @@ -754,7 +754,7 @@ struct get_test_options {
};
//--------------------------------------------------------------------------
template<class t_test_class>
inline bool do_replay_events_get_core(std::vector<test_event_entry>& events, cryptonote::core **core)
inline bool do_replay_events_get_core(std::vector<test_event_entry>& events, cryptonote::core *core)
{
boost::program_options::options_description desc("Allowed options");
cryptonote::core::init_options(desc);
Expand All @@ -768,8 +768,7 @@ inline bool do_replay_events_get_core(std::vector<test_event_entry>& events, cry
if (!r)
return false;

*core = new cryptonote::core(nullptr);
auto & c = **core;
auto & c = *core;

// FIXME: make sure that vm has arg_testnet_on set to true or false if
// this test needs for it to be so.
Expand Down Expand Up @@ -825,9 +824,9 @@ inline bool replay_events_through_core_validate(std::vector<test_event_entry>& e
template<class t_test_class>
inline bool do_replay_events(std::vector<test_event_entry>& events)
{
cryptonote::core * core;
cryptonote::core core(nullptr);
bool ret = do_replay_events_get_core<t_test_class>(events, &core);
core->deinit();
core.deinit();
return ret;
}
//--------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion tests/core_tests/wallet_tools.cpp
Expand Up @@ -17,7 +17,6 @@ void wallet_accessor_test::set_account(tools::wallet2 * wallet, cryptonote::acco
{
wallet->clear();
wallet->m_account = account;
wallet->m_nettype = MAINNET;

wallet->m_key_device_type = account.get_device().get_type();
wallet->m_account_public_address = account.get_keys().m_account_address;
Expand Down
13 changes: 13 additions & 0 deletions tests/trezor/CMakeLists.txt
Expand Up @@ -27,11 +27,15 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set(trezor_tests_sources
tools.cpp
daemon.cpp
trezor_tests.cpp
../core_tests/chaingen.cpp
../core_tests/wallet_tools.cpp)

set(trezor_tests_headers
tools.h
daemon.h
trezor_tests.h
../core_tests/chaingen.h
../core_tests/wallet_tools.h)
Expand All @@ -50,6 +54,15 @@ target_link_libraries(trezor_tests
device
device_trezor
wallet
wallet_api
rpc
cryptonote_protocol
daemon_rpc_server
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${ZMQ_LIB}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})

Expand Down

0 comments on commit 4bc27a5

Please sign in to comment.