refactor tests

This commit is contained in:
Arpit Temani 2022-09-22 14:31:44 +05:30
parent 623d1ecf12
commit 4dc6651147
3 changed files with 4 additions and 4 deletions

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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