BitGo / key-recovery-service-v2

Key Recovery Service server for all v2 coins and ERC20 tokens
Apache License 2.0
8 stars 21 forks source link

[BG-5833] Implement master key and wallet key mongoose models #2

Closed typokign closed 6 years ago

typokign commented 6 years ago

Removes the old Key.js model and replaces it with separate models for master keys and wallet keys. Removed a require() to the old key model, so none of the KRS routes work, but will be addressed one at a time.

typokign commented 6 years ago

@marktoda I removed the unnecessary index you mentioned, and also added a new index that ensures that master key xpubs are unique. This will be useful in case an admin accidentally imports the same file of xpubs twice, the insert will fail and we won't push any duplicate keys to the database. Let me know your thoughts whenever you have a moment (no rush) :)

marktoda commented 6 years ago

@dacruz21 I meant you could take the master xpub and path out as fields entirely from the walletKey model, my thinking was just to minimize the places where the master xpub is exposed.. Though I guess it's not really a big deal since you would need it anyway to calculate the wallet xpub