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 // its respective RPC message
type NotifyBlockAddedResponseMessage struct { type NotifyBlockAddedResponseMessage struct {
baseMessage baseMessage
Id string Id string
Error *RPCError Error *RPCError
} }
@ -39,7 +39,7 @@ func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMess
// 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

@ -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
} }
@ -59,7 +59,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 +71,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

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

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
} }
@ -24,7 +24,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
} }
@ -42,7 +42,7 @@ func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponse
// 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
} }

View File

@ -21,7 +21,7 @@ func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaS
// its respective RPC message // its respective RPC message
type NotifyVirtualDaaScoreChangedResponseMessage struct { type NotifyVirtualDaaScoreChangedResponseMessage struct {
baseMessage baseMessage
Id string Id string
Error *RPCError Error *RPCError
} }
@ -39,7 +39,7 @@ func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaa
// 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

@ -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
} }
@ -39,7 +39,7 @@ func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(id string) *N
// 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
} }

View File

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

View File

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

View File

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

View File

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