coinset: Update for wire.NewMsgTx API change.

This commit is contained in:
Dave Collins 2016-10-26 21:28:16 -05:00
parent 68e5965458
commit aa9087a7ef
No known key found for this signature in database
GPG key ID: B8904D9D9C93D1F2
2 changed files with 3 additions and 3 deletions

View file

@ -124,8 +124,8 @@ func (cs *CoinSet) removeElement(e *list.Element) Coin {
// NewMsgTxWithInputCoins takes the coins in the CoinSet and makes them // NewMsgTxWithInputCoins takes the coins in the CoinSet and makes them
// the inputs to a new wire.MsgTx which is returned. // the inputs to a new wire.MsgTx which is returned.
func NewMsgTxWithInputCoins(inputCoins Coins) *wire.MsgTx { func NewMsgTxWithInputCoins(txVersion int32, inputCoins Coins) *wire.MsgTx {
msgTx := wire.NewMsgTx() msgTx := wire.NewMsgTx(txVersion)
coins := inputCoins.Coins() coins := inputCoins.Coins()
msgTx.TxIn = make([]*wire.TxIn, len(coins)) msgTx.TxIn = make([]*wire.TxIn, len(coins))
for i, coin := range coins { for i, coin := range coins {

View file

@ -109,7 +109,7 @@ func TestCoinSet(t *testing.T) {
t.Error("Expected first coin") t.Error("Expected first coin")
} }
mtx := coinset.NewMsgTxWithInputCoins(cs) mtx := coinset.NewMsgTxWithInputCoins(wire.TxVersion, cs)
if len(mtx.TxIn) != 1 { if len(mtx.TxIn) != 1 {
t.Errorf("Expected only 1 TxIn, got %d", len(mtx.TxIn)) t.Errorf("Expected only 1 TxIn, got %d", len(mtx.TxIn))
} }