Skip to content

Commit

Permalink
Revert resharing_test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Aug 28, 2024
1 parent 5b99ef8 commit 6123121
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tss/frost/resharing/resharing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/sourcegraph/conc/pool"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"
)

type ResharingTestSuite struct {
Expand Down Expand Up @@ -52,7 +53,12 @@ func (s *ResharingTestSuite) Test_ValidResharingProcess_OldAndNewSubset() {
}
communicationMap[host.ID()] = &communication
storer := keyshare.NewFrostKeyshareStore(fmt.Sprintf("../../test/keyshares/%d-frost.keyshare", i))
resharing := resharing.NewResharing("resharing2", "", 1, host, &communication, storer)
share, err := storer.GetKeyshare("")
s.MockFrostStorer.EXPECT().LockKeyshare()
s.MockFrostStorer.EXPECT().UnlockKeyshare()
s.MockFrostStorer.EXPECT().GetKeyshare("").Return(share, err)
s.MockFrostStorer.EXPECT().StoreKeyshare(gomock.Any()).Return(nil)
resharing := resharing.NewResharing("resharing2", "", 1, host, &communication, s.MockFrostStorer)
electorFactory := elector.NewCoordinatorElectorFactory(host, s.BullyConfig)
coordinators = append(coordinators, tss.NewCoordinator(host, &communication, electorFactory))
processes = append(processes, resharing)
Expand Down Expand Up @@ -94,7 +100,12 @@ func (s *ResharingTestSuite) Test_ValidResharingProcess_RemovePeer() {
}
communicationMap[host.ID()] = &communication
storer := keyshare.NewFrostKeyshareStore(fmt.Sprintf("../../test/keyshares/%d-frost.keyshare", i))
resharing := resharing.NewResharing("resharing2", "", 1, host, &communication, storer)
share, err := storer.GetKeyshare("")
s.MockFrostStorer.EXPECT().LockKeyshare()
s.MockFrostStorer.EXPECT().UnlockKeyshare()
s.MockFrostStorer.EXPECT().GetKeyshare("").Return(share, err)
s.MockFrostStorer.EXPECT().StoreKeyshare(gomock.Any()).Return(nil)
resharing := resharing.NewResharing("resharing2", "", 1, host, &communication, s.MockFrostStorer)
electorFactory := elector.NewCoordinatorElectorFactory(host, s.BullyConfig)
coordinators = append(coordinators, tss.NewCoordinator(host, &communication, electorFactory))
processes = append(processes, resharing)
Expand Down

0 comments on commit 6123121

Please sign in to comment.