Created
December 19, 2019 00:45
-
-
Save rodkeys/6c5a05a737244781c03340d953cc29d4 to your computer and use it in GitHub Desktop.
TestWalletService_AddWatchedScript
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 TestWalletService_AddWatchedScript(t *testing.T) { | |
ws, err := mockWalletService() | |
if err != nil { | |
t.Fatal(err) | |
} | |
keys := ws.km.GetKeys() | |
addr, err := ws.km.KeyToAddress(keys[0]) | |
if err != nil { | |
t.Fatal(err) | |
} | |
script, err := txscript.PayToAddrScript(addr) | |
if err != nil { | |
t.Fatal(err) | |
} | |
err = ws.db.WatchedScripts().Put(script) | |
if err == nil { | |
t.Error("failed to prevent saving script that represents an existing key") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment