conformal/btcwallet — pull request #144 by larshesel (2014-10-24 11:11:01+00:00)
Title: Make scrypt parameters overridable/optional when creating the Manager

Here is a proposal for making the scrypt parameters overridable when the Manager is created in the waddrmgr.Create call.

Note that I do not store the scrypt parameters in the Manager structure, since they are only used to create the masterKeyPub and masterKeyPriv keys which persisted in the database. Hence the scrypt parameters are not needed later on.

I've modeled the optional parameter on Dave Cheneys 'Functional Options' pattern: http://dotgo.sourcegraph.com/post/99643162983/dave-cheney-functional-options, with the difference that the parameter function does not work directly on the Manager structure but on an auxiliary options structure.

Also note that the tests can currently not be run in parallel. This is not new, but due to the fact that we store the function to generate keys in the package variable newSecretKey, which is set in Create. For now I am considering that a different issue that should be solved separately.