Closed KtorZ closed 4 years ago
Perhaps that's nitpicking but there could be some negative tests added. Like:
@piotr-iohk for points 1 and 3, I am assuming that the https://github.com/bitcoinjs/bip39 is handling those since this is purely mnemonic manipulation. Although the module API takes a list of string, passing anything in there that isn't a valid bip39 mnemonic will simply blow up or give improper result, but that's basically the caller's fault.
For point 2, there's in practice, nothing preventing you to generate a seed using the Byron/random generation method with a 24 words mnemonic for instance. That would be a stupid thing to do, but there's nothing wrong with that per se. The cardano-js
is a private repository used only by Daedalus and I assume they'll not do stupid thing with this :) ... We could adopt a more defensive approach though by adding some explicit assert about the mnemonic length to make sure that no one will actually do these stupid things.
passing anything in there that isn't a valid bip39 mnemonic will simply blow up or give improper result, but that's basically the caller's fault.
Right, so by it's nature a negative test would assure it blows up in expected way. ;)
The cardano-js is a private repository used only by Daedalus...
Perhaps it is not necessary then, although it is always better to be more conservative. Anyway, that's why I was wondering if it is not nitpicking... :man_shrugging:
Right, so by it's nature a negative test would assure it blows up in expected way. ;)
:)
If you want to PR this, feel free ^.^ .. I am not sure I'll do anything about it today
Context
As a Daedalus developer,
I want to be able to associate a mnemonic phrase to its corresponding wallet id,
So that I can implement recurring mnemonic checks to make sure users haven't forgotten their mnemonic sentences.
Decision
Acceptance Criteria
Development
QA
Generation method documented as part of Wallet Cryptography and Encoding
Golden test cases generated using
cardano-wallet
: https://github.com/input-output-hk/cardano-js/blob/dc505f29fba0bbb7a055d184ac3e99c998047b34/src/hd/index.spec.ts#L3-L22