tsstest

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHost

func NewHost(i int) (host.Host, error)

func SetupCommunication

func SetupCommunication(commMap map[peer.ID]*TestCommunication)

Types

type CoordinatorTestSuite

type CoordinatorTestSuite struct {
	suite.Suite
	GomockController  *gomock.Controller
	MockECDSAStorer   *mock_tss.MockECDSAKeyshareStorer
	MockCommunication *mock_comm.MockCommunication
	MockTssProcess    *mock_tss.MockTssProcess

	Hosts       []host.Host
	Threshold   int
	PartyNumber int
	BullyConfig relayer.BullyConfig
}

func (*CoordinatorTestSuite) SetupTest

func (s *CoordinatorTestSuite) SetupTest()

type Receiver

type Receiver interface {
	ReceiveMessage(msg *comm.WrappedMessage, topic comm.MessageType, sessionID string)
}

type TestCommunication

type TestCommunication struct {
	Host               host.Host
	Subscriptions      map[comm.SubscriptionID]chan *comm.WrappedMessage
	PeerCommunications map[string]Receiver
	// contains filtered or unexported fields
}

func (*TestCommunication) Broadcast

func (tc *TestCommunication) Broadcast(
	peers peer.IDSlice,
	msg []byte,
	msgType comm.MessageType,
	sessionID string,
) error

func (*TestCommunication) CloseSession

func (ts *TestCommunication) CloseSession(sessionID string)

func (*TestCommunication) ReceiveMessage

func (ts *TestCommunication) ReceiveMessage(msg *comm.WrappedMessage, topic comm.MessageType, sessionID string)

func (*TestCommunication) Subscribe

func (ts *TestCommunication) Subscribe(
	sessionID string,
	topic comm.MessageType,
	channel chan *comm.WrappedMessage,
) comm.SubscriptionID

func (*TestCommunication) UnSubscribe

func (ts *TestCommunication) UnSubscribe(subscriptionID comm.SubscriptionID)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL