Electroneum
device_trezor_test Class Reference

#include <trezor_tests.h>

Inheritance diagram for device_trezor_test:
Collaboration diagram for device_trezor_test:

Public Member Functions

 device_trezor_test ()
 
void clear_test_counters ()
 
void setup_for_tests (const std::string &trezor_path, const std::string &seed, cryptonote::network_type network_type)
 
bool compute_key_image (const ::cryptonote::account_keys &ack, const ::crypto::public_key &out_key, const ::crypto::key_derivation &recv_derivation, size_t real_output_index, const ::cryptonote::subaddress_index &received_index, ::cryptonote::keypair &in_ephemeral, ::crypto::key_image &ki) override
 

Public Attributes

size_t m_tx_sign_ctr
 
size_t m_compute_key_image_ctr
 

Protected Member Functions

void tx_sign (hw::wallet_shim *wallet, const ::tools::wallet2::unsigned_tx_set &unsigned_tx, size_t idx, hw::tx_aux_data &aux_data, std::shared_ptr< hw::trezor::protocol::tx::Signer > &signer) override
 

Detailed Description

Definition at line 204 of file trezor_tests.h.

Constructor & Destructor Documentation

◆ device_trezor_test()

device_trezor_test::device_trezor_test ( )

Definition at line 1478 of file trezor_tests.cpp.

Member Function Documentation

◆ clear_test_counters()

void device_trezor_test::clear_test_counters ( )

Definition at line 1480 of file trezor_tests.cpp.

1480  {
1481  m_tx_sign_ctr = 0;
1483 }
size_t m_compute_key_image_ctr
Definition: trezor_tests.h:207
Here is the caller graph for this function:

◆ compute_key_image()

bool device_trezor_test::compute_key_image ( const ::cryptonote::account_keys ack,
const ::crypto::public_key out_key,
const ::crypto::key_derivation recv_derivation,
size_t  real_output_index,
const ::cryptonote::subaddress_index received_index,
::cryptonote::keypair in_ephemeral,
::crypto::key_image ki 
)
override

Definition at line 1502 of file trezor_tests.cpp.

1505  {
1506 
1507  bool res = device_trezor::compute_key_image(ack, out_key, recv_derivation, real_output_index, received_index,
1508  in_ephemeral, ki);
1510  return res;
1511 }
const char * res
Definition: hmac_keccak.cpp:41
size_t m_compute_key_image_ctr
Definition: trezor_tests.h:207

◆ setup_for_tests()

void device_trezor_test::setup_for_tests ( const std::string &  trezor_path,
const std::string &  seed,
cryptonote::network_type  network_type 
)

Definition at line 1485 of file trezor_tests.cpp.

1485  {
1486  this->clear_test_counters();
1487  this->set_callback(nullptr);
1488  this->set_debug(true); // debugging commands on Trezor (auto-confirm transactions)
1489 
1490  CHECK_AND_ASSERT_THROW_MES(this->set_name(trezor_path), "Could not set device name " << trezor_path);
1491  this->set_network_type(network_type);
1492  this->set_derivation_path(""); // empty derivation path
1493 
1494  CHECK_AND_ASSERT_THROW_MES(this->init(), "Could not initialize the device " << trezor_path);
1495  CHECK_AND_ASSERT_THROW_MES(this->connect(), "Could not connect to the device " << trezor_path);
1496  this->wipe_device();
1497  this->load_device(seed);
1498  this->release();
1499  this->disconnect();
1500 }
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
Definition: misc_log_ex.h:173
Here is the call graph for this function:

◆ tx_sign()

void device_trezor_test::tx_sign ( hw::wallet_shim wallet,
const ::tools::wallet2::unsigned_tx_set unsigned_tx,
size_t  idx,
hw::tx_aux_data aux_data,
std::shared_ptr< hw::trezor::protocol::tx::Signer > &  signer 
)
overrideprotected

Definition at line 1514 of file trezor_tests.cpp.

1515  {
1516  m_tx_sign_ctr += 1;
1517  device_trezor::tx_sign(wallet, unsigned_tx, idx, aux_data, signer);
1518 }

Member Data Documentation

◆ m_compute_key_image_ctr

size_t device_trezor_test::m_compute_key_image_ctr

Definition at line 207 of file trezor_tests.h.

◆ m_tx_sign_ctr

size_t device_trezor_test::m_tx_sign_ctr

Definition at line 206 of file trezor_tests.h.


The documentation for this class was generated from the following files: