2015-05-01 08:28:01 +02:00
|
|
|
// Copyright (c) 2013-2014 The btcsuite developers
|
2013-07-18 16:49:28 +02:00
|
|
|
// Use of this source code is governed by an ISC
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
/*
|
2015-01-30 21:54:30 +01:00
|
|
|
This test file is part of the blockchain package rather than than the
|
|
|
|
blockchain_test package so it can bridge access to the internals to properly
|
|
|
|
test cases which are either not possible or can't reliably be tested via the
|
|
|
|
public interface. The functions are only exported while the tests are being
|
|
|
|
run.
|
2013-07-18 16:49:28 +02:00
|
|
|
*/
|
|
|
|
|
2015-01-30 21:54:30 +01:00
|
|
|
package blockchain
|
2013-07-18 16:49:28 +02:00
|
|
|
|
|
|
|
import (
|
2014-10-11 20:30:08 +02:00
|
|
|
"sort"
|
2013-07-18 17:06:35 +02:00
|
|
|
"time"
|
2013-07-18 16:49:28 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// TstSetCoinbaseMaturity makes the ability to set the coinbase maturity
|
|
|
|
// available to the test package.
|
2015-08-08 04:20:49 +02:00
|
|
|
func TstSetCoinbaseMaturity(maturity int32) {
|
2013-07-18 16:49:28 +02:00
|
|
|
coinbaseMaturity = maturity
|
|
|
|
}
|
2013-07-18 17:06:35 +02:00
|
|
|
|
|
|
|
// TstTimeSorter makes the internal timeSorter type available to the test
|
|
|
|
// package.
|
2014-10-11 20:30:08 +02:00
|
|
|
func TstTimeSorter(times []time.Time) sort.Interface {
|
2013-07-18 17:06:35 +02:00
|
|
|
return timeSorter(times)
|
|
|
|
}
|
2013-10-06 20:01:54 +02:00
|
|
|
|
|
|
|
// TstCheckSerializedHeight makes the internal checkSerializedHeight function
|
|
|
|
// available to the test package.
|
2015-01-08 12:08:11 +01:00
|
|
|
var TstCheckSerializedHeight = checkSerializedHeight
|
2014-10-10 08:11:39 +02:00
|
|
|
|
|
|
|
// TstSetMaxMedianTimeEntries makes the ability to set the maximum number of
|
|
|
|
// median tiem entries available to the test package.
|
|
|
|
func TstSetMaxMedianTimeEntries(val int) {
|
|
|
|
maxMedianTimeEntries = val
|
|
|
|
}
|
2015-01-08 12:08:11 +01:00
|
|
|
|
|
|
|
// TstCheckBlockScripts makes the internal checkBlockScripts function available
|
|
|
|
// to the test package.
|
|
|
|
var TstCheckBlockScripts = checkBlockScripts
|