mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
refactor tests
This commit is contained in:
parent
623d1ecf12
commit
4dc6651147
3 changed files with 4 additions and 4 deletions
|
|
@ -38,7 +38,7 @@ func TestValidatorsBlockProduction(t *testing.T) {
|
|||
)
|
||||
for i := 0; i < 2; i++ {
|
||||
// Start the node and wait until it's up
|
||||
stack, ethBackend, err := InitMiner(genesis, keys[i])
|
||||
stack, ethBackend, err := InitMiner(genesis, keys[i], true)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ func TestValidatorWentOffline(t *testing.T) {
|
|||
)
|
||||
for i := 0; i < 2; i++ {
|
||||
// Start the node and wait until it's up
|
||||
stack, ethBackend, err := InitMiner(genesis, keys[i])
|
||||
stack, ethBackend, err := InitMiner(genesis, keys[i], true)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ func IsSprintEnd(number uint64) bool {
|
|||
return (number+1)%sprintSize == 0
|
||||
}
|
||||
|
||||
func InitMiner(genesis *core.Genesis, privKey *ecdsa.PrivateKey) (*node.Node, *eth.Ethereum, error) {
|
||||
func InitMiner(genesis *core.Genesis, privKey *ecdsa.PrivateKey, withoutHeimdall bool) (*node.Node, *eth.Ethereum, error) {
|
||||
// Define the basic configurations for the Ethereum node
|
||||
datadir, _ := ioutil.TempDir("", "")
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ func InitMiner(genesis *core.Genesis, privKey *ecdsa.PrivateKey) (*node.Node, *e
|
|||
GasPrice: big.NewInt(1),
|
||||
Recommit: time.Second,
|
||||
},
|
||||
WithoutHeimdall: true,
|
||||
WithoutHeimdall: withoutHeimdall,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
|
|||
Loading…
Reference in a new issue