tss

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_protob_message_proto protoreflect.FileDescriptor

Functions

func BaseStart

func BaseStart(p Party, task string, prepare ...func(Round) error) error

BaseStart initializes and starts the first round of a party's protocol execution.

func BaseUpdate

func BaseUpdate(p Party, msg ParsedMessage, task string) (ok bool, err error)

an implementation of Update that is shared across the different types of parties (keygen, signing, dynamic groups)

func EC

func EC() elliptic.Curve

EC returns the current elliptic curve in use. The default is secp256k1

func Edwards

func Edwards() elliptic.Curve

Edwards returns the Ed25519 twisted Edwards elliptic curve.

func GetCurveByName

func GetCurveByName(name CurveName) (elliptic.Curve, bool)

return curve, exist(bool)

func JsonGet added in v2.1.2

func JsonGet[T any](j *JsonMessage) (*T, error)

JsonGet returns the object included in a JsonMessage if it is of the given type, or will unmarshal to said type if the message was just recieved

func NewTestBroker added in v2.1.2

func NewTestBroker() *testBroker

NewTestBroker creates a simple in-memory message broker for testing purposes.

func RegisterCurve

func RegisterCurve(name CurveName, curve elliptic.Curve)

RegisterCurve registers an elliptic curve under the given name in the global curve registry.

func S256

func S256() elliptic.Curve

S256 returns the secp256k1 elliptic curve.

func SameCurve

func SameCurve(lhs, rhs elliptic.Curve) bool

SameCurve returns true if both lhs and rhs are the same known curve

func SetCurve

func SetCurve(curve elliptic.Curve)

SetCurve sets the curve used by TSS. Must be called before Start. The default is secp256k1 Deprecated

Types

type BaseParty

type BaseParty struct {
	FirstRound Round
	// contains filtered or unexported fields
}

BaseParty provides a base implementation of the Party interface with shared state and lifecycle management.

func (*BaseParty) Running

func (p *BaseParty) Running() bool

Running returns true if the party has started and a round is currently set.

func (*BaseParty) String

func (p *BaseParty) String() string

String returns a human-readable representation of the party's current round state.

func (*BaseParty) ValidateMessage

func (p *BaseParty) ValidateMessage(msg ParsedMessage) (bool, error)

an implementation of ValidateMessage that is shared across the different types of parties (keygen, signing, dynamic groups)

func (*BaseParty) WaitingFor

func (p *BaseParty) WaitingFor() []*PartyID

WaitingFor returns the list of party IDs from whom messages are still expected in the current round.

func (*BaseParty) WrapError

func (p *BaseParty) WrapError(err error, culprits ...*PartyID) error

WrapError wraps an error with contextual information about the current round and any culprit parties.

type CurveName

type CurveName string

CurveName is a string identifier for an elliptic curve used in TSS operations.

const (
	// Secp256k1 is the curve name for the secp256k1 elliptic curve.
	Secp256k1 CurveName = "secp256k1"
	// Ed25519 is the curve name for the Ed25519 twisted Edwards curve.
	Ed25519 CurveName = "ed25519"
)

func GetCurveName

func GetCurveName(curve elliptic.Curve) (CurveName, bool)

return name, exist(bool)

type Error

type Error struct {
	// contains filtered or unexported fields
}

fundamental is an error that has a message and a stack, but no caller.

func NewError

func NewError(err error, task string, round int, victim *PartyID, culprits ...*PartyID) *Error

NewError creates a new Error with the given cause, task name, round number, victim, and optional culprits.

func (*Error) Cause

func (err *Error) Cause() error

Cause returns the underlying error that caused this Error.

func (*Error) Culprits

func (err *Error) Culprits() []*PartyID

Culprits returns the list of party IDs responsible for causing the error.

func (*Error) Error

func (err *Error) Error() string

Error returns a formatted string representation of the error including task, round, and culprit details.

func (*Error) Round

func (err *Error) Round() int

Round returns the round number during which the error occurred.

func (*Error) Task

func (err *Error) Task() string

Task returns the name of the task during which the error occurred.

func (*Error) Unwrap

func (err *Error) Unwrap() error

Unwrap returns the underlying cause of the error, implementing the errors.Unwrap interface.

func (*Error) Victim

func (err *Error) Victim() *PartyID

Victim returns the PartyID of the party that encountered the error.

