mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-25 00:06:49 +00:00

* [NOD-1548] Add TestDifficulty and remove PoW check from tests * [NOD-1548] Add TestSkipProofOfWork * [NOD-1548] Remove TestDifficulty
25 lines
645 B
Go
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, ¶ms)
|
|
}
|
|
}
|