-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wallet: allow updating of claimed names #438
Conversation
I sort of think the test should be written without RPC. It takes the HTTP stuff and API stuff out of the equation. Maybe take a look at the tests in other txdb-focused patches: #262 and #387. If you focus only on the single module you are updating, you may find you can take out a lot of unnecessary stuff like the blockchain! And you may not have to even mine blocks or advance the namestate through its life cycle. |
I migrated the tests to |
Codecov Report
@@ Coverage Diff @@
## master #438 +/- ##
==========================================
+ Coverage 61.99% 62.38% +0.39%
==========================================
Files 129 129
Lines 34843 34843
Branches 5920 5922 +2
==========================================
+ Hits 21600 21736 +136
+ Misses 13243 13107 -136
Continue to review full report at Codecov.
|
d3f1e8f
to
5af133a
Compare
The wallet assumed that `REGISTER` outputs could only come from `REVEAL` outputs, but they can also come from `CLAIM` outputs. That prevented users that have claimed their name to ever update it using the `sendupdate` API. These changes allow `CLAIM` outputs to be spent using the `sendupdate` API.
Added test coverage of this codepath. |
Added pre and post assertions for wallet balance after indexing blocks/coins. This should be ready for another round of review @pinheadmz @boymanjor |
ok this is so close to landing! just down to the nittiest of nits. |
@pinheadmz @boymanjor Nits are resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c533bde
Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ACK c533bdeb9212835e06391163e1cff0f21ba23c04
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAl61UWEACgkQ5+KYS2KJ
yTpUKBAArROU9qIyFdzNEPMdpuljDx1bKCCJafg6+KmAkfuQhMvK/hibrIOoWPSU
DC7JW3tpyxdFczXfzJHRiTuS7l/lu+amthUksCoHyblFYxh/NWRwhPWXBiHVbiKY
lkWPXXBR6fwHSNJDpRuQks5Z6smW8NMm+rrFxezif+z8jVWjd4BnH1leT6pEratA
gVEbrM50t7wX+Jx+MdiLaVI0K2FGLmlmERDBRXJxUjJxEquZ3LDYdiFNBDlFEBOC
GrcGlkGhoTC1aU1hkWm510vev52qVJY2neMVnMwg4JL6v5hj/FlBtZ9ureJ4mIVw
+r/z6XcQ5IeFnzwllxezMgfR4qheL+wOEgLB9nKbn+KKw5QD+APw+kr4sa7s47dM
QEAmjzWkAcyddMnzGzxHppHgbcoxDZUoVSKdVk8DnZn5p6v+wuCJGGX1Lqmz7bXo
pUL7lEW/8xcGWoGnxaBWBwRO0D2hQogjUepdHbd5GqxG6VnPcrDDSP+0G3FtbZfb
vF5mwz11KtwMVIP82ooiZrujO0t+rsdqkdWLOAsckf0PpsCl0a/3iDoZJjIAbo6r
8oJHPkurUrQ9DDJmhtopcHR1Nbrjns6vA85lvwWmI8UM6syDCBf+kkRyEBLTFshx
Uj1q+PgxXSfU2TRROLTaaFQNbK1OX1JSUR2sBGBUt6nTTUwl6Ew=
=IMOH
-----END PGP SIGNATURE-----
pinheadmz's public key is on keybase
There is currently a bug in the wallet where it assumes that
REGISTER
outputs only come fromREVEAL
outputs. This prevents any name claim from ever updating their name using the wallet API. It is still possible to manually create theREGISTER
transaction and broadcast it directly to the blockchain without using the wallet API. This is risky because a user could forget to create the transaction with the additional output containing the value "locked in the claim" to themselves.hsd/lib/wallet/txdb.js
Lines 1703 to 1710 in 4178fd3
REGISTER
outputs can also come fromCLAIM
outputs when the name is reserved.hsd/lib/covenants/rules.js
Lines 1218 to 1227 in 4178fd3
These changes do not use
rules.isReserved
and instead directly usereserved.has
to handle the case when the name is claimed before the claim period ends and then updated for the first time after the claim period ends.Tests are included that test updating fake claims using the wallet (not the memwallet).