type ErrorParty added in v2.1.2

type ErrorParty struct {
	Err error
}

ErrorParty is an object that looks like a Party but will always return error Useful to return an error when a tss.Party is expected

func (ErrorParty) FirstRound added in v2.1.2

func (e ErrorParty) FirstRound() Round

func (ErrorParty) PartyID added in v2.1.2

func (e ErrorParty) PartyID() *PartyID

func (ErrorParty) Running added in v2.1.2

func (e ErrorParty) Running() bool

func (ErrorParty) Start added in v2.1.2

func (e ErrorParty) Start() error

func (ErrorParty) StoreMessage added in v2.1.2

func (e ErrorParty) StoreMessage(msg ParsedMessage) (bool, error)

func (ErrorParty) String added in v2.1.2

func (e ErrorParty) String() string

func (ErrorParty) Update added in v2.1.2

func (e ErrorParty) Update(msg ParsedMessage) (ok bool, err error)

func (ErrorParty) UpdateFromBytes added in v2.1.2

func (e ErrorParty) UpdateFromBytes(wireBytes []byte, from *PartyID, isBroadcast bool) (ok bool, err error)

func (ErrorParty) ValidateMessage added in v2.1.2

func (e ErrorParty) ValidateMessage(msg ParsedMessage) (bool, error)

func (ErrorParty) WaitingFor added in v2.1.2

func (e ErrorParty) WaitingFor() []*PartyID

func (ErrorParty) WrapError added in v2.1.2

func (e ErrorParty) WrapError(err error, culprits ...*PartyID) error

type JsonMessage added in v2.1.2

type JsonMessage struct {
	Type string   `json:"type"`
	From *PartyID `json:"from"`
	To   *PartyID `json:"to"`
	Data any      `json:"data"`
}

JsonMessage is an object storing any kind of object for json transmission

func JsonWrap added in v2.1.2

func JsonWrap(typ string, o any, from *PartyID, to *PartyID) *JsonMessage

Jsonwrap wraps any object into a JsonMessage for transmission

func (*JsonMessage) UnmarshalJSON added in v2.1.2

