This commit is contained in:
D-Stacks 2022-06-16 09:17:59 +02:00
parent 1dc8bbf738
commit 1f25116a91
28 changed files with 85 additions and 85 deletions

View File

@ -21,7 +21,7 @@ func NewNotifyBlockAddedRequestMessage(id string) *NotifyBlockAddedRequestMessag
// its respective RPC message
type NotifyBlockAddedResponseMessage struct {
baseMessage
Id string
Id string
Error *RPCError
}
@ -39,7 +39,7 @@ func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMess
// its respective RPC message
type BlockAddedNotificationMessage struct {
baseMessage
Id string
Id string
Block *RPCBlock
}
@ -51,7 +51,7 @@ func (msg *BlockAddedNotificationMessage) Command() MessageCommand {
// NewBlockAddedNotificationMessage returns a instance of the message
func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage {
return &BlockAddedNotificationMessage{
Id : id,
Id: id,
Block: block,
}
}

View File

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

View File

@ -21,7 +21,7 @@ func NewNotifyNewBlockTemplateRequestMessage(id string) *NotifyNewBlockTemplateR
// its respective RPC message
type NotifyNewBlockTemplateResponseMessage struct {
baseMessage
Id string
Id string
Error *RPCError
}

View File

@ -4,7 +4,7 @@ package appmessage
// its respective RPC message
type NotifyUTXOsChangedRequestMessage struct {
baseMessage
Id string
Id string
Addresses []string
}
@ -24,7 +24,7 @@ func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyU
// its respective RPC message
type NotifyUTXOsChangedResponseMessage struct {
baseMessage
Id string
Id string
Error *RPCError
}
@ -42,7 +42,7 @@ func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponse
// its respective RPC message
type UTXOsChangedNotificationMessage struct {
baseMessage
Id string
Id string
Added []*UTXOsByAddressesEntry
Removed []*UTXOsByAddressesEntry
}

View File

@ -21,7 +21,7 @@ func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaS
// its respective RPC message
type NotifyVirtualDaaScoreChangedResponseMessage struct {
baseMessage
Id string
Id string
Error *RPCError
}
@ -39,7 +39,7 @@ func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaa
// its respective RPC message
type VirtualDaaScoreChangedNotificationMessage struct {
baseMessage
Id string
Id string
VirtualDaaScore uint64
}
@ -53,7 +53,7 @@ func NewVirtualDaaScoreChangedNotificationMessage(
virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage {
return &VirtualDaaScoreChangedNotificationMessage{
Id: id,
Id: id,
VirtualDaaScore: virtualDaaScore,
}
}

View File

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

View File

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

View File

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

View File

@ -92,7 +92,7 @@ func (m *Manager) notifyBlockAddedToDAG(block *externalapi.DomainBlock) error {
if err != nil {
return err
}
blockAddedNotification := appmessage.NewBlockAddedNotificationMessage(rpcBlock,"")
blockAddedNotification := appmessage.NewBlockAddedNotificationMessage(rpcBlock, "")
err = m.context.NotificationManager.NotifyBlockAdded(blockAddedNotification)
if err != nil {
return err

View File

@ -33,24 +33,24 @@ type UTXOsChangedNotificationAddress struct {
type NotificationListener struct {
params *dagconfig.Params
propagateBlockAddedNotifications bool
propagateBlockAddedNotificationsId string
propagateVirtualSelectedParentChainChangedNotifications bool
propagateVirtualSelectedParentChainChangedNotificationsId string
propagateFinalityConflictNotifications bool
propagateFinalityConflictNotificationsId string
propagateFinalityConflictResolvedNotifications bool
propagateFinalityConflictResolvedNotificationsId string
propagateUTXOsChangedNotifications bool
propagateUTXOsChangedNotificationsId string
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
propagateBlockAddedNotifications bool
propagateBlockAddedNotificationsId string
propagateVirtualSelectedParentChainChangedNotifications bool
propagateVirtualSelectedParentChainChangedNotificationsId string
propagateFinalityConflictNotifications bool
propagateFinalityConflictNotificationsId string
propagateFinalityConflictResolvedNotifications bool
propagateFinalityConflictResolvedNotificationsId string
propagateUTXOsChangedNotifications bool
propagateUTXOsChangedNotificationsId string
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
propagateVirtualSelectedParentBlueScoreChangedNotificationsId string
propagateVirtualDaaScoreChangedNotifications bool
propagateVirtualDaaScoreChangedNotificationsId string
propagatePruningPointUTXOSetOverrideNotifications bool
propagatePruningPointUTXOSetOverrideNotificationsId string
propagateNewBlockTemplateNotifications bool
propagateNewBlockTemplateNotificationsId string
propagateVirtualDaaScoreChangedNotifications bool
propagateVirtualDaaScoreChangedNotificationsId string
propagatePruningPointUTXOSetOverrideNotifications bool
propagatePruningPointUTXOSetOverrideNotificationsId string
propagateNewBlockTemplateNotifications bool
propagateNewBlockTemplateNotificationsId string
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForVirtualSelectedParentChainChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForFinalityConflictsNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterPruningPointUTXOSetNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForUTXOsChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForVirtualDaaScoreChangedNotifications sends an RPC request respective to the function's

View File

@ -2,9 +2,9 @@ package rpcclient
import (
"github.com/kaspanet/kaspad/app/appmessage"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
)
// RegisterForVirtualSelectedParentBlueScoreChangedNotifications sends an RPC request respective to the function's