Skip to content

Instantly share code, notes, and snippets.

@rodkeys
Last active December 19, 2019 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodkeys/73664baa94876f3514d7d813c5eb5a1a to your computer and use it in GitHub Desktop.
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
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