New test for another error case in DepositScriptAddress

On 14/09/14 22:37, Jimmy Song wrote:
> In waddrmgr/pool_test.go:
> 
>> @@ -248,6 +249,33 @@ func TestDepositScriptAddressForHardenedPubKey(t *testing.T) {
>>  	}
>>  }
>>  
>> +type FailingToEncryptCryptoKey struct {
>> +	waddrmgr.CryptoKey
>> +}
>> +
>> +func (c *FailingToEncryptCryptoKey) Encrypt(in []byte) ([]byte, error) {
>> +	return nil, errors.New("failed to encrypt")
>> +}
>> +
> 
> I wonder if putting these inside the
> TestDepositScriptAddressFailureToEncrypt function would be better. No
> reason to pollute the global namespace until we find a second case that
> uses it.

It's the test namespace (waddrmgr_test), so I don't think we need to be
that concerned with having those there. Also, other tests may want to
mock Manager.cryptoKeyScript. And finally, AFAIK we can't have method
declarations inside functions.