Re-add TestPruningDepth (#1132)

This commit is contained in:
Elichai Turkel 2020-11-22 17:04:13 +02:00 committed by GitHub
parent b3a3121725
commit c56a5336f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,25 @@
package consensus
import (
"github.com/kaspanet/kaspad/domain/consensus/utils/testutils"
"github.com/kaspanet/kaspad/domain/dagconfig"
"testing"
)
func TestPruningDepth(t *testing.T) {
expectedResult := map[string]uint64{
"kaspa-mainnet": 244838,
"kaspa-testnet": 244838,
"kaspa-devnet": 244838,
"kaspa-simnet": 192038,
}
testutils.ForAllNets(t, true, func(t *testing.T, params *dagconfig.Params) {
expected, found := expectedResult[params.Name]
if !found {
t.Fatalf("TestPruningDepth: expectedResult doesn't contain '%s'", params.Name)
}
if params.PruningDepth() != expected {
t.Errorf("pruningDepth in %s is expected to be %d but got %d", params.Name, expected, params.PruningDepth())
}
})
}