messages

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 8 Imported by: 11

Documentation

Index

Constants

View Source
const (
	KEYGEN1          = "KGRound1Message"
	KEYGEN2aUnicast  = "KGRound2Message1"
	KEYGEN2b         = "KGRound2Message2"
	KEYGEN3          = "KGRound3Message"
	KEYSIGN1aUnicast = "SignRound1Message1"
	KEYSIGN1b        = "SignRound1Message2"
	KEYSIGN2Unicast  = "SignRound2Message"
	KEYSIGN3         = "SignRound3Message"
	KEYSIGN4         = "SignRound4Message"
	KEYSIGN5         = "SignRound5Message"
	KEYSIGN6         = "SignRound6Message"
	KEYSIGN7         = "SignRound7Message"
	KEYSIGN8         = "SignRound8Message"
	KEYSIGN9         = "SignRound9Message"
	TSSKEYGENROUNDS  = 4
	TSSKEYSIGNROUNDS = 10
)

Variables

View Source
var (
	JoinPartyResponse_ResponseType_name = map[int32]string{
		0: "Unknown",
		1: "Success",
		2: "Timeout",
		3: "LeaderNotReady",
		4: "UnknownPeer",
	}
	JoinPartyResponse_ResponseType_value = map[string]int32{
		"Unknown":        0,
		"Success":        1,
		"Timeout":        2,
		"LeaderNotReady": 3,
		"UnknownPeer":    4,
	}
)

Enum value maps for JoinPartyResponse_ResponseType.

View Source
var (
	KeysignSignature_Status_name = map[int32]string{
		0: "Unknown",
		1: "Success",
		2: "Failed",
	}
	KeysignSignature_Status_value = map[string]int32{
		"Unknown": 0,
		"Success": 1,
		"Failed":  2,
	}
)

Enum value maps for KeysignSignature_Status.

View Source
var File_messages_join_party_proto protoreflect.FileDescriptor
View Source
var File_messages_signature_notifier_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BroadcastConfirmMessage

type BroadcastConfirmMessage struct {
	P2PID string `json:"P2PID"`
	Key   string `json:"key"`
	Hash  string `json:"hash"`
}

BroadcastConfirmMessage is used to broadcast to all parties what message they receive

type BroadcastMsgChan

type BroadcastMsgChan struct {
	WrappedMessage WrappedMessage
	PeersID        []peer.ID
}

BroadcastMsgChan is the channel structure for keygen/keysign submit message to p2p network

type JoinPartyRequest

type JoinPartyRequest struct {
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // the unique hash id
	// contains filtered or unexported fields
}

func (*JoinPartyRequest) Descriptor deprecated

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

Deprecated: Use JoinPartyRequest.ProtoReflect.Descriptor instead.

func (*JoinPartyRequest) GetID

func (x *JoinPartyRequest) GetID() string

func (*JoinPartyRequest) ProtoMessage

func (*JoinPartyRequest) ProtoMessage()

func (*JoinPartyRequest) ProtoReflect

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

func (*JoinPartyRequest) Reset

func (x *JoinPartyRequest) Reset()

func (*JoinPartyRequest) String

func (x *JoinPartyRequest) String() string

type JoinPartyResponse

type JoinPartyResponse struct {
	ID      string                         `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`                                                   // unique hash id
	Type    JoinPartyResponse_ResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=messages.JoinPartyResponse_ResponseType" json:"type,omitempty"` // result
	PeerIDs []string                       `protobuf:"bytes,3,rep,name=PeerIDs,proto3" json:"PeerIDs,omitempty"`                                         // if Success , this will be the list of peers to form the ceremony, if fail , this will be the peers that are available
	// contains filtered or unexported fields
}

func (*JoinPartyResponse) Descriptor deprecated

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

Deprecated: Use JoinPartyResponse.ProtoReflect.Descriptor instead.

func (*JoinPartyResponse) GetID

func (x *JoinPartyResponse) GetID() string

func (*JoinPartyResponse) GetPeerIDs

func (x *JoinPartyResponse) GetPeerIDs() []string

func (*JoinPartyResponse) GetType

func (*JoinPartyResponse) ProtoMessage

func (*JoinPartyResponse) ProtoMessage()

func (*JoinPartyResponse) ProtoReflect

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

func (*JoinPartyResponse) Reset

func (x *JoinPartyResponse) Reset()

func (*JoinPartyResponse) String

func (x *JoinPartyResponse) String() string

type JoinPartyResponse_ResponseType

