-
Notifications
You must be signed in to change notification settings - Fork 12
Support batch import of addresses through the API #258
Comments
LGTM. With slight exception of point 4. If I'm not mistaken that could be fairly easy tested using https://github.com/input-output-hk/cardano-wallet/wiki/Building-Running-and-Testing-a-wallet-node
Also It is not clear to me whether we disallow batch import during restoration or not. (Acceptance criteria says |
You're 100% right. The point 4 is a note because, I am not actually sure of what will happen if we do import some addresses during restoration (especially some used ones). I shouldn't matter and I can't see anything obviously wrong with that but you know, testing it is always better. I suggest we do it before closing the ticket 👍 Would you, or would you rather leave that to me? |
I'll go for it. Sure. |
I did some manual testing and documented scenarios under #308. |
@piotr-iohk Last PR about displaying a more meaningful error message has been backported to develop. So I think we're good to go with this ticket 👍 |
lgtm 👍 |
Context
Exchanges typically use our wallet as a giant bucket of addresses, using a single account containing many addresses. Usually, they keep a mapping of 1 address per user, such that, they can advertise a "deposit address" to their users.
This means that, when they create a new random address from the API, and show it to their users, this address should remain available and known until used. If they were to restart their wallet with an empty DB, they'll loose all unused address and there's no guarantee they'll ever generate those again.
Decision
In order to allow exchange to migrate from versions prior to 1.4 to 1.4+ using the new data-layer, we need to provide them with an extra endpoint to give them the ability to import addresses into an existing wallet / account.
Acceptance Criterias
must
support an extra endpoint to perform batch import of addressesmustn't
fail if one or several addresses can't be imported (but rather, go through with the rest and report the failures back, if any).mustn't
override existing addresses in the DBmay
disallow batch import during a restoration (unless we can correctly manage the fact that addresses may be imported prior to being discovered during restoration)may
define a hard-limit for the batch's sizeDevelopment Plan
POST /api/v1/wallets/{wid}/accounts/{accix}/addresses
to define batch importPR
develop
develop
release/2.0.2
develop
develop
develop
develop
develop
develop
develop
release/2.0.2
develop
develop
QA
Note, this has also been backported to
develop
Retrospective
The text was updated successfully, but these errors were encountered: