feat(trezor): add HF15 support, BP+

- BP+ support added for Trezor
- old Trezor firmware version support removed, code cleanup
This commit is contained in:
Dusan Klinec 2022-04-12 02:06:19 +02:00
parent b6a029f222
commit 6075be9cc8
No known key found for this signature in database
GPG key ID: 6337E118CCBCE103
6 changed files with 232 additions and 181 deletions

View file

@ -37,7 +37,9 @@
#include "../core_tests/wallet_tools.h"
#define TREZOR_TEST_FEE 90000000000
#define TREZOR_TEST_MIXIN 11
#define TREZOR_TEST_CLSAG_MIXIN 11
#define TREZOR_TEST_HF15_MIXIN 16
#define TREZOR_TEST_MIXIN TREZOR_TEST_CLSAG_MIXIN
/************************************************************************/
/* */
@ -93,6 +95,7 @@ public:
bool heavy_tests() const { return m_heavy_tests; }
void rct_config(rct::RCTConfig rct_config) { m_rct_config = rct_config; }
uint8_t cur_hf() const { return m_hard_forks.size() > 0 ? m_hard_forks.back().first : 0; }
size_t num_mixin() const { return m_top_hard_fork >= HF_VERSION_BULLETPROOF_PLUS ? TREZOR_TEST_HF15_MIXIN : TREZOR_TEST_CLSAG_MIXIN; }
cryptonote::network_type nettype() const { return m_network_type; }
std::shared_ptr<mock_daemon> daemon() const { return m_daemon; }
void daemon(std::shared_ptr<mock_daemon> daemon){ m_daemon = std::move(daemon); }
@ -306,12 +309,24 @@ public:
bool generate(std::vector<test_event_entry>& events) override;
};
class gen_trezor_4utxo_to_15outs : public gen_trezor_base
{
public:
bool generate(std::vector<test_event_entry>& events) override;
};
class gen_trezor_many_utxo : public gen_trezor_base
{
public:
bool generate(std::vector<test_event_entry>& events) override;
};
class gen_trezor_many_utxo_many_txo : public gen_trezor_base
{
public:
bool generate(std::vector<test_event_entry>& events) override;
};
// Wallet::API tests
class wallet_api_tests : public gen_trezor_base
{