common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePartyID

func CreatePartyID(peerID string) *tss.PartyID

func ExcludePeers

func ExcludePeers(peers peer.IDSlice, excludedPeers peer.IDSlice) peer.IDSlice

func PartiesFromPeers

func PartiesFromPeers(peers peer.IDSlice) tss.SortedPartyIDs

func PeersFromIDS

func PeersFromIDS(peerIDS []string) ([]peer.ID, error)

func PeersFromParties

func PeersFromParties(parties []*tss.PartyID) ([]peer.ID, error)

func PeersIntersection

func PeersIntersection(oldPeers peer.IDSlice, newPeers peer.IDSlice) peer.IDSlice

Types

type BaseTss

type BaseTss struct {
	Host          host.Host
	SID           string
	Party         Party
	PartyStore    map[string]*tss.PartyID
	Communication comm.Communication
	Peers         []peer.ID
	Log           zerolog.Logger

	Cancel context.CancelFunc
}

BaseTss contains common variables and methods to all tss processes.

func (*BaseTss) BroadcastPeers

func (b *BaseTss) BroadcastPeers(msg tss.Message) ([]peer.ID, error)

BroccastPeers returns peers that should receive the tss message

func (*BaseTss) PopulatePartyStore

func (b *BaseTss) PopulatePartyStore(parties tss.SortedPartyIDs)

PopulatePartyStore populates party store map with sorted parties for mapping message senders to parties

func (*BaseTss) ProcessInboundMessages

func (b *BaseTss) ProcessInboundMessages(ctx context.Context, msgChan chan *comm.WrappedMessage) (err error)

ProcessInboundMessages processes messages from tss parties and updates local party accordingly.

func (*BaseTss) ProcessOutboundMessages

func (b *BaseTss) ProcessOutboundMessages(ctx context.Context, outChn chan tss.Message, messageType comm.MessageType) error

ProcessOutboundMessages sends messages received from tss out channel to target peers. On context cancel stops listening to channel and exits.

func (*BaseTss) SessionID

func (b *BaseTss) SessionID() string

type Party

type Party interface {
	UpdateFromBytes(wireBytes []byte, from *tss.PartyID, isBroadcast bool, sessionID *big.Int) (bool, *tss.Error)
	Start() *tss.Error
	WaitingFor() []*tss.PartyID
}

Directories

Path Synopsis
Package mock_tss is a generated GoMock package.
Package mock_tss is a generated GoMock package.

Jump to

Keyboard shortcuts

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