golint: Id -> ID

This commit is contained in:
D-Stacks 2022-06-16 09:57:22 +02:00
parent 07978077ac
commit 34813d3b16
30 changed files with 135 additions and 128 deletions

View File

@ -3,7 +3,7 @@ package appmessage
// NotifyBlockAddedRequestMessage is an appmessage corresponding to // NotifyBlockAddedRequestMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyBlockAddedRequestMessage struct { type NotifyBlockAddedRequestMessage struct {
Id string ID string
baseMessage baseMessage
} }
@ -14,14 +14,14 @@ func (msg *NotifyBlockAddedRequestMessage) Command() MessageCommand {
// NewNotifyBlockAddedRequestMessage returns a instance of the message // NewNotifyBlockAddedRequestMessage returns a instance of the message
func NewNotifyBlockAddedRequestMessage(id string) *NotifyBlockAddedRequestMessage { func NewNotifyBlockAddedRequestMessage(id string) *NotifyBlockAddedRequestMessage {
return &NotifyBlockAddedRequestMessage{Id: id} return &NotifyBlockAddedRequestMessage{ID: id}
} }
// NotifyBlockAddedResponseMessage is an appmessage corresponding to // NotifyBlockAddedResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyBlockAddedResponseMessage struct { type NotifyBlockAddedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -32,14 +32,14 @@ func (msg *NotifyBlockAddedResponseMessage) Command() MessageCommand {
// NewNotifyBlockAddedResponseMessage returns a instance of the message // NewNotifyBlockAddedResponseMessage returns a instance of the message
func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMessage { func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMessage {
return &NotifyBlockAddedResponseMessage{Id: id} return &NotifyBlockAddedResponseMessage{ID: id}
} }
// BlockAddedNotificationMessage is an appmessage corresponding to // BlockAddedNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type BlockAddedNotificationMessage struct { type BlockAddedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
Block *RPCBlock Block *RPCBlock
} }
@ -51,7 +51,7 @@ func (msg *BlockAddedNotificationMessage) Command() MessageCommand {
// NewBlockAddedNotificationMessage returns a instance of the message // NewBlockAddedNotificationMessage returns a instance of the message
func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage { func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage {
return &BlockAddedNotificationMessage{ return &BlockAddedNotificationMessage{
Id: id, ID: id,
Block: block, Block: block,
} }
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyFinalityConflictsRequestMessage struct { type NotifyFinalityConflictsRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -14,14 +14,14 @@ func (msg *NotifyFinalityConflictsRequestMessage) Command() MessageCommand {
// NewNotifyFinalityConflictsRequestMessage returns a instance of the message // NewNotifyFinalityConflictsRequestMessage returns a instance of the message
func NewNotifyFinalityConflictsRequestMessage(id string) *NotifyFinalityConflictsRequestMessage { func NewNotifyFinalityConflictsRequestMessage(id string) *NotifyFinalityConflictsRequestMessage {
return &NotifyFinalityConflictsRequestMessage{Id: id} return &NotifyFinalityConflictsRequestMessage{ID: id}
} }
// NotifyFinalityConflictsResponseMessage is an appmessage corresponding to // NotifyFinalityConflictsResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyFinalityConflictsResponseMessage struct { type NotifyFinalityConflictsResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -32,14 +32,14 @@ func (msg *NotifyFinalityConflictsResponseMessage) Command() MessageCommand {
// NewNotifyFinalityConflictsResponseMessage returns a instance of the message // NewNotifyFinalityConflictsResponseMessage returns a instance of the message
func NewNotifyFinalityConflictsResponseMessage(id string) *NotifyFinalityConflictsResponseMessage { func NewNotifyFinalityConflictsResponseMessage(id string) *NotifyFinalityConflictsResponseMessage {
return &NotifyFinalityConflictsResponseMessage{Id: id} return &NotifyFinalityConflictsResponseMessage{ID: id}
} }
// FinalityConflictNotificationMessage is an appmessage corresponding to // FinalityConflictNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type FinalityConflictNotificationMessage struct { type FinalityConflictNotificationMessage struct {
baseMessage baseMessage
Id string ID string
ViolatingBlockHash string ViolatingBlockHash string
} }
@ -51,6 +51,7 @@ func (msg *FinalityConflictNotificationMessage) Command() MessageCommand {
// NewFinalityConflictNotificationMessage returns a instance of the message // NewFinalityConflictNotificationMessage returns a instance of the message
func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string) *FinalityConflictNotificationMessage { func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string) *FinalityConflictNotificationMessage {
return &FinalityConflictNotificationMessage{ return &FinalityConflictNotificationMessage{
ID: id,
ViolatingBlockHash: violatingBlockHash, ViolatingBlockHash: violatingBlockHash,
} }
} }
@ -59,7 +60,7 @@ func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string
// its respective RPC message // its respective RPC message
type FinalityConflictResolvedNotificationMessage struct { type FinalityConflictResolvedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
FinalityBlockHash string FinalityBlockHash string
} }
@ -71,7 +72,7 @@ func (msg *FinalityConflictResolvedNotificationMessage) Command() MessageCommand
// NewFinalityConflictResolvedNotificationMessage returns a instance of the message // NewFinalityConflictResolvedNotificationMessage returns a instance of the message
func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string, id string) *FinalityConflictResolvedNotificationMessage { func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string, id string) *FinalityConflictResolvedNotificationMessage {
return &FinalityConflictResolvedNotificationMessage{ return &FinalityConflictResolvedNotificationMessage{
Id: id, ID: id,
FinalityBlockHash: finalityBlockHash, FinalityBlockHash: finalityBlockHash,
} }
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyNewBlockTemplateRequestMessage struct { type NotifyNewBlockTemplateRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -14,14 +14,14 @@ func (msg *NotifyNewBlockTemplateRequestMessage) Command() MessageCommand {
// NewNotifyNewBlockTemplateRequestMessage returns an instance of the message // NewNotifyNewBlockTemplateRequestMessage returns an instance of the message
func NewNotifyNewBlockTemplateRequestMessage(id string) *NotifyNewBlockTemplateRequestMessage { func NewNotifyNewBlockTemplateRequestMessage(id string) *NotifyNewBlockTemplateRequestMessage {
return &NotifyNewBlockTemplateRequestMessage{Id: id} return &NotifyNewBlockTemplateRequestMessage{ID: id}
} }
// NotifyNewBlockTemplateResponseMessage is an appmessage corresponding to // NotifyNewBlockTemplateResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyNewBlockTemplateResponseMessage struct { type NotifyNewBlockTemplateResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -32,14 +32,14 @@ func (msg *NotifyNewBlockTemplateResponseMessage) Command() MessageCommand {
// NewNotifyNewBlockTemplateResponseMessage returns an instance of the message // NewNotifyNewBlockTemplateResponseMessage returns an instance of the message
func NewNotifyNewBlockTemplateResponseMessage(id string) *NotifyNewBlockTemplateResponseMessage { func NewNotifyNewBlockTemplateResponseMessage(id string) *NotifyNewBlockTemplateResponseMessage {
return &NotifyNewBlockTemplateResponseMessage{Id: id} return &NotifyNewBlockTemplateResponseMessage{ID: id}
} }
// NewBlockTemplateNotificationMessage is an appmessage corresponding to // NewBlockTemplateNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NewBlockTemplateNotificationMessage struct { type NewBlockTemplateNotificationMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -49,5 +49,5 @@ func (msg *NewBlockTemplateNotificationMessage) Command() MessageCommand {
// NewNewBlockTemplateNotificationMessage returns an instance of the message // NewNewBlockTemplateNotificationMessage returns an instance of the message
func NewNewBlockTemplateNotificationMessage(id string) *NewBlockTemplateNotificationMessage { func NewNewBlockTemplateNotificationMessage(id string) *NewBlockTemplateNotificationMessage {
return &NewBlockTemplateNotificationMessage{Id: id} return &NewBlockTemplateNotificationMessage{ID: id}
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyPruningPointUTXOSetOverrideRequestMessage struct { type NotifyPruningPointUTXOSetOverrideRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -14,13 +14,14 @@ func (msg *NotifyPruningPointUTXOSetOverrideRequestMessage) Command() MessageCom
// NewNotifyPruningPointUTXOSetOverrideRequestMessage returns a instance of the message // NewNotifyPruningPointUTXOSetOverrideRequestMessage returns a instance of the message
func NewNotifyPruningPointUTXOSetOverrideRequestMessage(id string) *NotifyPruningPointUTXOSetOverrideRequestMessage { func NewNotifyPruningPointUTXOSetOverrideRequestMessage(id string) *NotifyPruningPointUTXOSetOverrideRequestMessage {
return &NotifyPruningPointUTXOSetOverrideRequestMessage{} return &NotifyPruningPointUTXOSetOverrideRequestMessage{ID: id}
} }
// NotifyPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to // NotifyPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyPruningPointUTXOSetOverrideResponseMessage struct { type NotifyPruningPointUTXOSetOverrideResponseMessage struct {
baseMessage baseMessage
ID string
Error *RPCError Error *RPCError
} }
@ -31,13 +32,14 @@ func (msg *NotifyPruningPointUTXOSetOverrideResponseMessage) Command() MessageCo
// NewNotifyPruningPointUTXOSetOverrideResponseMessage returns a instance of the message // NewNotifyPruningPointUTXOSetOverrideResponseMessage returns a instance of the message
func NewNotifyPruningPointUTXOSetOverrideResponseMessage(id string) *NotifyPruningPointUTXOSetOverrideResponseMessage { func NewNotifyPruningPointUTXOSetOverrideResponseMessage(id string) *NotifyPruningPointUTXOSetOverrideResponseMessage {
return &NotifyPruningPointUTXOSetOverrideResponseMessage{} return &NotifyPruningPointUTXOSetOverrideResponseMessage{ID: id}
} }
// PruningPointUTXOSetOverrideNotificationMessage is an appmessage corresponding to // PruningPointUTXOSetOverrideNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type PruningPointUTXOSetOverrideNotificationMessage struct { type PruningPointUTXOSetOverrideNotificationMessage struct {
baseMessage baseMessage
ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -47,14 +49,14 @@ func (msg *PruningPointUTXOSetOverrideNotificationMessage) Command() MessageComm
// NewPruningPointUTXOSetOverrideNotificationMessage returns a instance of the message // NewPruningPointUTXOSetOverrideNotificationMessage returns a instance of the message
func NewPruningPointUTXOSetOverrideNotificationMessage(id string) *PruningPointUTXOSetOverrideNotificationMessage { func NewPruningPointUTXOSetOverrideNotificationMessage(id string) *PruningPointUTXOSetOverrideNotificationMessage {
return &PruningPointUTXOSetOverrideNotificationMessage{} return &PruningPointUTXOSetOverrideNotificationMessage{ID: id}
} }
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to // StopNotifyingPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct { type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -64,13 +66,14 @@ func (msg *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) Command() Mes
// NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage returns a instance of the message // NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage returns a instance of the message
func NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideRequestMessage { func NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideRequestMessage {
return &StopNotifyingPruningPointUTXOSetOverrideRequestMessage{Id: id} return &StopNotifyingPruningPointUTXOSetOverrideRequestMessage{ID: id}
} }
// StopNotifyingPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to // StopNotifyingPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct { type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct {
baseMessage baseMessage
ID string
Error *RPCError Error *RPCError
} }
@ -81,5 +84,5 @@ func (msg *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) Command() Me
// NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage returns a instance of the message // NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage returns a instance of the message
func NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideResponseMessage { func NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideResponseMessage {
return &StopNotifyingPruningPointUTXOSetOverrideResponseMessage{} return &StopNotifyingPruningPointUTXOSetOverrideResponseMessage{ID: id}
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyUTXOsChangedRequestMessage struct { type NotifyUTXOsChangedRequestMessage struct {
baseMessage baseMessage
Id string ID string
Addresses []string Addresses []string
} }
@ -16,6 +16,7 @@ func (msg *NotifyUTXOsChangedRequestMessage) Command() MessageCommand {
// NewNotifyUTXOsChangedRequestMessage returns a instance of the message // NewNotifyUTXOsChangedRequestMessage returns a instance of the message
func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyUTXOsChangedRequestMessage { func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyUTXOsChangedRequestMessage {
return &NotifyUTXOsChangedRequestMessage{ return &NotifyUTXOsChangedRequestMessage{
ID: id,
Addresses: addresses, Addresses: addresses,
} }
} }
@ -24,7 +25,7 @@ func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyU
// its respective RPC message // its respective RPC message
type NotifyUTXOsChangedResponseMessage struct { type NotifyUTXOsChangedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -35,14 +36,14 @@ func (msg *NotifyUTXOsChangedResponseMessage) Command() MessageCommand {
// NewNotifyUTXOsChangedResponseMessage returns a instance of the message // NewNotifyUTXOsChangedResponseMessage returns a instance of the message
func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponseMessage { func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponseMessage {
return &NotifyUTXOsChangedResponseMessage{Id: id} return &NotifyUTXOsChangedResponseMessage{ID: id}
} }
// UTXOsChangedNotificationMessage is an appmessage corresponding to // UTXOsChangedNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type UTXOsChangedNotificationMessage struct { type UTXOsChangedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
Added []*UTXOsByAddressesEntry Added []*UTXOsByAddressesEntry
Removed []*UTXOsByAddressesEntry Removed []*UTXOsByAddressesEntry
} }
@ -61,5 +62,5 @@ func (msg *UTXOsChangedNotificationMessage) Command() MessageCommand {
// NewUTXOsChangedNotificationMessage returns a instance of the message // NewUTXOsChangedNotificationMessage returns a instance of the message
func NewUTXOsChangedNotificationMessage(id string) *UTXOsChangedNotificationMessage { func NewUTXOsChangedNotificationMessage(id string) *UTXOsChangedNotificationMessage {
return &UTXOsChangedNotificationMessage{Id: id} return &UTXOsChangedNotificationMessage{ID: id}
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyVirtualDaaScoreChangedRequestMessage struct { type NotifyVirtualDaaScoreChangedRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -14,14 +14,14 @@ func (msg *NotifyVirtualDaaScoreChangedRequestMessage) Command() MessageCommand
// NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message // NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message
func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaScoreChangedRequestMessage { func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaScoreChangedRequestMessage {
return &NotifyVirtualDaaScoreChangedRequestMessage{Id: id} return &NotifyVirtualDaaScoreChangedRequestMessage{ID: id}
} }
// NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to // NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyVirtualDaaScoreChangedResponseMessage struct { type NotifyVirtualDaaScoreChangedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -32,14 +32,14 @@ func (msg *NotifyVirtualDaaScoreChangedResponseMessage) Command() MessageCommand
// NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message // NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message
func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaaScoreChangedResponseMessage { func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaaScoreChangedResponseMessage {
return &NotifyVirtualDaaScoreChangedResponseMessage{Id: id} return &NotifyVirtualDaaScoreChangedResponseMessage{ID: id}
} }
// VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to // VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type VirtualDaaScoreChangedNotificationMessage struct { type VirtualDaaScoreChangedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
VirtualDaaScore uint64 VirtualDaaScore uint64
} }
@ -53,7 +53,7 @@ func NewVirtualDaaScoreChangedNotificationMessage(
virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage { virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage {
return &VirtualDaaScoreChangedNotificationMessage{ return &VirtualDaaScoreChangedNotificationMessage{
Id: id, ID: id,
VirtualDaaScore: virtualDaaScore, VirtualDaaScore: virtualDaaScore,
} }
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage struct { type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage struct {
baseMessage baseMessage
Id string ID string
} }
// Command returns the protocol command string for the message // Command returns the protocol command string for the message
@ -14,14 +14,14 @@ func (msg *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) Command()
// NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message // NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message
func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage { func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {
return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{Id: id} return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{ID: id}
} }
// NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to // NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct { type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -32,14 +32,14 @@ func (msg *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) Command()
// NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage returns a instance of the message // NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage returns a instance of the message
func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage { func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage {
return &NotifyVirtualSelectedParentBlueScoreChangedResponseMessage{} return &NotifyVirtualSelectedParentBlueScoreChangedResponseMessage{ID: id}
} }
// VirtualSelectedParentBlueScoreChangedNotificationMessage is an appmessage corresponding to // VirtualSelectedParentBlueScoreChangedNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type VirtualSelectedParentBlueScoreChangedNotificationMessage struct { type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
VirtualSelectedParentBlueScore uint64 VirtualSelectedParentBlueScore uint64
} }
@ -53,7 +53,7 @@ func NewVirtualSelectedParentBlueScoreChangedNotificationMessage(
virtualSelectedParentBlueScore uint64, id string) *VirtualSelectedParentBlueScoreChangedNotificationMessage { virtualSelectedParentBlueScore uint64, id string) *VirtualSelectedParentBlueScoreChangedNotificationMessage {
return &VirtualSelectedParentBlueScoreChangedNotificationMessage{ return &VirtualSelectedParentBlueScoreChangedNotificationMessage{
Id: id, ID: id,
VirtualSelectedParentBlueScore: virtualSelectedParentBlueScore, VirtualSelectedParentBlueScore: virtualSelectedParentBlueScore,
} }
} }

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyVirtualSelectedParentChainChangedRequestMessage struct { type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
baseMessage baseMessage
Id string ID string
IncludeAcceptedTransactionIDs bool IncludeAcceptedTransactionIDs bool
} }
@ -18,7 +18,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
includeAcceptedTransactionIDs bool, id string) *NotifyVirtualSelectedParentChainChangedRequestMessage { includeAcceptedTransactionIDs bool, id string) *NotifyVirtualSelectedParentChainChangedRequestMessage {
return &NotifyVirtualSelectedParentChainChangedRequestMessage{ return &NotifyVirtualSelectedParentChainChangedRequestMessage{
Id: id, ID: id,
IncludeAcceptedTransactionIDs: includeAcceptedTransactionIDs, IncludeAcceptedTransactionIDs: includeAcceptedTransactionIDs,
} }
} }
@ -27,7 +27,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
// its respective RPC message // its respective RPC message
type NotifyVirtualSelectedParentChainChangedResponseMessage struct { type NotifyVirtualSelectedParentChainChangedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -38,14 +38,14 @@ func (msg *NotifyVirtualSelectedParentChainChangedResponseMessage) Command() Mes
// NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message // NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message
func NewNotifyVirtualSelectedParentChainChangedResponseMessage(id string) *NotifyVirtualSelectedParentChainChangedResponseMessage { func NewNotifyVirtualSelectedParentChainChangedResponseMessage(id string) *NotifyVirtualSelectedParentChainChangedResponseMessage {
return &NotifyVirtualSelectedParentChainChangedResponseMessage{Id: id} return &NotifyVirtualSelectedParentChainChangedResponseMessage{ID: id}
} }
// VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to // VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type VirtualSelectedParentChainChangedNotificationMessage struct { type VirtualSelectedParentChainChangedNotificationMessage struct {
baseMessage baseMessage
Id string ID string
RemovedChainBlockHashes []string RemovedChainBlockHashes []string
AddedChainBlockHashes []string AddedChainBlockHashes []string
AcceptedTransactionIDs []*AcceptedTransactionIDs AcceptedTransactionIDs []*AcceptedTransactionIDs
@ -61,7 +61,7 @@ func NewVirtualSelectedParentChainChangedNotificationMessage(removedChainBlockHa
addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs, id string) *VirtualSelectedParentChainChangedNotificationMessage { addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs, id string) *VirtualSelectedParentChainChangedNotificationMessage {
return &VirtualSelectedParentChainChangedNotificationMessage{ return &VirtualSelectedParentChainChangedNotificationMessage{
Id: id, ID: id,
RemovedChainBlockHashes: removedChainBlockHashes, RemovedChainBlockHashes: removedChainBlockHashes,
AddedChainBlockHashes: addedChainBlocks, AddedChainBlockHashes: addedChainBlocks,
AcceptedTransactionIDs: acceptedTransactionIDs, AcceptedTransactionIDs: acceptedTransactionIDs,

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message // its respective RPC message
type StopNotifyingUTXOsChangedRequestMessage struct { type StopNotifyingUTXOsChangedRequestMessage struct {
baseMessage baseMessage
Id string ID string
Addresses []string Addresses []string
} }
@ -16,7 +16,7 @@ func (msg *StopNotifyingUTXOsChangedRequestMessage) Command() MessageCommand {
// NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message // NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message
func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *StopNotifyingUTXOsChangedRequestMessage { func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *StopNotifyingUTXOsChangedRequestMessage {
return &StopNotifyingUTXOsChangedRequestMessage{ return &StopNotifyingUTXOsChangedRequestMessage{
Id: id, ID: id,
Addresses: addresses, Addresses: addresses,
} }
} }
@ -25,7 +25,7 @@ func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *
// its respective RPC message // its respective RPC message
type StopNotifyingUTXOsChangedResponseMessage struct { type StopNotifyingUTXOsChangedResponseMessage struct {
baseMessage baseMessage
Id string ID string
Error *RPCError Error *RPCError
} }
@ -36,5 +36,5 @@ func (msg *StopNotifyingUTXOsChangedResponseMessage) Command() MessageCommand {
// NewStopNotifyingUTXOsChangedResponseMessage returns a instance of the message // NewStopNotifyingUTXOsChangedResponseMessage returns a instance of the message
func NewStopNotifyingUTXOsChangedResponseMessage(id string) *StopNotifyingUTXOsChangedResponseMessage { func NewStopNotifyingUTXOsChangedResponseMessage(id string) *StopNotifyingUTXOsChangedResponseMessage {
return &StopNotifyingUTXOsChangedResponseMessage{Id: id} return &StopNotifyingUTXOsChangedResponseMessage{ID: id}
} }

View File

@ -166,7 +166,7 @@ func (m *Manager) NotifyFinalityConflict(violatingBlockHash string) error {
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflict") onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflict")
defer onEnd() defer onEnd()
notification := appmessage.NewFinalityConflictNotificationMessage(violatingBlockHash, rpccontext.DefaultNotificationId) notification := appmessage.NewFinalityConflictNotificationMessage(violatingBlockHash, rpccontext.DefaultNotificationID)
return m.context.NotificationManager.NotifyFinalityConflict(notification) return m.context.NotificationManager.NotifyFinalityConflict(notification)
} }
@ -175,7 +175,7 @@ func (m *Manager) NotifyFinalityConflictResolved(finalityBlockHash string) error
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflictResolved") onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflictResolved")
defer onEnd() defer onEnd()
notification := appmessage.NewFinalityConflictResolvedNotificationMessage(finalityBlockHash, rpccontext.DefaultNotificationId) notification := appmessage.NewFinalityConflictResolvedNotificationMessage(finalityBlockHash, rpccontext.DefaultNotificationID)
return m.context.NotificationManager.NotifyFinalityConflictResolved(notification) return m.context.NotificationManager.NotifyFinalityConflictResolved(notification)
} }
@ -207,7 +207,7 @@ func (m *Manager) notifyVirtualSelectedParentBlueScoreChanged(virtualSelectedPar
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualSelectedParentBlueScoreChanged") onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualSelectedParentBlueScoreChanged")
defer onEnd() defer onEnd()
notification := appmessage.NewVirtualSelectedParentBlueScoreChangedNotificationMessage(virtualSelectedParentBlueScore, rpccontext.DefaultNotificationId) notification := appmessage.NewVirtualSelectedParentBlueScoreChangedNotificationMessage(virtualSelectedParentBlueScore, rpccontext.DefaultNotificationID)
return m.context.NotificationManager.NotifyVirtualSelectedParentBlueScoreChanged(notification) return m.context.NotificationManager.NotifyVirtualSelectedParentBlueScoreChanged(notification)
} }
@ -215,7 +215,7 @@ func (m *Manager) notifyVirtualDaaScoreChanged(virtualDAAScore uint64) error {
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualDaaScoreChanged") onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualDaaScoreChanged")
defer onEnd() defer onEnd()
notification := appmessage.NewVirtualDaaScoreChangedNotificationMessage(virtualDAAScore, rpccontext.DefaultNotificationId) notification := appmessage.NewVirtualDaaScoreChangedNotificationMessage(virtualDAAScore, rpccontext.DefaultNotificationID)
return m.context.NotificationManager.NotifyVirtualDaaScoreChanged(notification) return m.context.NotificationManager.NotifyVirtualDaaScoreChanged(notification)
} }

View File

@ -32,7 +32,7 @@ func (ctx *Context) ConvertVirtualSelectedParentChainChangesToChainChangedNotifi
} }
return appmessage.NewVirtualSelectedParentChainChangedNotificationMessage( return appmessage.NewVirtualSelectedParentChainChangedNotificationMessage(
removedChainBlockHashes, addedChainBlocks, acceptedTransactionIDs, DefaultNotificationId), nil removedChainBlockHashes, addedChainBlocks, acceptedTransactionIDs, DefaultNotificationID), nil
} }
func (ctx *Context) getAndConvertAcceptedTransactionIDs(selectedParentChainChanges *externalapi.SelectedChainPath) ( func (ctx *Context) getAndConvertAcceptedTransactionIDs(selectedParentChainChanges *externalapi.SelectedChainPath) (

View File

@ -13,7 +13,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
) )
const DefaultNotificationId = "" //empty string corrosponds to defualt grpc string value, and hence id value when not supplied // DefaultNotificationID corrosponds to defualt grpc string value, and hence id value when not supplied, or as placeholder
const DefaultNotificationID = ""
// NotificationManager manages notifications for the RPC // NotificationManager manages notifications for the RPC
type NotificationManager struct { type NotificationManager struct {
@ -34,23 +35,24 @@ type NotificationListener struct {
params *dagconfig.Params params *dagconfig.Params
propagateBlockAddedNotifications bool propagateBlockAddedNotifications bool
propagateBlockAddedNotificationsId string
propagateVirtualSelectedParentChainChangedNotifications bool propagateVirtualSelectedParentChainChangedNotifications bool
propagateVirtualSelectedParentChainChangedNotificationsId string
propagateFinalityConflictNotifications bool propagateFinalityConflictNotifications bool
propagateFinalityConflictNotificationsId string
propagateFinalityConflictResolvedNotifications bool propagateFinalityConflictResolvedNotifications bool
propagateFinalityConflictResolvedNotificationsId string
propagateUTXOsChangedNotifications bool propagateUTXOsChangedNotifications bool
propagateUTXOsChangedNotificationsId string
propagateVirtualSelectedParentBlueScoreChangedNotifications bool propagateVirtualSelectedParentBlueScoreChangedNotifications bool
propagateVirtualSelectedParentBlueScoreChangedNotificationsId string
propagateVirtualDaaScoreChangedNotifications bool propagateVirtualDaaScoreChangedNotifications bool
propagateVirtualDaaScoreChangedNotificationsId string
propagatePruningPointUTXOSetOverrideNotifications bool propagatePruningPointUTXOSetOverrideNotifications bool
propagatePruningPointUTXOSetOverrideNotificationsId string
propagateNewBlockTemplateNotifications bool propagateNewBlockTemplateNotifications bool
propagateNewBlockTemplateNotificationsId string
propagateBlockAddedNotificationsID string
propagateVirtualSelectedParentChainChangedNotificationsID string
propagateFinalityConflictNotificationsID string
propagateFinalityConflictResolvedNotificationsID string
propagateUTXOsChangedNotificationsID string
propagateVirtualSelectedParentBlueScoreChangedNotificationsID string
propagateVirtualDaaScoreChangedNotificationsID string
propagatePruningPointUTXOSetOverrideNotificationsID string
propagateNewBlockTemplateNotificationsID string
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool
@ -114,7 +116,7 @@ func (nm *NotificationManager) NotifyBlockAdded(notification *appmessage.BlockAd
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateBlockAddedNotifications { if listener.propagateBlockAddedNotifications {
notification.Id = listener.propagateBlockAddedNotificationsId notification.ID = listener.propagateBlockAddedNotificationsID
err := router.OutgoingRoute().MaybeEnqueue(notification) err := router.OutgoingRoute().MaybeEnqueue(notification)
if err != nil { if err != nil {
@ -141,7 +143,7 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentChainChanged(
if listener.propagateVirtualSelectedParentChainChangedNotifications { if listener.propagateVirtualSelectedParentChainChangedNotifications {
var err error var err error
notification.Id = listener.propagateVirtualSelectedParentChainChangedNotificationsId notification.ID = listener.propagateVirtualSelectedParentChainChangedNotificationsID
if listener.includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications { if listener.includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications {
err = router.OutgoingRoute().MaybeEnqueue(notification) err = router.OutgoingRoute().MaybeEnqueue(notification)
@ -177,7 +179,7 @@ func (nm *NotificationManager) NotifyFinalityConflict(notification *appmessage.F
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateFinalityConflictNotifications { if listener.propagateFinalityConflictNotifications {
notification.Id = listener.propagateFinalityConflictNotificationsId notification.ID = listener.propagateFinalityConflictNotificationsID
err := router.OutgoingRoute().Enqueue(notification) err := router.OutgoingRoute().Enqueue(notification)
if err != nil { if err != nil {
@ -196,7 +198,7 @@ func (nm *NotificationManager) NotifyFinalityConflictResolved(notification *appm
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateFinalityConflictResolvedNotifications { if listener.propagateFinalityConflictResolvedNotifications {
notification.Id = listener.propagateFinalityConflictResolvedNotificationsId notification.ID = listener.propagateFinalityConflictResolvedNotificationsID
err := router.OutgoingRoute().Enqueue(notification) err := router.OutgoingRoute().Enqueue(notification)
if err != nil { if err != nil {
@ -220,7 +222,7 @@ func (nm *NotificationManager) NotifyUTXOsChanged(utxoChanges *utxoindex.UTXOCha
return err return err
} }
notification.Id = listener.propagateUTXOsChangedNotificationsId notification.ID = listener.propagateUTXOsChangedNotificationsID
// Don't send the notification if it's empty // Don't send the notification if it's empty
if len(notification.Added) == 0 && len(notification.Removed) == 0 { if len(notification.Added) == 0 && len(notification.Removed) == 0 {
@ -248,7 +250,7 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged(
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateVirtualSelectedParentBlueScoreChangedNotifications { if listener.propagateVirtualSelectedParentBlueScoreChangedNotifications {
notification.Id = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsId notification.ID = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsID
err := router.OutgoingRoute().MaybeEnqueue(notification) err := router.OutgoingRoute().MaybeEnqueue(notification)
if err != nil { if err != nil {
@ -270,7 +272,7 @@ func (nm *NotificationManager) NotifyVirtualDaaScoreChanged(
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateVirtualDaaScoreChangedNotifications { if listener.propagateVirtualDaaScoreChangedNotifications {
notification.Id = listener.propagateVirtualDaaScoreChangedNotificationsId notification.ID = listener.propagateVirtualDaaScoreChangedNotificationsID
err := router.OutgoingRoute().MaybeEnqueue(notification) err := router.OutgoingRoute().MaybeEnqueue(notification)
if err != nil { if err != nil {
@ -292,7 +294,7 @@ func (nm *NotificationManager) NotifyNewBlockTemplate(
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagateNewBlockTemplateNotifications { if listener.propagateNewBlockTemplateNotifications {
notification.Id = listener.propagateNewBlockTemplateNotificationsId notification.ID = listener.propagateNewBlockTemplateNotificationsID
err := router.OutgoingRoute().Enqueue(notification) err := router.OutgoingRoute().Enqueue(notification)
if err != nil { if err != nil {
@ -311,7 +313,7 @@ func (nm *NotificationManager) NotifyPruningPointUTXOSetOverride() error {
for router, listener := range nm.listeners { for router, listener := range nm.listeners {
if listener.propagatePruningPointUTXOSetOverrideNotifications { if listener.propagatePruningPointUTXOSetOverrideNotifications {
err := router.OutgoingRoute().Enqueue(appmessage.NewPruningPointUTXOSetOverrideNotificationMessage(listener.propagatePruningPointUTXOSetOverrideNotificationsId)) err := router.OutgoingRoute().Enqueue(appmessage.NewPruningPointUTXOSetOverrideNotificationMessage(listener.propagatePruningPointUTXOSetOverrideNotificationsID))
if err != nil { if err != nil {
return err return err
} }
@ -344,7 +346,7 @@ func (nl *NotificationListener) IncludeAcceptedTransactionIDsInVirtualSelectedPa
// PropagateBlockAddedNotifications instructs the listener to send block added notifications // PropagateBlockAddedNotifications instructs the listener to send block added notifications
// to the remote listener // to the remote listener
func (nl *NotificationListener) PropagateBlockAddedNotifications(id string) { func (nl *NotificationListener) PropagateBlockAddedNotifications(id string) {
nl.propagateBlockAddedNotificationsId = id nl.propagateBlockAddedNotificationsID = id
nl.propagateBlockAddedNotifications = true nl.propagateBlockAddedNotifications = true
} }
@ -358,14 +360,14 @@ func (nl *NotificationListener) PropagateVirtualSelectedParentChainChangedNotifi
// PropagateFinalityConflictNotifications instructs the listener to send finality conflict notifications // PropagateFinalityConflictNotifications instructs the listener to send finality conflict notifications
// to the remote listener // to the remote listener
func (nl *NotificationListener) PropagateFinalityConflictNotifications(id string) { func (nl *NotificationListener) PropagateFinalityConflictNotifications(id string) {
nl.propagateFinalityConflictNotificationsId = id nl.propagateFinalityConflictNotificationsID = id
nl.propagateFinalityConflictNotifications = true nl.propagateFinalityConflictNotifications = true
} }
// PropagateFinalityConflictResolvedNotifications instructs the listener to send finality conflict resolved notifications // PropagateFinalityConflictResolvedNotifications instructs the listener to send finality conflict resolved notifications
// to the remote listener // to the remote listener
func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications(id string) { func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications(id string) {
nl.propagateFinalityConflictResolvedNotificationsId = id nl.propagateFinalityConflictResolvedNotificationsID = id
nl.propagateFinalityConflictResolvedNotifications = true nl.propagateFinalityConflictResolvedNotifications = true
} }
@ -375,7 +377,7 @@ func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications(i
// are ignored. // are ignored.
func (nl *NotificationListener) PropagateUTXOsChangedNotifications(addresses []*UTXOsChangedNotificationAddress, id string) { func (nl *NotificationListener) PropagateUTXOsChangedNotifications(addresses []*UTXOsChangedNotificationAddress, id string) {
if !nl.propagateUTXOsChangedNotifications { if !nl.propagateUTXOsChangedNotifications {
nl.propagateUTXOsChangedNotificationsId = id nl.propagateUTXOsChangedNotificationsID = id
nl.propagateUTXOsChangedNotifications = true nl.propagateUTXOsChangedNotifications = true
nl.propagateUTXOsChangedNotificationAddresses = nl.propagateUTXOsChangedNotificationAddresses =
make(map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress, len(addresses)) make(map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress, len(addresses))
@ -478,34 +480,34 @@ func (nl *NotificationListener) scriptPubKeyStringToAddressString(scriptPublicKe
// PropagateVirtualSelectedParentBlueScoreChangedNotifications instructs the listener to send // PropagateVirtualSelectedParentBlueScoreChangedNotifications instructs the listener to send
// virtual selected parent blue score notifications to the remote listener // virtual selected parent blue score notifications to the remote listener
func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications(id string) { func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications(id string) {
nl.propagateVirtualDaaScoreChangedNotificationsId = id nl.propagateVirtualDaaScoreChangedNotificationsID = id
nl.propagateVirtualSelectedParentBlueScoreChangedNotifications = true nl.propagateVirtualSelectedParentBlueScoreChangedNotifications = true
} }
// PropagateVirtualDaaScoreChangedNotifications instructs the listener to send // PropagateVirtualDaaScoreChangedNotifications instructs the listener to send
// virtual DAA score notifications to the remote listener // virtual DAA score notifications to the remote listener
func (nl *NotificationListener) PropagateVirtualDaaScoreChangedNotifications(id string) { func (nl *NotificationListener) PropagateVirtualDaaScoreChangedNotifications(id string) {
nl.propagateVirtualDaaScoreChangedNotificationsId = id nl.propagateVirtualDaaScoreChangedNotificationsID = id
nl.propagateVirtualDaaScoreChangedNotifications = true nl.propagateVirtualDaaScoreChangedNotifications = true
} }
// PropagateNewBlockTemplateNotifications instructs the listener to send // PropagateNewBlockTemplateNotifications instructs the listener to send
// new block template notifications to the remote listener // new block template notifications to the remote listener
func (nl *NotificationListener) PropagateNewBlockTemplateNotifications(id string) { func (nl *NotificationListener) PropagateNewBlockTemplateNotifications(id string) {
nl.propagateNewBlockTemplateNotificationsId = id nl.propagateNewBlockTemplateNotificationsID = id
nl.propagateNewBlockTemplateNotifications = true nl.propagateNewBlockTemplateNotifications = true
} }
// PropagatePruningPointUTXOSetOverrideNotifications instructs the listener to send pruning point UTXO set override notifications // PropagatePruningPointUTXOSetOverrideNotifications instructs the listener to send pruning point UTXO set override notifications
// to the remote listener. // to the remote listener.
func (nl *NotificationListener) PropagatePruningPointUTXOSetOverrideNotifications(id string) { func (nl *NotificationListener) PropagatePruningPointUTXOSetOverrideNotifications(id string) {
nl.propagatePruningPointUTXOSetOverrideNotificationsId = id nl.propagatePruningPointUTXOSetOverrideNotificationsID = id
nl.propagatePruningPointUTXOSetOverrideNotifications = true nl.propagatePruningPointUTXOSetOverrideNotifications = true
} }
// StopPropagatingPruningPointUTXOSetOverrideNotifications instructs the listener to stop sending pruning // StopPropagatingPruningPointUTXOSetOverrideNotifications instructs the listener to stop sending pruning
// point UTXO set override notifications to the remote listener. // point UTXO set override notifications to the remote listener.
func (nl *NotificationListener) StopPropagatingPruningPointUTXOSetOverrideNotifications(id string) { func (nl *NotificationListener) StopPropagatingPruningPointUTXOSetOverrideNotifications(id string) {
nl.propagatePruningPointUTXOSetOverrideNotificationsId = id nl.propagatePruningPointUTXOSetOverrideNotificationsID = id
nl.propagatePruningPointUTXOSetOverrideNotifications = false nl.propagatePruningPointUTXOSetOverrideNotifications = false
} }

View File

@ -15,8 +15,8 @@ func HandleNotifyBlockAdded(context *rpccontext.Context, router *router.Router,
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateBlockAddedNotifications(notifyBlockAddedRequestMessage.Id) listener.PropagateBlockAddedNotifications(notifyBlockAddedRequestMessage.ID)
response := appmessage.NewNotifyBlockAddedResponseMessage(notifyBlockAddedRequestMessage.Id) response := appmessage.NewNotifyBlockAddedResponseMessage(notifyBlockAddedRequestMessage.ID)
return response, nil return response, nil
} }

View File

@ -15,9 +15,9 @@ func HandleNotifyFinalityConflicts(context *rpccontext.Context, router *router.R
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateFinalityConflictNotifications(notifyFinalityConflictsRequest.Id) listener.PropagateFinalityConflictNotifications(notifyFinalityConflictsRequest.ID)
listener.PropagateFinalityConflictResolvedNotifications(notifyFinalityConflictsRequest.Id) listener.PropagateFinalityConflictResolvedNotifications(notifyFinalityConflictsRequest.ID)
response := appmessage.NewNotifyFinalityConflictsResponseMessage(notifyFinalityConflictsRequest.Id) response := appmessage.NewNotifyFinalityConflictsResponseMessage(notifyFinalityConflictsRequest.ID)
return response, nil return response, nil
} }

View File

@ -15,8 +15,8 @@ func HandleNotifyNewBlockTemplate(context *rpccontext.Context, router *router.Ro
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateNewBlockTemplateNotifications(notifyNewBlockTemplateRequest.Id) listener.PropagateNewBlockTemplateNotifications(notifyNewBlockTemplateRequest.ID)
response := appmessage.NewNotifyNewBlockTemplateResponseMessage(notifyNewBlockTemplateRequest.Id) response := appmessage.NewNotifyNewBlockTemplateResponseMessage(notifyNewBlockTemplateRequest.ID)
return response, nil return response, nil
} }

View File

@ -15,8 +15,8 @@ func HandleNotifyPruningPointUTXOSetOverrideRequest(context *rpccontext.Context,
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagatePruningPointUTXOSetOverrideNotifications(notifyPruningPointUTXOSetOverrideRequest.Id) listener.PropagatePruningPointUTXOSetOverrideNotifications(notifyPruningPointUTXOSetOverrideRequest.ID)
response := appmessage.NewNotifyPruningPointUTXOSetOverrideResponseMessage(notifyPruningPointUTXOSetOverrideRequest.Id) response := appmessage.NewNotifyPruningPointUTXOSetOverrideResponseMessage(notifyPruningPointUTXOSetOverrideRequest.ID)
return response, nil return response, nil
} }

View File

@ -12,14 +12,14 @@ func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router
notifyUTXOsChangedRequest := request.(*appmessage.NotifyUTXOsChangedRequestMessage) notifyUTXOsChangedRequest := request.(*appmessage.NotifyUTXOsChangedRequestMessage)
if !context.Config.UTXOIndex { if !context.Config.UTXOIndex {
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id) errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex")
return errorMessage, nil return errorMessage, nil
} }
addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(notifyUTXOsChangedRequest.Addresses) addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(notifyUTXOsChangedRequest.Addresses)
if err != nil { if err != nil {
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id) errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err) errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err)
return errorMessage, nil return errorMessage, nil
} }
@ -28,8 +28,8 @@ func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateUTXOsChangedNotifications(addresses, notifyUTXOsChangedRequest.Id) listener.PropagateUTXOsChangedNotifications(addresses, notifyUTXOsChangedRequest.ID)
response := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id) response := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
return response, nil return response, nil
} }

View File

@ -15,8 +15,8 @@ func HandleNotifyVirtualDaaScoreChanged(context *rpccontext.Context, router *rou
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateVirtualDaaScoreChangedNotifications(notifyVirtualDaaScoreChangedRequest.Id) listener.PropagateVirtualDaaScoreChangedNotifications(notifyVirtualDaaScoreChangedRequest.ID)
response := appmessage.NewNotifyVirtualDaaScoreChangedResponseMessage(notifyVirtualDaaScoreChangedRequest.Id) response := appmessage.NewNotifyVirtualDaaScoreChangedResponseMessage(notifyVirtualDaaScoreChangedRequest.ID)
return response, nil return response, nil
} }

View File

@ -15,8 +15,8 @@ func HandleNotifyVirtualSelectedParentBlueScoreChanged(context *rpccontext.Conte
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.PropagateVirtualSelectedParentBlueScoreChangedNotifications(notifyVirtualSelectedParentBlueScoreChangedRequest.Id) listener.PropagateVirtualSelectedParentBlueScoreChangedNotifications(notifyVirtualSelectedParentBlueScoreChangedRequest.ID)
response := appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(notifyVirtualSelectedParentBlueScoreChangedRequest.Id) response := appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(notifyVirtualSelectedParentBlueScoreChangedRequest.ID)
return response, nil return response, nil
} }

View File

@ -18,8 +18,8 @@ func HandleNotifyVirtualSelectedParentChainChanged(context *rpccontext.Context,
} }
listener.PropagateVirtualSelectedParentChainChangedNotifications( listener.PropagateVirtualSelectedParentChainChangedNotifications(
notifyVirtualSelectedParentChainChangedRequest.IncludeAcceptedTransactionIDs, notifyVirtualSelectedParentChainChangedRequest.IncludeAcceptedTransactionIDs,
notifyVirtualSelectedParentChainChangedRequest.Id) notifyVirtualSelectedParentChainChangedRequest.ID)
response := appmessage.NewNotifyVirtualSelectedParentChainChangedResponseMessage(notifyVirtualSelectedParentChainChangedRequest.Id) response := appmessage.NewNotifyVirtualSelectedParentChainChangedResponseMessage(notifyVirtualSelectedParentChainChangedRequest.ID)
return response, nil return response, nil
} }

View File

@ -15,8 +15,8 @@ func HandleStopNotifyingPruningPointUTXOSetOverrideRequest(context *rpccontext.C
if err != nil { if err != nil {
return nil, err return nil, err
} }
listener.StopPropagatingPruningPointUTXOSetOverrideNotifications(stopNotifyingPruningPointUTXOSetOverrideRequest.Id) listener.StopPropagatingPruningPointUTXOSetOverrideNotifications(stopNotifyingPruningPointUTXOSetOverrideRequest.ID)
response := appmessage.NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(stopNotifyingPruningPointUTXOSetOverrideRequest.Id) response := appmessage.NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(stopNotifyingPruningPointUTXOSetOverrideRequest.ID)
return response, nil return response, nil
} }

View File

@ -12,14 +12,14 @@ func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router
stopNotifyingUTXOsChangedRequest := request.(*appmessage.StopNotifyingUTXOsChangedRequestMessage) stopNotifyingUTXOsChangedRequest := request.(*appmessage.StopNotifyingUTXOsChangedRequestMessage)
if !context.Config.UTXOIndex { if !context.Config.UTXOIndex {
errorMessage := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id) errorMessage := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex")
return errorMessage, nil return errorMessage, nil
} }
addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(stopNotifyingUTXOsChangedRequest.Addresses) addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(stopNotifyingUTXOsChangedRequest.Addresses)
if err != nil { if err != nil {
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id) errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err) errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err)
return errorMessage, nil return errorMessage, nil
} }
@ -30,6 +30,6 @@ func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router
} }
listener.StopPropagatingUTXOsChangedNotifications(addresses) listener.StopPropagatingUTXOsChangedNotifications(addresses)
response := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id) response := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
return response, nil return response, nil
} }

View File

@ -10,7 +10,7 @@ import (
// RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response. // RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
// Additionally, it starts listening for the appropriate notification using the given handler function // Additionally, it starts listening for the appropriate notification using the given handler function
func (c *RPCClient) RegisterForBlockAddedNotifications(onBlockAdded func(notification *appmessage.BlockAddedNotificationMessage)) error { func (c *RPCClient) RegisterForBlockAddedNotifications(onBlockAdded func(notification *appmessage.BlockAddedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyBlockAddedRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyBlockAddedRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,7 +13,7 @@ func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(in
onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error { onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue( err := c.rpcRouter.outgoingRoute().Enqueue(
appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationId)) appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,7 +13,7 @@ func (c *RPCClient) RegisterForFinalityConflictsNotifications(
onFinalityConflict func(notification *appmessage.FinalityConflictNotificationMessage), onFinalityConflict func(notification *appmessage.FinalityConflictNotificationMessage),
onFinalityConflictResolved func(notification *appmessage.FinalityConflictResolvedNotificationMessage)) error { onFinalityConflictResolved func(notification *appmessage.FinalityConflictResolvedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyFinalityConflictsRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyFinalityConflictsRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -10,7 +10,7 @@ import (
// RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response. // RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
// Additionally, it starts listening for the appropriate notification using the given handler function // Additionally, it starts listening for the appropriate notification using the given handler function
func (c *RPCClient) RegisterForNewBlockTemplateNotifications(onNewBlockTemplate func(notification *appmessage.NewBlockTemplateNotificationMessage)) error { func (c *RPCClient) RegisterForNewBlockTemplateNotifications(onNewBlockTemplate func(notification *appmessage.NewBlockTemplateNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyNewBlockTemplateRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyNewBlockTemplateRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -11,7 +11,7 @@ import (
// Additionally, it starts listening for the appropriate notification using the given handler function // Additionally, it starts listening for the appropriate notification using the given handler function
func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOSetNotifications func()) error { func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOSetNotifications func()) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }
@ -43,7 +43,7 @@ func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOS
// Additionally, it stops listening for the appropriate notification using the given handler function // Additionally, it stops listening for the appropriate notification using the given handler function
func (c *RPCClient) UnregisterPruningPointUTXOSetNotifications() error { func (c *RPCClient) UnregisterPruningPointUTXOSetNotifications() error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -12,7 +12,7 @@ import (
func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string, func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string,
onUTXOsChanged func(notification *appmessage.UTXOsChangedNotificationMessage)) error { onUTXOsChanged func(notification *appmessage.UTXOsChangedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyUTXOsChangedRequestMessage(addresses, rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyUTXOsChangedRequestMessage(addresses, rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,7 +13,7 @@ import (
func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications( func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications(
onVirtualDaaScoreChanged func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage)) error { onVirtualDaaScoreChanged func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualDaaScoreChangedRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualDaaScoreChangedRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,7 +13,7 @@ import (
func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications( func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications(
onVirtualSelectedParentBlueScoreChanged func(notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage)) error { onVirtualSelectedParentBlueScoreChanged func(notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage)) error {
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(rpccontext.DefaultNotificationId)) err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(rpccontext.DefaultNotificationID))
if err != nil { if err != nil {
return err return err
} }