b3a5b3b576
TestChainNotifier wraps the ChainNotifier interface to allow adding additional testing methods with access to private fields in the notifiers. These testing methods are only compiled when the build tag "debug" is set. UnsafeStart allows starting a notifier with a specified best block. UnsafeStart is useful for the purpose of testing cases where a notifier's best block is out of date when it receives a new block.
14 lines
395 B
Go
14 lines
395 B
Go
package chainntnfs
|
|
|
|
import "github.com/btcsuite/btcd/chaincfg/chainhash"
|
|
|
|
// TestChainNotifier enables the use of methods that are only present during
|
|
// testing for ChainNotifiers.
|
|
type TestChainNotifier interface {
|
|
ChainNotifier
|
|
|
|
// UnsafeStart enables notifiers to start up with a specific best block.
|
|
// Used for testing.
|
|
UnsafeStart(int32, *chainhash.Hash, int32, func() error) error
|
|
}
|