func (j *JsonMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON will set Type to the right value, and Data to a json.RawMessage of the actual data

type Message

type Message interface {
	// Type is encoded in the protobuf Any structure
	Type() string
	// The set of parties that this message should be sent to
	GetTo() []*PartyID
	// The party that this message is from
	GetFrom() *PartyID
	// Indicates whether the message should be broadcast to other participants
	IsBroadcast() bool
	// Indicates whether the message is to the old committee during re-sharing; used mainly in tests
	IsToOldCommittee() bool
	// Indicates whether the message is to both committees during re-sharing; used mainly in tests
	IsToOldAndNewCommittees() bool
	// Returns the encoded inner message bytes to send over the wire along with metadata about how the message should be delivered
	WireBytes() ([]byte, *MessageRouting, error)
	// Returns the protobuf message wrapper struct
	// Only its inner content should be sent over the wire, not this struct itself
	WireMsg() *MessageWrapper
	String() string
}

Message describes the interface of the TSS Message for all protocols

type MessageBroker added in v2.1.2

type MessageBroker interface {
	MessageReceiver
	Connect(typ string, dest MessageReceiver)
}

MessageBroker extends MessageReceiver with the ability to connect message handlers by type.

type MessageContent

type MessageContent interface {
	proto.Message
	ValidateBasic() bool
}

MessageContent represents a ProtoBuf message with validation logic

type MessageImpl

type MessageImpl struct {
	MessageRouting
	// contains filtered or unexported fields
}

Implements ParsedMessage; this is a concrete implementation of what messages produced by a LocalParty look like

func (*MessageImpl) Content

func (mm *MessageImpl) Content() MessageContent

Content returns the inner protobuf MessageContent of this message.

func (*MessageImpl) GetFrom

func (mm *MessageImpl) GetFrom() *PartyID

GetFrom returns the PartyID of the sender of this message.

func (*MessageImpl) GetTo

func (mm *MessageImpl) GetTo() []*PartyID

GetTo returns the list of destination party IDs for this message, or nil for broadcast.

func (*MessageImpl) IsBroadcast

func (mm *MessageImpl) IsBroadcast() bool

IsBroadcast returns true if this message should be broadcast to all parties.

func (*MessageImpl) IsToOldAndNewCommittees

func (mm *MessageImpl) IsToOldAndNewCommittees() bool

only `true` in DGRound4Message (resharing)

func (*MessageImpl) IsToOldCommittee

func (mm *MessageImpl) IsToOldCommittee() bool

only `true` in DGRound2Message (resharing)

func (*MessageImpl) String

func (mm *MessageImpl) String() string

String returns a human-readable representation of the message including type, sender, and recipients.

func (*MessageImpl) Type

func (mm *MessageImpl) Type() string

Type returns the protobuf message type name of the inner content.

func (*MessageImpl) ValidateBasic

func (mm *MessageImpl) ValidateBasic() bool

ValidateBasic validates the inner message content.

func (*MessageImpl) WireBytes

func (mm *MessageImpl) WireBytes() ([]byte, *MessageRouting, error)

WireBytes returns the marshaled inner message bytes and routing metadata for wire transmission.

func (*MessageImpl) WireMsg

func (mm *MessageImpl) WireMsg() *MessageWrapper

WireMsg returns the protobuf MessageWrapper struct for this message.

type MessageReceiver added in v2.1.2

type MessageReceiver interface {
	Receive(msg *JsonMessage) error
}

MessageReceiver defines an interface for receiving JSON messages.

func NewJsonExpect added in v2.1.2

func NewJsonExpect[T any](typ string, parties []*PartyID, cb func([]*PartyID, []*T)) MessageReceiver

NewJsonExpect returns a new MessageReceiver of the given type that can be used to collect packets from multiple parties, and trigger a callback once everything has been collected

type MessageRouting

type MessageRouting struct {
	// which participant this message came from
	From *PartyID
	// when `nil` the message should be broadcast to all parties
	To []*PartyID
	// whether the message should be broadcast to other participants
	IsBroadcast bool
	// whether the message should be sent to old committee participants rather than the new committee
	IsToOldCommittee bool
	// whether the message should be sent to both old and new committee participants
	IsToOldAndNewCommittees bool
}

MessageRouting holds the full routing information for the message, consumed by the transport

type MessageWrapper

type MessageWrapper struct {

	// Metadata optionally un-marshalled and used by the transport to route this message.
	IsBroadcast bool `protobuf:"varint,1,opt,name=is_broadcast,json=isBroadcast,proto3" json:"is_broadcast,omitempty"`
	// Metadata optionally un-marshalled and used by the transport to route this message.
	IsToOldCommittee bool `protobuf:"varint,2,opt,name=is_to_old_committee,json=isToOldCommittee,proto3" json:"is_to_old_committee,omitempty"` // used only in certain resharing messages
	// Metadata optionally un-marshalled and used by the transport to route this message.
	IsToOldAndNewCommittees bool `` // used only in certain resharing messages
	/* 139-byte string literal not displayed */
	// Metadata optionally un-marshalled and used by the transport to route this message.
	From *MessageWrapper_PartyID `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
	// Metadata optionally un-marshalled and used by the transport to route this message.
	To []*MessageWrapper_PartyID `protobuf:"bytes,4,rep,name=to,proto3" json:"to,omitempty"`
	// This field is actually what is sent through the wire and consumed on the other end by UpdateFromBytes.
	// An Any contains an arbitrary serialized message as bytes, along with a URL that
	// acts as a globally unique identifier for and resolves to that message's type.
	Message *anypb.Any `protobuf:"bytes,10,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Wrapper for TSS messages, often read by the transport layer and not itself sent over the wire

func NewMessageWrapper

func NewMessageWrapper(routing MessageRouting, content MessageContent) *MessageWrapper

NewMessageWrapper constructs a MessageWrapper from routing metadata and content

func (*MessageWrapper) Descriptor deprecated

func (*MessageWrapper) Descriptor() ([]byte, []int)

Deprecated: Use MessageWrapper.ProtoReflect.Descriptor instead.

func (*MessageWrapper) GetFrom

func (x *MessageWrapper) GetFrom() *MessageWrapper_PartyID

func (*MessageWrapper) GetIsBroadcast

func (x *MessageWrapper) GetIsBroadcast() bool

func (*MessageWrapper) GetIsToOldAndNewCommittees

func (x *MessageWrapper) GetIsToOldAndNewCommittees() bool

func (*MessageWrapper) GetIsToOldCommittee

func (x *MessageWrapper) GetIsToOldCommittee() bool

func (*MessageWrapper) GetMessage

func (x *MessageWrapper) GetMessage() *anypb.Any

func (*MessageWrapper) GetTo

func (x *MessageWrapper) GetTo() []*MessageWrapper_PartyID

func (*MessageWrapper) ProtoMessage

func (*MessageWrapper) ProtoMessage()

func (*MessageWrapper) ProtoReflect

func (x *MessageWrapper) ProtoReflect() protoreflect.Message

func (*MessageWrapper) Reset

func (x *MessageWrapper) Reset()

func (*MessageWrapper) String

func (x *MessageWrapper) String() string

type MessageWrapper_PartyID

type MessageWrapper_PartyID struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Moniker string `protobuf:"bytes,2,opt,name=moniker,proto3" json:"moniker,omitempty"`
	Key     []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

PartyID represents a participant in the TSS protocol rounds. Note: The `id` and `moniker` are provided for convenience to allow you to track participants easier. The `id` is intended to be a unique string representation of `key` and `moniker` can be anything (even left blank).

func (*MessageWrapper_PartyID) Descriptor deprecated

func (*MessageWrapper_PartyID) Descriptor() ([]byte, []int)

Deprecated: Use MessageWrapper_PartyID.ProtoReflect.Descriptor instead.

func (*MessageWrapper_PartyID) GetId

func (x *MessageWrapper_PartyID) GetId() string

func (*MessageWrapper_PartyID) GetKey

func (x *MessageWrapper_PartyID) GetKey() []byte

func (*MessageWrapper_PartyID) GetMoniker

func (x *MessageWrapper_PartyID) GetMoniker() string

func (*MessageWrapper_PartyID) KeyInt

func (mpid *MessageWrapper_PartyID) KeyInt() *big.Int

KeyInt returns the key as a *big.Int.

func (*MessageWrapper_PartyID) ProtoMessage

func (*MessageWrapper_PartyID) ProtoMessage()

func (*MessageWrapper_PartyID) ProtoReflect

func (x *MessageWrapper_PartyID) ProtoReflect() protoreflect.Message

func (*MessageWrapper_PartyID) Reset

func (x *MessageWrapper_PartyID) Reset()

func (*MessageWrapper_PartyID) String

func (x *MessageWrapper_PartyID) String() string

type Parameters

type Parameters struct {
	// contains filtered or unexported fields
}

Parameters holds the configuration for a TSS party, including curve, threshold, and peer information.

func NewParameters

func NewParameters(ec elliptic.Curve, ctx *PeerContext, partyID *PartyID, partyCount, threshold int) *Parameters

Exported, used in `tss` client

func (*Parameters) Broker added in v2.1.2

func (params *Parameters) Broker() MessageBroker

Broker returns the message broker used for routing messages between parties.

func (*Parameters) Concurrency

func (params *Parameters) Concurrency() int

Concurrency returns the concurrency level used for parallelizable operations.

func (*Parameters) EC

func (params *Parameters) EC() elliptic.Curve

EC returns the elliptic curve used by this set of parameters.

func (*Parameters) NoProofFac

func (params *Parameters) NoProofFac() bool

NoProofFac returns whether the factor proof is disabled for key generation.

func (*Parameters) NoProofMod

func (params *Parameters) NoProofMod() bool

NoProofMod returns whether the modular proof is disabled for key generation.

func (*Parameters) PartialKeyRand

func (params *Parameters) PartialKeyRand() io.Reader

PartialKeyRand returns the random source used for partial key generation.

func (*Parameters) Parties

func (params *Parameters) Parties() *PeerContext

Parties returns the PeerContext containing all party IDs for this session.

func (*Parameters) PartyCount

func (params *Parameters) PartyCount() int

PartyCount returns the total number of parties in the session.

func (*Parameters) PartyID

func (params *Parameters) PartyID() *PartyID

PartyID returns the PartyID of this party within the session.

func (*Parameters) Rand

func (params *Parameters) Rand() io.Reader

Rand returns the general-purpose random source for the parameters.

func (*Parameters) SafePrimeGenTimeout

func (params *Parameters) SafePrimeGenTimeout() time.Duration

SafePrimeGenTimeout returns the timeout duration for safe prime generation.

func (*Parameters) SetBroker added in v2.1.2

func (params *Parameters) SetBroker(b MessageBroker)

SetBroker sets the message broker used for routing messages between parties.

func (*Parameters) SetConcurrency

func (params *Parameters) SetConcurrency(concurrency int)

The concurrency level must be >= 1.

func (*Parameters) SetNoProofFac

func (params *Parameters) SetNoProofFac()

SetNoProofFac disables the factor proof during key generation.

func (*Parameters) SetNoProofMod

func (params *Parameters) SetNoProofMod()

SetNoProofMod disables the modular proof during key generation.

func (*Parameters) SetPartialKeyRand

func (params *Parameters) SetPartialKeyRand(rand io.Reader)

SetPartialKeyRand sets the random source used for partial key generation.

func (*Parameters) SetRand

func (params *Parameters) SetRand(rand io.Reader)

SetRand sets the general-purpose random source for the parameters.

func (*Parameters) SetSafePrimeGenTimeout

func (params *Parameters) SetSafePrimeGenTimeout(timeout time.Duration)

SetSafePrimeGenTimeout sets the timeout duration for safe prime generation.

func (*Parameters) Threshold

func (params *Parameters) Threshold() int

Threshold returns the threshold value t, where t+1 parties are needed to sign.

type ParsedMessage

type ParsedMessage interface {
	Message
	Content() MessageContent
	ValidateBasic() bool
}

ParsedMessage represents a message with inner ProtoBuf message content

func NewMessage

func NewMessage(meta MessageRouting, content MessageContent, wire *MessageWrapper) ParsedMessage

NewMessage creates a new ParsedMessage from the given routing metadata, content, and wire wrapper.

func ParseWireMessage

func ParseWireMessage(wireBytes []byte, from *PartyID, isBroadcast bool) (ParsedMessage, error)

Used externally to update a LocalParty with a valid ParsedMessage

type Party

type Party interface {
	Start() error
	// The main entry point when updating a party's state from the wire.
	// isBroadcast should represent whether the message was received via a reliable broadcast
	UpdateFromBytes(wireBytes []byte, from *PartyID, isBroadcast bool) (ok bool, err error)
	// You may use this entry point to update a party's state when running locally or in tests
	Update(msg ParsedMessage) (ok bool, err error)
	Running() bool
	WaitingFor() []*PartyID
	ValidateMessage(msg ParsedMessage) (bool, error)
	StoreMessage(msg ParsedMessage) (bool, error)
	FirstRound() Round
	WrapError(err error, culprits ...*PartyID) error
	PartyID() *PartyID
	String() string
	// contains filtered or unexported methods
}

type PartyID

type PartyID struct {
	*MessageWrapper_PartyID
	Index int `json:"index"`
}

PartyID represents a participant in the TSS protocol rounds. Note: The `id` and `moniker` are provided for convenience to allow you to track participants easier. The `id` is intended to be a unique string representation of `key` and `moniker` can be anything (even left blank).

func NewPartyID

func NewPartyID(id, moniker string, key *big.Int) *PartyID

NewPartyID constructs a new PartyID Exported, used in `tss` client. `key` should remain consistent between runs for each party.

func (PartyID) String

func (pid PartyID) String() string

String returns a human-readable representation of the PartyID including its index and moniker.

func (*PartyID) ValidateBasic

func (pid *PartyID) ValidateBasic() bool

ValidateBasic returns true if the PartyID has a non-nil key and a non-negative index.

type PeerContext

type PeerContext struct {
	// contains filtered or unexported fields
}

PeerContext holds the sorted list of party IDs participating in a TSS session.

func NewPeerContext

func NewPeerContext(parties SortedPartyIDs) *PeerContext

NewPeerContext creates a new PeerContext from the given sorted party IDs.

func (*PeerContext) IDs

func (p2pCtx *PeerContext) IDs() SortedPartyIDs

IDs returns the sorted list of party IDs in this peer context.

func (*PeerContext) SetIDs

func (p2pCtx *PeerContext) SetIDs(ids SortedPartyIDs)

SetIDs replaces the sorted party IDs in this peer context.

type ReSharingParameters

type ReSharingParameters struct {
	*Parameters
	// contains filtered or unexported fields
}

ReSharingParameters extends Parameters with additional configuration for key re-sharing between old and new committees.

func NewReSharingParameters

func NewReSharingParameters(ec elliptic.Curve, ctx, newCtx *PeerContext, partyID *PartyID, partyCount, threshold, newPartyCount, newThreshold int) *ReSharingParameters

Exported, used in `tss` client

func (*ReSharingParameters) IsNewCommittee

func (rgParams *ReSharingParameters) IsNewCommittee() bool

IsNewCommittee returns true if this party belongs to the new committee.

func (*ReSharingParameters) IsOldCommittee

func (rgParams *ReSharingParameters) IsOldCommittee() bool

IsOldCommittee returns true if this party belongs to the old committee.

func (*ReSharingParameters) NewParties

func (rgParams *ReSharingParameters) NewParties() *PeerContext

NewParties returns the PeerContext for the new committee in a re-sharing session.

func (*ReSharingParameters) NewPartyCount

func (rgParams *ReSharingParameters) NewPartyCount() int

NewPartyCount returns the number of parties in the new committee.

func (*ReSharingParameters) NewThreshold

func (rgParams *ReSharingParameters) NewThreshold() int

NewThreshold returns the threshold for the new committee after re-sharing.

func (*ReSharingParameters) OldAndNewParties

func (rgParams *ReSharingParameters) OldAndNewParties() []*PartyID

OldAndNewParties returns the combined list of party IDs from both old and new committees.

func (*ReSharingParameters) OldAndNewPartyCount

func (rgParams *ReSharingParameters) OldAndNewPartyCount() int

OldAndNewPartyCount returns the total number of parties across both old and new committees.

func (*ReSharingParameters) OldParties

func (rgParams *ReSharingParameters) OldParties() *PeerContext

OldParties returns the PeerContext for the old committee in a re-sharing session.

func (*ReSharingParameters) OldPartyCount

func (rgParams *ReSharingParameters) OldPartyCount() int

OldPartyCount returns the number of parties in the old committee.

type Round

type Round interface {
	Params() *Parameters
	Start() error
	Update() (bool, error)
	RoundNumber() int
	CanAccept(msg ParsedMessage) bool
	CanProceed() bool
	NextRound() Round
	WaitingFor() []*PartyID
	WrapError(err error, culprits ...*PartyID) error
}

Round defines the interface for a single round of the TSS protocol.

type SortedPartyIDs

type SortedPartyIDs []*PartyID

SortedPartyIDs is a slice of PartyID pointers sorted by key in ascending order.

func GenerateTestPartyIDs

func GenerateTestPartyIDs(count int, startAt ...int) SortedPartyIDs

GenerateTestPartyIDs generates a list of mock PartyIDs for tests

func SortPartyIDs

func SortPartyIDs(ids UnSortedPartyIDs, startAt ...int) SortedPartyIDs

SortPartyIDs sorts a list of []*PartyID by their keys in ascending order Exported, used in `tss` client

func (SortedPartyIDs) Exclude

func (spids SortedPartyIDs) Exclude(exclude *PartyID) SortedPartyIDs

Exclude returns a new SortedPartyIDs with the specified party removed.

func (SortedPartyIDs) FindByKey

func (spids SortedPartyIDs) FindByKey(key *big.Int) *PartyID

FindByKey returns the PartyID matching the given key, or nil if not found.

func (SortedPartyIDs) Keys

func (spids SortedPartyIDs) Keys() []*big.Int

Keys returns a slice of the keys for all party IDs in the sorted list.

func (SortedPartyIDs) Len

func (spids SortedPartyIDs) Len() int

Len returns the number of party IDs in the sorted list, implementing sort.Interface.

func (SortedPartyIDs) Less

func (spids SortedPartyIDs) Less(a, b int) bool

Less reports whether the party at index a has a smaller key than the party at index b, implementing sort.Interface.

func (SortedPartyIDs) Swap

func (spids SortedPartyIDs) Swap(a, b int)

Swap swaps the party IDs at the given indices, implementing sort.Interface.

func (SortedPartyIDs) ToUnSorted

func (spids SortedPartyIDs) ToUnSorted() UnSortedPartyIDs

ToUnSorted converts the SortedPartyIDs to an UnSortedPartyIDs type.

type UnSortedPartyIDs

type UnSortedPartyIDs []*PartyID

UnSortedPartyIDs is an unsorted slice of PartyID pointers.

Jump to

Keyboard shortcuts

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