mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
Add goclean.sh script from btcd.
This commit corrects various things found by the static checkers (comments, unkeyed fields, return after some if/else). Add generated files and legacy files to the whitelist to be ignored. Catch .travis.yml up with btcd so goclean can be run.
This commit is contained in:
parent
fcccae3d1a
commit
c2ed8ffc2b
12 changed files with 138 additions and 37 deletions
16
.travis.yml
16
.travis.yml
|
@ -1,6 +1,16 @@
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.4.3
|
- 1.5.3
|
||||||
- 1.5.2
|
- 1.6
|
||||||
sudo: false
|
sudo: false
|
||||||
install: go get -d -t -v ./...
|
before_install:
|
||||||
|
- gotools=golang.org/x/tools
|
||||||
|
install:
|
||||||
|
- go get -d -t -v ./...
|
||||||
|
- go get -v $gotools/cmd/cover
|
||||||
|
- go get -v $gotools/cmd/vet
|
||||||
|
- go get -v github.com/bradfitz/goimports
|
||||||
|
- go get -v github.com/golang/lint/golint
|
||||||
|
script:
|
||||||
|
- export PATH=$PATH:$HOME/gopath/bin
|
||||||
|
- ./goclean.sh
|
||||||
|
|
|
@ -342,8 +342,8 @@ out:
|
||||||
case dequeue <- next:
|
case dequeue <- next:
|
||||||
if n, ok := next.(BlockConnected); ok {
|
if n, ok := next.(BlockConnected); ok {
|
||||||
bs = &waddrmgr.BlockStamp{
|
bs = &waddrmgr.BlockStamp{
|
||||||
n.Height,
|
Height: n.Height,
|
||||||
n.Hash,
|
Hash: n.Hash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
39
goclean.sh
Executable file
39
goclean.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# The script does automatic checking on a Go package and its sub-packages, including:
|
||||||
|
# 1. gofmt (http://golang.org/cmd/gofmt/)
|
||||||
|
# 2. goimports (https://github.com/bradfitz/goimports)
|
||||||
|
# 3. golint (https://github.com/golang/lint)
|
||||||
|
# 4. go vet (http://golang.org/cmd/vet)
|
||||||
|
# 5. race detector (http://blog.golang.org/race-detector)
|
||||||
|
# 6. test coverage (http://blog.golang.org/cover)
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Automatic checks
|
||||||
|
test -z "$(gofmt -l -w . | tee /dev/stderr)"
|
||||||
|
test -z "$(goimports -l -w . | tee /dev/stderr)"
|
||||||
|
test -z "$(golint ./... | grep -v 'ALL_CAPS\|OP_\|NewFieldVal\|RpcCommand\|RpcRawCommand\|RpcSend\|Dns\|api.pb.go\|StartConsensusRpc\|factory_test.go\|legacy' | tee /dev/stderr)"
|
||||||
|
test -z "$(go tool vet . 2>&1 | grep -v 'Example\|newestSha\|rpcserver/server.go' | tee /dev/stderr)"
|
||||||
|
env GORACE="halt_on_error=1" go test -v -race ./...
|
||||||
|
|
||||||
|
# Run test coverage on each subdirectories and merge the coverage profile.
|
||||||
|
|
||||||
|
set +x
|
||||||
|
echo "mode: count" > profile.cov
|
||||||
|
|
||||||
|
# Standard go tooling behavior is to ignore dirs with leading underscores.
|
||||||
|
for dir in $(find . -maxdepth 10 -not -path '.' -not -path './.git*' \
|
||||||
|
-not -path '*/_*' -not -path './cmd*' -not -path './release*' -type d)
|
||||||
|
do
|
||||||
|
if ls $dir/*.go &> /dev/null; then
|
||||||
|
go test -covermode=count -coverprofile=$dir/profile.tmp $dir
|
||||||
|
if [ -f $dir/profile.tmp ]; then
|
||||||
|
cat $dir/profile.tmp | tail -n +2 >> profile.cov
|
||||||
|
rm $dir/profile.tmp
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# To submit the test coverage result to coveralls.io,
|
||||||
|
# use goveralls (https://github.com/mattn/goveralls)
|
||||||
|
# goveralls -coverprofile=profile.cov -service=travis-ci
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/btcsuite/btcutil"
|
"github.com/btcsuite/btcutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SumOutputValues sums up the list of TxOuts and returns an Amount.
|
||||||
func SumOutputValues(outputs []*wire.TxOut) (totalOutput btcutil.Amount) {
|
func SumOutputValues(outputs []*wire.TxOut) (totalOutput btcutil.Amount) {
|
||||||
for _, txOut := range outputs {
|
for _, txOut := range outputs {
|
||||||
totalOutput += btcutil.Amount(txOut.Value)
|
totalOutput += btcutil.Amount(txOut.Value)
|
||||||
|
@ -18,6 +19,7 @@ func SumOutputValues(outputs []*wire.TxOut) (totalOutput btcutil.Amount) {
|
||||||
return totalOutput
|
return totalOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SumOutputSerializeSizes sums up the serialized size of the supplied outputs.
|
||||||
func SumOutputSerializeSizes(outputs []*wire.TxOut) (serializeSize int) {
|
func SumOutputSerializeSizes(outputs []*wire.TxOut) (serializeSize int) {
|
||||||
for _, txOut := range outputs {
|
for _, txOut := range outputs {
|
||||||
serializeSize += txOut.SerializeSize()
|
serializeSize += txOut.SerializeSize()
|
||||||
|
|
|
@ -17,8 +17,8 @@ var (
|
||||||
returnsLTRArray = []interface{}{(*[]btcjson.ListTransactionsResult)(nil)}
|
returnsLTRArray = []interface{}{(*[]btcjson.ListTransactionsResult)(nil)}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Contains all methods and result types that help is generated for, for every
|
// Methods contains all methods and result types that help is generated for,
|
||||||
// locale.
|
// for every locale.
|
||||||
var Methods = []struct {
|
var Methods = []struct {
|
||||||
Method string
|
Method string
|
||||||
ResultTypes []interface{}
|
ResultTypes []interface{}
|
||||||
|
@ -70,6 +70,7 @@ var Methods = []struct {
|
||||||
{"walletislocked", returnsBool},
|
{"walletislocked", returnsBool},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HelpDescs contains the locale-specific help strings along with the locale.
|
||||||
var HelpDescs = []struct {
|
var HelpDescs = []struct {
|
||||||
Locale string // Actual locale, e.g. en_US
|
Locale string // Actual locale, e.g. en_US
|
||||||
GoLocale string // Locale used in Go names, e.g. EnUS
|
GoLocale string // Locale used in Go names, e.g. EnUS
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
// Use of this source code is governed by an ISC
|
// Use of this source code is governed by an ISC
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// This package implements the RPC API and is used by the main package to start
|
// Package rpcserver implements the RPC API and is used by the main package to
|
||||||
// gRPC services.
|
// start gRPC services.
|
||||||
//
|
//
|
||||||
// Full documentation of the API implemented by this package is maintained in a
|
// Full documentation of the API implemented by this package is maintained in a
|
||||||
// language-agnostic document:
|
// language-agnostic document:
|
||||||
|
@ -854,11 +854,10 @@ func (s *loaderServer) StartConsensusRpc(ctx context.Context, req *pb.StartConse
|
||||||
if err == btcrpcclient.ErrInvalidAuth {
|
if err == btcrpcclient.ErrInvalidAuth {
|
||||||
return nil, grpc.Errorf(codes.InvalidArgument,
|
return nil, grpc.Errorf(codes.InvalidArgument,
|
||||||
"Invalid RPC credentials: %v", err)
|
"Invalid RPC credentials: %v", err)
|
||||||
} else {
|
}
|
||||||
return nil, grpc.Errorf(codes.NotFound,
|
return nil, grpc.Errorf(codes.NotFound,
|
||||||
"Connection to RPC server failed: %v", err)
|
"Connection to RPC server failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
s.rpcClient = rpcClient
|
s.rpcClient = rpcClient
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,14 @@ var (
|
||||||
prng = rand.Reader
|
prng = rand.Reader
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Error types and messages.
|
||||||
var (
|
var (
|
||||||
ErrInvalidPassword = errors.New("invalid password")
|
ErrInvalidPassword = errors.New("invalid password")
|
||||||
ErrMalformed = errors.New("malformed data")
|
ErrMalformed = errors.New("malformed data")
|
||||||
ErrDecryptFailed = errors.New("unable to decrypt")
|
ErrDecryptFailed = errors.New("unable to decrypt")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Various constants needed for encryption scheme.
|
||||||
const (
|
const (
|
||||||
// Expose secretbox's Overhead const here for convenience.
|
// Expose secretbox's Overhead const here for convenience.
|
||||||
Overhead = secretbox.Overhead
|
Overhead = secretbox.Overhead
|
||||||
|
|
|
@ -1930,12 +1930,11 @@ func upgradeToVersion4(namespace walletdb.Namespace, pubPassPhrase []byte) error
|
||||||
if err == nil {
|
if err == nil {
|
||||||
const str = "default account exists under old name"
|
const str = "default account exists under old name"
|
||||||
return managerError(ErrUpgrade, str, nil)
|
return managerError(ErrUpgrade, str, nil)
|
||||||
} else {
|
}
|
||||||
merr, ok := err.(ManagerError)
|
merr, ok := err.(ManagerError)
|
||||||
if !ok || merr.ErrorCode != ErrAccountNotFound {
|
if !ok || merr.ErrorCode != ErrAccountNotFound {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -116,8 +116,7 @@ type OpenCallbacks struct {
|
||||||
ObtainPrivatePass ObtainUserInputFunc
|
ObtainPrivatePass ObtainUserInputFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultConfig is an instance of the Options struct initialized with default
|
// DefaultScryptOptions is the default options used with scrypt.
|
||||||
// configuration options.
|
|
||||||
var DefaultScryptOptions = ScryptOptions{
|
var DefaultScryptOptions = ScryptOptions{
|
||||||
N: 262144, // 2^18
|
N: 262144, // 2^18
|
||||||
R: 8,
|
R: 8,
|
||||||
|
|
|
@ -191,7 +191,7 @@ out:
|
||||||
log.Infof("Finished rescan for %d %s (synced to block "+
|
log.Infof("Finished rescan for %d %s (synced to block "+
|
||||||
"%s, height %d)", len(addrs), noun, n.Hash,
|
"%s, height %d)", len(addrs), noun, n.Hash,
|
||||||
n.Height)
|
n.Height)
|
||||||
bs := waddrmgr.BlockStamp{n.Height, *n.Hash}
|
bs := waddrmgr.BlockStamp{Height: n.Height, Hash: *n.Hash}
|
||||||
if err := w.Manager.SetSyncedTo(&bs); err != nil {
|
if err := w.Manager.SetSyncedTo(&bs); err != nil {
|
||||||
log.Errorf("Failed to update address manager "+
|
log.Errorf("Failed to update address manager "+
|
||||||
"sync state for hash %v (height %d): %v",
|
"sync state for hash %v (height %d): %v",
|
||||||
|
|
|
@ -557,8 +557,13 @@ func TestPreviousPkScripts(t *testing.T) {
|
||||||
buildTx := func(prevHash *wire.ShaHash, script0, script1 []byte) *wire.MsgTx {
|
buildTx := func(prevHash *wire.ShaHash, script0, script1 []byte) *wire.MsgTx {
|
||||||
return &wire.MsgTx{
|
return &wire.MsgTx{
|
||||||
TxIn: []*wire.TxIn{
|
TxIn: []*wire.TxIn{
|
||||||
&wire.TxIn{PreviousOutPoint: wire.OutPoint{*prevHash, 0}},
|
&wire.TxIn{PreviousOutPoint: wire.OutPoint{
|
||||||
&wire.TxIn{PreviousOutPoint: wire.OutPoint{*prevHash, 1}},
|
Hash: *prevHash,
|
||||||
|
Index: 0,
|
||||||
|
}},
|
||||||
|
&wire.TxIn{PreviousOutPoint: wire.OutPoint{
|
||||||
|
Hash: *prevHash, Index: 1,
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
TxOut: []*wire.TxOut{
|
TxOut: []*wire.TxOut{
|
||||||
&wire.TxOut{Value: 1e8, PkScript: script0},
|
&wire.TxOut{Value: 1e8, PkScript: script0},
|
||||||
|
|
|
@ -154,7 +154,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstRecvTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstRecvTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstRecvTx.Sha(): {},
|
*TstRecvTx.Sha(): {},
|
||||||
|
@ -178,7 +181,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstRecvTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstRecvTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstRecvTx.Sha(): {},
|
*TstRecvTx.Sha(): {},
|
||||||
|
@ -202,7 +208,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
bal: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
||||||
unc: 0,
|
unc: 0,
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstRecvTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstRecvTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{},
|
unmined: map[wire.ShaHash]struct{}{},
|
||||||
},
|
},
|
||||||
|
@ -224,7 +233,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
bal: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
||||||
unc: 0,
|
unc: 0,
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstRecvTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstRecvTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{},
|
unmined: map[wire.ShaHash]struct{}{},
|
||||||
},
|
},
|
||||||
|
@ -237,7 +249,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
unc: btcutil.Amount(TstRecvTx.MsgTx().TxOut[0].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstRecvTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstRecvTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstRecvTx.Sha(): {},
|
*TstRecvTx.Sha(): {},
|
||||||
|
@ -261,7 +276,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: btcutil.Amount(TstDoubleSpendTx.MsgTx().TxOut[0].Value),
|
bal: btcutil.Amount(TstDoubleSpendTx.MsgTx().TxOut[0].Value),
|
||||||
unc: 0,
|
unc: 0,
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstDoubleSpendTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstDoubleSpendTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{},
|
unmined: map[wire.ShaHash]struct{}{},
|
||||||
},
|
},
|
||||||
|
@ -317,7 +335,10 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value),
|
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstSpendingTx.Sha(): {},
|
*TstSpendingTx.Sha(): {},
|
||||||
|
@ -340,8 +361,14 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 1}: {},
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
|
wire.OutPoint{
|
||||||
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 1,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstSpendingTx.Sha(): {},
|
*TstSpendingTx.Sha(): {},
|
||||||
|
@ -360,8 +387,14 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
bal: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
||||||
unc: 0,
|
unc: 0,
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 1}: {},
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
|
wire.OutPoint{
|
||||||
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 1,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{},
|
unmined: map[wire.ShaHash]struct{}{},
|
||||||
},
|
},
|
||||||
|
@ -374,8 +407,14 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
bal: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
||||||
unc: 0,
|
unc: 0,
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 1}: {},
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
|
wire.OutPoint{
|
||||||
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 1,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{},
|
unmined: map[wire.ShaHash]struct{}{},
|
||||||
},
|
},
|
||||||
|
@ -388,8 +427,14 @@ func TestInsertsCreditsDebitsRollbacks(t *testing.T) {
|
||||||
bal: 0,
|
bal: 0,
|
||||||
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
unc: btcutil.Amount(TstSpendingTx.MsgTx().TxOut[0].Value + TstSpendingTx.MsgTx().TxOut[1].Value),
|
||||||
unspents: map[wire.OutPoint]struct{}{
|
unspents: map[wire.OutPoint]struct{}{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 0}: {},
|
wire.OutPoint{
|
||||||
wire.OutPoint{*TstSpendingTx.Sha(), 1}: {},
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 0,
|
||||||
|
}: {},
|
||||||
|
wire.OutPoint{
|
||||||
|
Hash: *TstSpendingTx.Sha(),
|
||||||
|
Index: 1,
|
||||||
|
}: {},
|
||||||
},
|
},
|
||||||
unmined: map[wire.ShaHash]struct{}{
|
unmined: map[wire.ShaHash]struct{}{
|
||||||
*TstSpendingTx.Sha(): {},
|
*TstSpendingTx.Sha(): {},
|
||||||
|
|
Loading…
Add table
Reference in a new issue