func TstCheckWithdrawalStatusMatches(t *testing.T, s1, s2 WithdrawalStatus) {
	if s1.Fees() != s2.Fees() {
		t.Fatalf("Wrong amount of network fees; want %d, got %d", s1.Fees(), s2.Fees())
	}
	if !reflect.DeepEqual(s1.Sigs(), s2.Sigs()) {
		t.Fatalf("Wrong tx signatures; got %x, want %x", s1.Sigs(), s2.Sigs())
	}
	if !reflect.DeepEqual(s1.NextInputAddr(), s2.NextInputAddr()) {
		t.Fatalf("Wrong NextInputAddr; got %v, want %v", s1.NextInputAddr(), s2.NextInputAddr())
	}
	if !reflect.DeepEqual(s1.NextChangeAddr(), s2.NextChangeAddr()) {
		t.Fatalf("Wrong NextChangeAddr; got %v, want %v", s1.NextChangeAddr(), s2.NextChangeAddr())
	}
	if !reflect.DeepEqual(s1.Outputs(), s2.Outputs()) {
		t.Fatalf("Wrong WithdrawalOutputs; got %v, want %v", s1.Outputs(), s2.Outputs())
	}
	if !reflect.DeepEqual(s1.transactions, s2.transactions) {
		t.Fatalf("Wrong transactions; got %v, want %v", s1.transactions, s2.transactions)
	}
	if !reflect.DeepEqual(s1, s2) {
		t.Fatalf("Wrong WithdrawalStatus; got %v, want %v", s1, s2)
	}
}
TstCheckWithdrawalStatusMatches compares s1 and s2 using reflect.DeepEqual
and calls t.Fatal() if they're not identical.
package votingpool
import (
	"os"
	"reflect"
	"runtime"
	"testing"
	"github.com/gcash/bchlog"
	"github.com/gcash/bchwallet/waddrmgr"
	"github.com/gcash/bchwallet/walletdb"
)
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	logger := bchlog.NewBackend(os.Stdout).Logger("TEST")
	logger.SetLevel(bchlog.LevelDebug)
	UseLogger(logger)
}
func TstCheckError(t *testing.T, testName string, gotErr error, wantErrCode ErrorCode) {
	vpErr, ok := gotErr.(Error)
	if !ok {
		t.Errorf("%s: unexpected error type - got %T (%s), want %T",
			testName, gotErr, gotErr, Error{})
	}
	if vpErr.ErrorCode != wantErrCode {
		t.Errorf("%s: unexpected error code - got %s (%s), want %s",
			testName, vpErr.ErrorCode, vpErr, wantErrCode)
	}
}
func TstRunWithManagerUnlocked(t *testing.T, mgr *waddrmgr.Manager, addrmgrNs walletdb.ReadBucket, callback func()) {
	if err := mgr.Unlock(addrmgrNs, privPassphrase); err != nil {
		t.Fatal(err)
	}
	defer mgr.Lock()
	callback()
}