|
|
|
@ -99,6 +99,7 @@ func (bc *testBlockChain) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestMiner(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, mux, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
|
|
|
|
@ -128,6 +129,7 @@ func TestMiner(t *testing.T) { |
|
|
|
|
// An initial FailedEvent should allow mining to stop on a subsequent
|
|
|
|
|
// downloader StartEvent.
|
|
|
|
|
func TestMinerDownloaderFirstFails(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, mux, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
|
|
|
|
@ -161,6 +163,7 @@ func TestMinerDownloaderFirstFails(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestMinerStartStopAfterDownloaderEvents(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, mux, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
|
|
|
|
@ -185,6 +188,7 @@ func TestMinerStartStopAfterDownloaderEvents(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestStartWhileDownload(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, mux, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
waitForMiningState(t, miner, false) |
|
|
|
@ -199,6 +203,7 @@ func TestStartWhileDownload(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestStartStopMiner(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, _, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
waitForMiningState(t, miner, false) |
|
|
|
@ -209,6 +214,7 @@ func TestStartStopMiner(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestCloseMiner(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, _, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(true) |
|
|
|
|
waitForMiningState(t, miner, false) |
|
|
|
@ -222,6 +228,7 @@ func TestCloseMiner(t *testing.T) { |
|
|
|
|
// TestMinerSetEtherbase checks that etherbase becomes set even if mining isn't
|
|
|
|
|
// possible at the moment
|
|
|
|
|
func TestMinerSetEtherbase(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
miner, mux, cleanup := createMiner(t) |
|
|
|
|
defer cleanup(false) |
|
|
|
|
miner.Start() |
|
|
|
|