From eb112b89f9d6c84163b1ae3c789edd10734b9cbd Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Wed, 14 Mar 2018 11:05:37 +0100 Subject: [PATCH] test default or custom salt on NewMnemonic func --- extkeys/mnemonic_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/extkeys/mnemonic_test.go b/extkeys/mnemonic_test.go index 266cc19ec..4953ed0d8 100644 --- a/extkeys/mnemonic_test.go +++ b/extkeys/mnemonic_test.go @@ -16,6 +16,19 @@ type Vector struct { language, salt, password, input, mnemonic, seed, xprv string } +func TestNewMnemonic(t *testing.T) { + m1 := NewMnemonic("") + if m1.salt != Salt { + t.Errorf("expected default salt, got: %q", m1.salt) + } + + customSalt := "custom-salt" + m2 := NewMnemonic(customSalt) + if m2.salt != customSalt { + t.Errorf("expected %q, got: %q", customSalt, m2.salt) + } +} + // TestMnemonicPhrase func TestMnemonicPhrase(t *testing.T) {