From 25520b40ad29c351a5aa4a37e3ab6b1c72b67408 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 28 Aug 2016 17:52:27 -0500 Subject: [PATCH] rpctest: Update for removal of wire.BlockVersion This adds constant for the block version to the rpctest package since it is no longer available via the wire package due to the new BIP0009 code. --- rpctest/rpc_harness.go | 6 +++++- rpctest/rpc_harness_test.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rpctest/rpc_harness.go b/rpctest/rpc_harness.go index 26074da2..3a97b6c5 100644 --- a/rpctest/rpc_harness.go +++ b/rpctest/rpc_harness.go @@ -30,6 +30,10 @@ const ( maxPeerPort = 35000 minRPCPort = maxPeerPort maxRPCPort = 60000 + + // BlockVersion is the default block version used when generating + // blocks. + BlockVersion = 4 ) var ( @@ -377,7 +381,7 @@ func (h *Harness) GenerateAndSubmitBlock(txns []*btcutil.Tx, blockVersion int32, defer h.Unlock() if blockVersion == -1 { - blockVersion = wire.BlockVersion + blockVersion = BlockVersion } prevBlockHash, prevBlockHeight, err := h.Node.GetBestBlock() diff --git a/rpctest/rpc_harness_test.go b/rpctest/rpc_harness_test.go index b1048b91..c3fc18b4 100644 --- a/rpctest/rpc_harness_test.go +++ b/rpctest/rpc_harness_test.go @@ -363,9 +363,9 @@ func testGenerateAndSubmitBlock(r *Harness, t *testing.T) { "expected %v, got %v", numTxns+1, numBlocksTxns) } blockVersion := block.MsgBlock().Header.Version - if blockVersion != wire.BlockVersion { + if blockVersion != BlockVersion { t.Fatalf("block version is not default: expected %v, got %v", - wire.BlockVersion, blockVersion) + BlockVersion, blockVersion) } // Next generate a block with a "non-standard" block version along with