mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 00:43:46 +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++ {
|
for i := 0; i < 2; i++ {
|
||||||
// Start the node and wait until it's up
|
// 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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ func TestValidatorWentOffline(t *testing.T) {
|
||||||
)
|
)
|
||||||
for i := 0; i < 2; i++ {
|
for i := 0; i < 2; i++ {
|
||||||
// Start the node and wait until it's up
|
// 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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ func IsSprintEnd(number uint64) bool {
|
||||||
return (number+1)%sprintSize == 0
|
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
|
// Define the basic configurations for the Ethereum node
|
||||||
datadir, _ := ioutil.TempDir("", "")
|
datadir, _ := ioutil.TempDir("", "")
|
||||||
|
|
||||||
|
|
@ -402,7 +402,7 @@ func InitMiner(genesis *core.Genesis, privKey *ecdsa.PrivateKey) (*node.Node, *e
|
||||||
GasPrice: big.NewInt(1),
|
GasPrice: big.NewInt(1),
|
||||||
Recommit: time.Second,
|
Recommit: time.Second,
|
||||||
},
|
},
|
||||||
WithoutHeimdall: true,
|
WithoutHeimdall: withoutHeimdall,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue