Fix commit screw up

This commit is contained in:
Martin Boehm 2018-05-10 10:05:55 +02:00
parent 1cb2338587
commit 8d422dabaa

View File

@ -19,6 +19,8 @@ import (
var ( var (
// verifier functionality // verifier functionality
verifylog = flag.String("verifylog", "", "path to logfile containing socket.io requests/responses")
wsurl = flag.String("wsurl", "", "URL of socket.io interface to verify")
newSocket = flag.Bool("newsocket", false, "Create new socket.io connection for each request") newSocket = flag.Bool("newsocket", false, "Create new socket.io connection for each request")
) )
@ -253,8 +255,8 @@ func verifyGetDetailedTransaction(t *testing.T, id int, lrs *logRequestResponse,
} else if bbi.Address != li.Address { } else if bbi.Address != li.Address {
// bitcore does not parse bech P2WPKH and P2WSH addresses // bitcore does not parse bech P2WPKH and P2WSH addresses
if bbi.Address == nil || (*bbi.Address)[0:3] != "bc1" { if bbi.Address == nil || (*bbi.Address)[0:3] != "bc1" {
return errors.Errorf("mismatch input Address %v %v", bbi.Address, li.Address) return errors.Errorf("mismatch input Address %v %v", bbi.Address, li.Address)
} }
} }
// both must be null or both must not be null // both must be null or both must not be null
if bbi.Script != nil && li.Script != nil { if bbi.Script != nil && li.Script != nil {
@ -292,10 +294,10 @@ func verifyGetDetailedTransaction(t *testing.T, id int, lrs *logRequestResponse,
} else if bbo.Address != lo.Address { } else if bbo.Address != lo.Address {
// bitcore does not parse bech P2WPKH and P2WSH addresses // bitcore does not parse bech P2WPKH and P2WSH addresses
if bbo.Address == nil || (*bbo.Address)[0:3] != "bc1" { if bbo.Address == nil || (*bbo.Address)[0:3] != "bc1" {
return errors.Errorf("mismatch output Address %v %v", bbo.Address, lo.Address) return errors.Errorf("mismatch output Address %v %v", bbo.Address, lo.Address)
}
} }
} }
}
return nil return nil
} }
// the tx in the log could have been still in mempool with Height -1 // the tx in the log could have been still in mempool with Height -1
@ -394,7 +396,7 @@ func Test_VerifyLog(t *testing.T) {
var ws *gosocketio.Client var ws *gosocketio.Client
if !*newSocket { if !*newSocket {
ws = connectSocketIO(t) ws = connectSocketIO(t)
defer ws.Close() defer ws.Close()
} }
file, err := os.Open(*verifylog) file, err := os.Open(*verifylog)
if err != nil { if err != nil {