From 5ec83d23f382ae80d5235cfc29b5f88b2af3b713 Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 21 Sep 2016 18:09:17 -0400 Subject: [PATCH] Update dependencies and API usage. --- glide.lock | 14 +++++++------- rpctest/memwallet.go | 7 +++---- rpctest/rpc_harness.go | 3 ++- rpctest/rpc_harness_test.go | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/glide.lock b/glide.lock index 38a3d357..0cf45937 100644 --- a/glide.lock +++ b/glide.lock @@ -1,19 +1,19 @@ -hash: 9b8ff781a12daad991983e9a421a320e905eecc4e9ff0b0643e790f472bc78c8 -updated: 2016-08-16T23:18:48.976672741-05:00 +hash: 8f89ba1940f8798b8a0449810532e3f0bc552ed97d907bc3447a8941a2ea3a4a +updated: 2016-09-21T18:04:46.586977232-04:00 imports: - name: github.com/btcsuite/btclog - version: f96df2375f37300305f329b8e5258764b4f19a7f + version: 73889fb79bd687870312b6e40effcecffbd57d30 - name: github.com/btcsuite/btcrpcclient - version: f584dbd2e595fcce72fe88440886d4935371ae6b + version: 2b780d16b042054d07aa322146194118fd7f7b81 - name: github.com/btcsuite/btcutil - version: 22c91fa80a5e90e3feda26cf6d43adc249306188 + version: 68e5965458062d031a6e333b35c778ce464fb73f subpackages: - . - base58 - bloom - hdkeychain - name: github.com/btcsuite/fastsha256 - version: 302ad4db268b46f9ebda3078f6f7397f96047735 + version: 637e656429416087660c84436a2a035d69d54e2e - name: github.com/btcsuite/go-flags version: 6c288d648c1cc1befcb90cb5511dcacf64ae8e61 - name: github.com/btcsuite/go-socks @@ -54,7 +54,7 @@ imports: - svc - winapi - name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d + version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 subpackages: - spew testImports: [] diff --git a/rpctest/memwallet.go b/rpctest/memwallet.go index 25f15722..a9ee8853 100644 --- a/rpctest/memwallet.go +++ b/rpctest/memwallet.go @@ -224,11 +224,10 @@ func (m *memWallet) chainSyncer() { undo := &undoEntry{ utxosDestroyed: make(map[wire.OutPoint]*utxo), } - for _, tx := range block.Transactions() { - mtx := tx.MsgTx() + for _, mtx := range block.Transactions { isCoinbase := blockchain.IsCoinBaseTx(mtx) - - m.evalOutputs(mtx.TxOut, tx.Hash(), isCoinbase, undo) + txHash := mtx.TxHash() + m.evalOutputs(mtx.TxOut, &txHash, isCoinbase, undo) m.evalInputs(mtx.TxIn, undo) } diff --git a/rpctest/rpc_harness.go b/rpctest/rpc_harness.go index 24fcd631..9b53ed95 100644 --- a/rpctest/rpc_harness.go +++ b/rpctest/rpc_harness.go @@ -371,10 +371,11 @@ func (h *Harness) GenerateAndSubmitBlock(txns []*btcutil.Tx, blockVersion int32, if err != nil { return nil, err } - prevBlock, err := h.Node.GetBlock(prevBlockHash) + mBlock, err := h.Node.GetBlock(prevBlockHash) if err != nil { return nil, err } + prevBlock := btcutil.NewBlock(mBlock) prevBlock.SetHeight(prevBlockHeight) // Create a new block including the specified transactions diff --git a/rpctest/rpc_harness_test.go b/rpctest/rpc_harness_test.go index 9cefaaa4..fb61ad99 100644 --- a/rpctest/rpc_harness_test.go +++ b/rpctest/rpc_harness_test.go @@ -44,15 +44,15 @@ func testSendOutputs(r *Harness, t *testing.T) { t.Fatalf("unable to get block: %v", err) } - numBlockTxns := len(block.Transactions()) + numBlockTxns := len(block.Transactions) if numBlockTxns < 2 { t.Fatalf("crafted transaction wasn't mined, block should have "+ "at least %v transactions instead has %v", 2, numBlockTxns) } - minedTx := block.Transactions()[1] - txHash := minedTx.Hash() - if *txHash != *txid { + minedTx := block.Transactions[1] + txHash := minedTx.TxHash() + if txHash != *txid { t.Fatalf("txid's don't match, %v vs %v", txHash, txid) } }