From 95a67967783178579c595ced89236925e3d24850 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 17 Jan 2020 23:19:27 +0100 Subject: [PATCH] lnwallet/btcwallet: use fast scrypt options in itest --- lnwallet/btcwallet/btcwallet_rpctest.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lnwallet/btcwallet/btcwallet_rpctest.go diff --git a/lnwallet/btcwallet/btcwallet_rpctest.go b/lnwallet/btcwallet/btcwallet_rpctest.go new file mode 100644 index 00000000..7139e4cc --- /dev/null +++ b/lnwallet/btcwallet/btcwallet_rpctest.go @@ -0,0 +1,23 @@ +// +build rpctest + +package btcwallet + +import ( + "github.com/btcsuite/btcwallet/snacl" + "github.com/btcsuite/btcwallet/waddrmgr" +) + +func init() { + // Instruct waddrmgr to use the cranked down scrypt parameters when + // creating new wallet encryption keys. This will speed up the itests + // considerably. + fastScrypt := waddrmgr.FastScryptOptions + keyGen := func(passphrase *[]byte, config *waddrmgr.ScryptOptions) ( + *snacl.SecretKey, error) { + + return snacl.NewSecretKey( + passphrase, fastScrypt.N, fastScrypt.R, fastScrypt.P, + ) + } + waddrmgr.SetSecretKeyGen(keyGen) +}