monero-project / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
9.03k stars 3.12k forks source link

tests: framework for wallet cpp <> live daemon tests #9547

Open j-berman opened 3 weeks ago

j-berman commented 3 weeks ago

This adds a new functional test for direct wallet2 -> live RPC daemon interactions. The functional RPC tests currently test a wallet RPC -> live RPC daemon (to be clear, the functional tests currently use the wallet RPC as opposed to directly using wallet2 as this PR introduces).

The initial motivation for this framework was testing the new Seraphis lib async scanner with a live daemon (source). I used wallet2 as a base test to demonstrate the async scanner achieves the same expected results. The async scanner was/is a large enough component in and of itself that warranted direct testing with a live daemon (plus, setting up the wallet RPC to use the async scanner is its own significant task that is likely to take months of work, and testing the async scanner with a daemon in isolation enables smoother incremental progress).

More recently, @sneedlewoods began an effort to add functions to the wallet API as part of a larger effort to deprecate wallet2 and replace it with the wallet API (#9464). In the latest "Monero Tech" (/"No Wallet Left Behind") working group meeting, @sneedlewoods mentioned they would like a test framework to test the wallet API with a live daemon. They started using the existing libwallet API tests, however, those tests require manually starting daemons and running bash scripts. The reason I chose to implement this framework as part of the existing functional test framework is that there is already an automated setup established to start live daemons and execute daemon commands. I figure @sneedlewoods may find it useful to reuse this framework to test their work as well.

I can keep this PR in draft status until another dependent PR wants it merged, since it's not testing anything uncovered by existing tests as is.

Note: this PR would also significantly reduce the diff and review burden for the async scanner (https://github.com/UkoeHB/monero/pull/23) when that is ready to be PR'd to the main repo.