type JoinPartyResponse_ResponseType int32
const (
	JoinPartyResponse_Unknown        JoinPartyResponse_ResponseType = 0
	JoinPartyResponse_Success        JoinPartyResponse_ResponseType = 1
	JoinPartyResponse_Timeout        JoinPartyResponse_ResponseType = 2
	JoinPartyResponse_LeaderNotReady JoinPartyResponse_ResponseType = 3
	JoinPartyResponse_UnknownPeer    JoinPartyResponse_ResponseType = 4
)

func (JoinPartyResponse_ResponseType) Descriptor

func (JoinPartyResponse_ResponseType) Enum

func (JoinPartyResponse_ResponseType) EnumDescriptor deprecated

func (JoinPartyResponse_ResponseType) EnumDescriptor() ([]byte, []int)

Deprecated: Use JoinPartyResponse_ResponseType.Descriptor instead.

func (JoinPartyResponse_ResponseType) Number

func (JoinPartyResponse_ResponseType) String

func (JoinPartyResponse_ResponseType) Type

type KeysignSignature

type KeysignSignature struct {
	ID            string                  `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // the unique message id
	Signature     []byte                  `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"`
	KeysignStatus KeysignSignature_Status `protobuf:"varint,3,opt,name=KeysignStatus,proto3,enum=messages.KeysignSignature_Status" json:"KeysignStatus,omitempty"`
	// contains filtered or unexported fields
}

func (*KeysignSignature) Descriptor deprecated

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

Deprecated: Use KeysignSignature.ProtoReflect.Descriptor instead.

func (*KeysignSignature) GetID

func (x *KeysignSignature) GetID() string

func (*KeysignSignature) GetKeysignStatus

func (x *KeysignSignature) GetKeysignStatus() KeysignSignature_Status

func (*KeysignSignature) GetSignature

func (x *KeysignSignature) GetSignature() []byte

func (*KeysignSignature) ProtoMessage

func (*KeysignSignature) ProtoMessage()

func (*KeysignSignature) ProtoReflect

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

func (*KeysignSignature) Reset

func (x *KeysignSignature) Reset()

func (*KeysignSignature) String

func (x *KeysignSignature) String() string

type KeysignSignature_Status

type KeysignSignature_Status int32
const (
	KeysignSignature_Unknown KeysignSignature_Status = 0
	KeysignSignature_Success KeysignSignature_Status = 1
	KeysignSignature_Failed  KeysignSignature_Status = 2
)

func (KeysignSignature_Status) Descriptor

func (KeysignSignature_Status) Enum

func (KeysignSignature_Status) EnumDescriptor deprecated

func (KeysignSignature_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use KeysignSignature_Status.Descriptor instead.

func (KeysignSignature_Status) Number

func (KeysignSignature_Status) String

func (x KeysignSignature_Status) String() string

func (KeysignSignature_Status) Type

type THORChainTSSMessageType

type THORChainTSSMessageType uint8

THORChainTSSMessageType represent the messgae type used in THORChain TSS

const (
	// TSSKeyGenMsg is the message directly generated by tss-lib package
	TSSKeyGenMsg THORChainTSSMessageType = iota
	// TSSKeySignMsg is the message directly generated by tss lib for sign
	TSSKeySignMsg
	// TSSKeyGenVerMsg is the message we create on top to make sure everyone received the same message
	TSSKeyGenVerMsg
	// TSSKeySignVerMsg is the message we create to make sure every party receive the same broadcast message
	TSSKeySignVerMsg
	// TSSControlMsg is the message we create to exchange Tss share
	TSSControlMsg
	// TSSTaskDone is the message of Tss process notification
	TSSTaskDone
	// Unknown is the message indicates the undefined message type
	Unknown
)

func (THORChainTSSMessageType) String

func (msgType THORChainTSSMessageType) String() string

String implement fmt.Stringer

type TssControl

type TssControl struct {
	ReqHash     string                  `json:"reqest_hash"`
	ReqKey      string                  `json:"request_key"`
	RequestType THORChainTSSMessageType `json:"request_type"`
	Msg         *WireMessage            `json:"message_body"`
}

type TssTaskNotifier

type TssTaskNotifier struct {
	TaskDone bool `json:"task_done"`
}

type WireMessage

type WireMessage struct {
	Routing   *btss.MessageRouting `json:"routing"`
	RoundInfo string               `json:"round_info"`
	Message   []byte               `json:"message"`
	Sig       []byte               `json:"signature"`
}

WireMessage the message that produced by tss-lib package

func (*WireMessage) GetCacheKey

func (m *WireMessage) GetCacheKey() string

GetCacheKey return the key we used to cache it locally

type WrappedMessage

type WrappedMessage struct {
	MessageType THORChainTSSMessageType `json:"message_type"`
	MsgID       string                  `json:"message_id"`
	Payload     []byte                  `json:"payload"`
}

WrappedMessage is a message with type in it

Jump to

Keyboard shortcuts

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