Skip to content
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: enable importing names and "watch" for auction activity without bidding #408

Merged
merged 3 commits into from
Apr 3, 2020

Conversation

pinheadmz
Copy link
Member

This enables a user to import a name into their wallet in a similar way to importing an address or public key. A rescan is still required to recover any auction activity and in particular the OPEN for a name MUST be rescanned or the wallet will not record a nameState or track any bids.

The WalletDB global name->wid map is used as a "watch" marker to determine if a name's OPEN should be added to the txdb.

The new rpc command takes a rescan height parameter:

hsw-rpc importname sad 2016

Wallet applications should check the state of a name and use a name's height - 1 as the rescan height. Assuming the auction is still in bidding phase, this will initiate a wallet rescan of maximum 5 days.

See kyokan/bob-wallet#108

Copy link
Contributor

@boymanjor boymanjor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pinheadmz left some comments.

lib/wallet/rpc.js Outdated Show resolved Hide resolved
lib/wallet/rpc.js Outdated Show resolved Hide resolved
test/wallet-importname-test.js Outdated Show resolved Hide resolved
@pinheadmz
Copy link
Member Author

@boymanjor thanks bud, nits are picked!

This enables a user to import a name into their wallet in a similar
way to importing an address or public key. A rescan is still required
to recover any auction activity and in particular the OPEN for a name
MUST be rescanned or the wallet will not record a nameState or track
any bids.

The WalletDB global name->wid map is used as a "watch" marker to
determine if a name's OPEN should be added to the txdb.
@pinheadmz
Copy link
Member Author

rebase to f8b6de6:

Rebased on master. This PR combined with #418 are required for upcoming feature in Bob to sync bids from an in-progress auction.

@codecov-io
Copy link

codecov-io commented Apr 1, 2020

Codecov Report

Merging #408 into master will increase coverage by 0.09%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #408      +/-   ##
==========================================
+ Coverage   61.79%   61.89%   +0.09%     
==========================================
  Files         129      129              
  Lines       34830    34862      +32     
  Branches     5918     5923       +5     
==========================================
+ Hits        21524    21577      +53     
+ Misses      13306    13285      -21     
Impacted Files Coverage Δ
lib/wallet/rpc.js 25.05% <85.71%> (+0.76%) ⬆️
lib/wallet/txdb.js 84.10% <85.71%> (+0.37%) ⬆️
lib/wallet/wallet.js 69.81% <100.00%> (+0.24%) ⬆️
lib/primitives/mtx.js 69.61% <0.00%> (+0.12%) ⬆️
lib/mempool/fees.js 67.63% <0.00%> (+0.48%) ⬆️
lib/coins/coinview.js 76.08% <0.00%> (+0.54%) ⬆️
lib/primitives/covenant.js 72.01% <0.00%> (+0.91%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24a9d23...02e2233. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants