Last active
December 19, 2019 01:51
-
-
Save rodkeys/73664baa94876f3514d7d813c5eb5a1a to your computer and use it in GitHub Desktop.
Verify that AddWatchedAddress should never add a script which already represents a key from the appropriate wallet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestBitcoinCashWallet_verifyWatchScriptPut(t *testing.T) { | |
// Verify that AddWatchedAddress should never add a script which already represents a key from the appropriate wallet | |
w, err := newMockWallet() | |
if err != nil { | |
t.Error(err) | |
} | |
keys := w.km.GetKeys() | |
addr, err := w.km.KeyToAddress(keys[0]) | |
if err != nil { | |
t.Fatal(err) | |
} | |
err = w.AddWatchedAddress(addr) | |
if err == nil { | |
t.Error("Put watched scripts fails on key manager owned key") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment