diff --git a/cmd/combine/combine.go b/cmd/combine/combine.go index 6142d25ad..ed25a5224 100644 --- a/cmd/combine/combine.go +++ b/cmd/combine/combine.go @@ -88,11 +88,11 @@ func Combine(ctx context.Context, inputDir, outputDir string, force, noverify bo for valIdx := 0; valIdx < len(privkeys); valIdx++ { pkSet := privkeys[valIdx] - if len(pkSet) != len(cluster.Operators) { + if len(pkSet) < int(cluster.Threshold) { return errors.New( - "not all private key shares found for validator", + "insufficient private key shares found for validator", z.Int("validator_index", valIdx), - z.Int("expected", len(cluster.Operators)), + z.Int("expected", int(cluster.Threshold)), z.Int("actual", len(pkSet)), ) } diff --git a/cmd/combine/combine_test.go b/cmd/combine/combine_test.go index c655df9a1..75ed2281e 100644 --- a/cmd/combine/combine_test.go +++ b/cmd/combine/combine_test.go @@ -85,9 +85,10 @@ func TestCombineCannotLoadKeystore(t *testing.T) { } require.NoError(t, os.RemoveAll(filepath.Join(dir, "node0"))) + require.NoError(t, os.RemoveAll(filepath.Join(dir, "node1"))) err := combine.Combine(context.Background(), dir, od, false, false, combine.WithInsecureKeysForT(t)) - require.Error(t, err) + require.ErrorContains(t, err, "insufficient private key shares found for validator") } func TestCombineAllManifest(t *testing.T) {