Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
device/trezor: integration tests #4977
This PR adds integration tests with the Trezor emulator.
How it works
I needed to get RCT and Bulletproof transaction working with
The common blockchain created at the beginning of the Trezor tests can be saved to a file so the it is not generated with each test run. The argument
You first need to get Trezor emulator running. Ideally follow official building documentation.
Emulator can run in the Docker. I will add instructions later.
Summary for Trezor emulator build:
To build and run Monero integration tests:
After going through the PR again I am seriously thinking about small refactoring, namely:
What do you think @moneromooo-monero ?
4 times, most recently
Dec 14, 2018
Tests: this is pretty chunky, but it seems OK overall, though I read through quickly. Feel free to do whatever cleanup you mentioned, but overall this seems fine. Some explanations of the main changes to the core test machinery would be nice, the core test code is hard to understand (for me anyway).
I've added chain serialization/deserialization so the initial blockchain that is required for subsequent payment tests is not generated with each test run. The argument
The #5122 is required for chain save/load work correctly.
@moneromooo-monero I've updated PR description to better explain what is going on in the tests.
I mean, the transactions in the tests are constructed manually (the transaction is constructed in quite a detailed way, setting inputs and so on). My motivation for changes was to add an easy way to create various transaction types on the chain for the further testing.
With the modifications I made to the chaingen it is easy to generate various transactions on the chain (like using subaddresses, RCTv2), example of the chain generation: https://github.com/ph4r05/monero/blob/271272f91bd13a8e85ff2fd066cc7fbf53e2f65a/tests/trezor/trezor_tests.cpp#L696
Then tests make use of various transactions present on the blockchain so the TX signature test covers more code paths.
I think I'm fine with it generally. I don't like wallet2.h being included in the chaingen.h though, I see it wants transfer_details now, anything else ? If not, given transfer_details is not wallet specific, maybe it could be moved in cryptonote_core somewhere. It'd also please endogenic I think :)
Wallet2 is quite used in the
I've added another commit to this PR which separates wallet code from the
If you think this new approach is more clean I can squash it then.
Are you saying you're willing to do that ? If so that's great :) This is probably going to get merged soon, since I kinda doubt anyone is really going to review as well, so another PR on top would be best, unless you think a lot of shuffling around is needed first.