Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/partition_description.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (pdr *PartitionDescriptionRecord) IsValid() error {
if pdr.UnitIDLen%8 != 0 {
return fmt.Errorf("unit id length must be in full bytes, got %d bytes and %d bits", pdr.UnitIDLen/8, pdr.UnitIDLen%8)
}
if pdr.T2Timeout < 800*time.Millisecond || pdr.T2Timeout > 10*time.Second {
if pdr.T2Timeout < 800*time.Millisecond {
return fmt.Errorf("t2 timeout value out of allowed range: %s", pdr.T2Timeout)
}

Expand Down
5 changes: 3 additions & 2 deletions types/partition_description_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"testing"
"time"

abcrypto "github.com/unicitynetwork/bft-go-base/crypto"
"github.com/stretchr/testify/require"

abcrypto "github.com/unicitynetwork/bft-go-base/crypto"
)

func Test_PartitionDescriptionRecord_Hash(t *testing.T) {
Expand Down Expand Up @@ -114,7 +115,7 @@ func Test_PartitionDescriptionRecord_IsValid(t *testing.T) {
require.EqualError(t, pdr.IsValid(), "t2 timeout value out of allowed range: 499ms")

pdr.T2Timeout = 2 * time.Minute
require.EqualError(t, pdr.IsValid(), "t2 timeout value out of allowed range: 2m0s")
require.NoError(t, pdr.IsValid())
})

t.Run("invalid validator", func(t *testing.T) {
Expand Down
Loading