common

package
v0.0.0-...-f9c6c1d Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMsgID

func CalculateMsgID(msg *big.Int) string

func CreatePartyID

func CreatePartyID(peerID string) *tss.PartyID

func ExcludePeer

func ExcludePeer(peers peer.IDSlice, excluded peer.ID) peer.IDSlice

func GetParties

func GetParties(peers peer.IDSlice) tss.SortedPartyIDs

func GetPeersFromParties

func GetPeersFromParties(parties []*tss.PartyID) []peer.ID

func IsParticipant

func IsParticipant(party *tss.PartyID, parties tss.SortedPartyIDs) bool

func MarhsalInitiateMessage

func MarhsalInitiateMessage(sessionID string, process string) ([]byte, error)

func MarshalStartSignMessage

func MarshalStartSignMessage(peers []peer.ID, msg *big.Int) ([]byte, error)

func MarshalTssMessage

func MarshalTssMessage(msgBytes []byte, isBrodcast bool, from string) ([]byte, error)

Types

type BaseTss

type BaseTss struct {
	Host          host.Host
	SessionID     string
	PartyID       *tss.PartyID
	Party         tss.Party
	PartyStore    map[string]*tss.PartyID
	Communication p2p.Communication
	Peers         []peer.ID
}

func (*BaseTss) IsParticipant

func (tss *BaseTss) IsParticipant(parties tss.SortedPartyIDs) bool

func (*BaseTss) PopulatePartyStore

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

func (*BaseTss) ProcessInboundMessages

func (tss *BaseTss) ProcessInboundMessages(msgChan chan *p2p.WrappedMessage)

ProcessInboundMessages listens to incoming messages and updates TSS process state.

func (*BaseTss) ProcessOutboundMessages

func (tss *BaseTss) ProcessOutboundMessages(outChn chan tss.Message, messageType p2p.MessageType)

ProcessOutboundMessages listens to messages sent into channel by TSS process and sends them to corresponding peers.

func (*BaseTss) Start

func (tss *BaseTss) Start() error

type InitiateMessage

type InitiateMessage struct {
	SessionID string `json:"sessionID"`
	Process   string `json:"process"`
}

func UnmarshalInitiateMessage

func UnmarshalInitiateMessage(msgBytes []byte) (*InitiateMessage, error)

type StartSignMessage

type StartSignMessage struct {
	Peers []peer.ID `json:"peers"`
	Msg   *big.Int  `json:"msg"`
}

func UnmarshalStartSignMessage

func UnmarshalStartSignMessage(msgBytes []byte) (*StartSignMessage, error)

type TssMessage

type TssMessage struct {
	MsgBytes   []byte `json:"msgBytes"`
	From       string `json:"from"`
	IsBrodcast bool   `json:"isBrodcast"`
}

func UnmarshalTssMessage

func UnmarshalTssMessage(msgBytes []byte) (*TssMessage, error)

Jump to

Keyboard shortcuts

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