diff --git a/hdkeychain/go.sum b/hdkeychain/go.sum index fb2083ca73..5e59b71cc5 100644 --- a/hdkeychain/go.sum +++ b/hdkeychain/go.sum @@ -17,7 +17,6 @@ github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.1 h1:V6eqU1crZzuoFT4KG2LhaU5xDSdkHuvLQsj25wd7Wb4= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.1/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= -github.com/decred/dcrd/dcrutil/v4 v4.0.0-20210129181600-6ae0142d3b28/go.mod h1:xe59jKcMx5G/dbRmsZ8+FzY+WQDE/7YBP3k3uzJTtmI= github.com/decred/dcrd/wire v1.4.0 h1:KmSo6eTQIvhXS0fLBQ/l7hG7QLcSJQKSwSyzSqJYDk0= github.com/decred/dcrd/wire v1.4.0/go.mod h1:WxC/0K+cCAnBh+SKsRjIX9YPgvrjhmE+6pZlel1G7Ro= github.com/decred/slog v1.1.0/go.mod h1:kVXlGnt6DHy2fV5OjSeuvCJ0OmlmTF6LFpEPMu/fOY0= diff --git a/txscript/go.mod b/txscript/go.mod index f06c04789b..a5dbf0ad61 100644 --- a/txscript/go.mod +++ b/txscript/go.mod @@ -12,12 +12,8 @@ require ( github.com/decred/dcrd/dcrec v1.0.0 github.com/decred/dcrd/dcrec/edwards/v2 v2.0.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210127014238-b33b46cf1a24 - github.com/decred/dcrd/dcrutil/v4 v4.0.0-20210129181600-6ae0142d3b28 github.com/decred/dcrd/wire v1.4.0 github.com/decred/slog v1.1.0 ) -replace ( - github.com/decred/dcrd/dcrec/secp256k1/v4 => ../dcrec/secp256k1 - github.com/decred/dcrd/dcrutil/v4 => ../dcrutil -) +replace github.com/decred/dcrd/dcrec/secp256k1/v4 => ../dcrec/secp256k1 diff --git a/txscript/reference_test.go b/txscript/reference_test.go index f29eef351f..3d2a238834 100644 --- a/txscript/reference_test.go +++ b/txscript/reference_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/dcrutil/v4" "github.com/decred/dcrd/wire" ) @@ -559,10 +558,9 @@ testloop: continue } - tx, err := dcrutil.NewTxFromBytes(serializedTx) - if err != nil { - t.Errorf("bad test (arg 2 not msgtx %v) %d: %v", err, - i, test) + var tx wire.MsgTx + if err := tx.Deserialize(bytes.NewReader(serializedTx)); err != nil { + t.Errorf("bad test (arg 2 not msgtx %v) %d: %v", err, i, test) continue } @@ -632,8 +630,8 @@ testloop: prevOuts[*wire.NewOutPoint(prevhash, idx, wire.TxTreeRegular)] = script } - for k, txin := range tx.MsgTx().TxIn { - pkScript, ok := prevOuts[txin.PreviousOutPoint] + for k, txIn := range tx.TxIn { + pkScript, ok := prevOuts[txIn.PreviousOutPoint] if !ok { t.Errorf("bad test (missing %dth input) %d:%v", k, i, test) @@ -642,8 +640,7 @@ testloop: // These are meant to fail, so as soon as the first // input fails the transaction has failed. (some of the // test txns have good inputs, too.. - vm, err := NewEngine(pkScript, tx.MsgTx(), k, flags, 0, - nil) + vm, err := NewEngine(pkScript, &tx, k, flags, 0, nil) if err != nil { continue testloop } @@ -701,10 +698,9 @@ testloop: continue } - tx, err := dcrutil.NewTxFromBytes(serializedTx) - if err != nil { - t.Errorf("bad test (arg 2 not msgtx %v) %d: %v", err, - i, test) + var tx wire.MsgTx + if err := tx.Deserialize(bytes.NewReader(serializedTx)); err != nil { + t.Errorf("bad test (arg 2 not msgtx %v) %d: %v", err, i, test) continue } @@ -774,15 +770,14 @@ testloop: prevOuts[*wire.NewOutPoint(prevhash, idx, wire.TxTreeRegular)] = script } - for k, txin := range tx.MsgTx().TxIn { - pkScript, ok := prevOuts[txin.PreviousOutPoint] + for k, txIn := range tx.TxIn { + pkScript, ok := prevOuts[txIn.PreviousOutPoint] if !ok { t.Errorf("bad test (missing %dth input) %d:%v", k, i, test) continue testloop } - vm, err := NewEngine(pkScript, tx.MsgTx(), k, flags, 0, - nil) + vm, err := NewEngine(pkScript, &tx, k, flags, 0, nil) if err != nil { t.Errorf("test (%d:%v:%d) failed to create "+ "script: %v", i, test, k, err)