namecoin / electrum-nmc

Namecoin port of Electrum Bitcoin client.
https://www.namecoin.org/
MIT License
29 stars 24 forks source link

Integration tests for name operations #254

Open domob1812 opened 4 years ago

domob1812 commented 4 years ago

In the past there were already some cases where e.g. upstream merges broke even simple operations like name_update's with segwit/legacy wallets or the like. There are no automated tests for many of these, which I think is not acceptable for a security-oriented project like Namecoin.

There should be at least some integration tests for basic things like registering and updating names with all types of addresses supported. We should be able to use the Lightning regtest scripts for that.

JeremyRand commented 4 years ago

@domob1812 Yes, I concur. What do you think is the best approach to writing the tests? Is it likely that we could copy the approximate logic of the Namecoin Core integration tests? (I assume that e.g. name_update tests should be similar between Namecoin Core and Electrum-NMC.)

domob1812 commented 4 years ago

We might be able to copy some parts, but for that to work, we'd need to write a lot of general "test framework" code I think. The current Lightning tests are just shell scripts rather than Python, so probably the easiest way to do it would just be doing some very simple shell scripts from scratch that just register a name, update it and transfer it, or something. That should be enough to catch already most possible future regressions.