namecoin / electrum-nmc

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

Add some name registration functional tests #256

Closed JeremyRand closed 3 years ago

JeremyRand commented 4 years ago

Refs https://github.com/namecoin/electrum-nmc/issues/254

JeremyRand commented 3 years ago

The "Avoid redundant wallet load operations" and "RPC client: exit code 1 if RPC server returned error" commits are no longer necessary; they were merged upstream and have filtered down to Electrum-NMC master.

JeremyRand commented 3 years ago

The "Avoid redundant wallet load operations" and "RPC client: exit code 1 if RPC server returned error" commits are no longer necessary; they were merged upstream and have filtered down to Electrum-NMC master.

Removed them from this PR.

JeremyRand commented 3 years ago

The "Disable Lightning regtests" commit is no longer necessary, because Electrum-NMC master now passes the Lightning regtests.

JeremyRand commented 3 years ago

The "Disable Lightning regtests" commit is no longer necessary, because Electrum-NMC master now passes the Lightning regtests.

Removed it from this PR.

JeremyRand commented 3 years ago

@domob1812 It looks like broadcasting a name_new transaction with the default fee causes Namecoin Core to error with "insufficient fee" when done on Regtest. Are there any fee logic/constants in Namecoin Core that behave differently between Mainnet and Regtest?

JeremyRand commented 3 years ago

@domob1812 It looks like broadcasting a name_new transaction with the default fee causes Namecoin Core to error with "insufficient fee" when done on Regtest. Are there any fee logic/constants in Namecoin Core that behave differently between Mainnet and Regtest?

Figured out the issue; I had forgotten that Electrum doesn't add broadcasted transactions to the wallet until a few seconds after broadcast (when the server announces them), so Namecoin Core interpreted my 2nd name_new as a double-spend, i.e. the "insufficient fee" error was in relation to the lack of an RBF fee bump, not the fee itself being too low to relay.

JeremyRand commented 3 years ago

@domob1812 If you happen to have some free time, feel free to glance at this PR. It tests name_new, name_firstupdate, and name_show, and is loosely based on the first half of the name_registration.py functional tests in Namecoin Core. It already surfaced a few minor bugs in Electrum-NMC, which are also fixed in this PR. I plan to merge it in circa 1-2 days, so don't feel obligated to review it -- but I figure you might find it interesting.