From fa4ad5f6e787fbc69484c5249c5932f70309f9e4 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 16 Mar 2021 18:44:14 +0100 Subject: return cosigned sth regardless of cosignature count --- sth.go | 2 +- sth_test.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sth.go b/sth.go index 30ba965..ee4dd2f 100644 --- a/sth.go +++ b/sth.go @@ -102,7 +102,7 @@ func (s *ActiveSthSource) Stable(_ context.Context) (*types.StItem, error) { func (s *ActiveSthSource) Cosigned(_ context.Context) (*types.StItem, error) { s.mutex.RLock() defer s.mutex.RUnlock() - if s.currCosth == nil || len(s.currCosth.CosignedTreeHeadV1.Cosignatures) == 0 { + if s.currCosth == nil { return nil, fmt.Errorf("no cosigned sth available") } return s.currCosth, nil diff --git a/sth_test.go b/sth_test.go index a75ca5f..0942ea1 100644 --- a/sth_test.go +++ b/sth_test.go @@ -162,13 +162,6 @@ func TestCosigned(t *testing.T) { source: &ActiveSthSource{}, wantErr: true, }, - { - description: "invalid: no cosigned sth: nil signatures", - source: &ActiveSthSource{ - currCosth: testdata.DefaultCosth(t, testdata.Ed25519VkLog, nil), - }, - wantErr: true, - }, { description: "valid", source: &ActiveSthSource{ -- cgit v1.2.3