keychain: use t.Helper() instead of manually fetching the line no from the runtime
This commit is contained in:
parent
1ff596ecd7
commit
917f929e70
@ -5,7 +5,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -94,10 +93,10 @@ func createTestBtcWallet(coinType uint32) (func(), *wallet.Wallet, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func assertEqualKeyLocator(t *testing.T, a, b KeyLocator) {
|
func assertEqualKeyLocator(t *testing.T, a, b KeyLocator) {
|
||||||
_, _, line, _ := runtime.Caller(1)
|
t.Helper()
|
||||||
if a != b {
|
if a != b {
|
||||||
t.Fatalf("line #%v: mismatched key locators: expected %v, "+
|
t.Fatalf("mismatched key locators: expected %v, "+
|
||||||
"got %v", line, spew.Sdump(a), spew.Sdump(b))
|
"got %v", spew.Sdump(a), spew.Sdump(b))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user