Ori Newman 8500acd86b
[NOD-1548] Remove PoW check from tests (#1105)
* [NOD-1548] Add TestDifficulty and remove PoW check from tests

* [NOD-1548] Add TestSkipProofOfWork

* [NOD-1548] Remove TestDifficulty
2020-11-18 10:27:29 +02:00

25 lines
645 B
Go

package testutils
import (
"testing"
"github.com/kaspanet/kaspad/domain/dagconfig"
)
// ForAllNets runs the passed testFunc with all available networks
// if setDifficultyToMinumum = true - will modify the net params to have minimal difficulty, like in SimNet
func ForAllNets(t *testing.T, skipPow bool, testFunc func(*testing.T, *dagconfig.Params)) {
allParams := []dagconfig.Params{
dagconfig.MainnetParams,
dagconfig.TestnetParams,
dagconfig.SimnetParams,
dagconfig.DevnetParams,
}
for _, params := range allParams {
params.SkipProofOfWork = skipPow
t.Logf("Running test for %s", params.Name)
testFunc(t, &params)
}
}