From ee09eb568a9ccf9084cde6e9bbe61bfa80a43537 Mon Sep 17 00:00:00 2001 From: D-Stacks Date: Sun, 16 Oct 2022 13:44:48 +0200 Subject: [PATCH] fix fmt and linting --- app/appmessage/message.go | 20 ++++---- app/appmessage/rpc_get_info.go | 10 ++-- .../rpc_modify_notifying_addresses_txs.go | 32 +++++++------ ...dify_notifying_txs_confirmation_changed.go | 22 +++++---- app/appmessage/rpc_notify_addresses_txs.go | 48 +++++++++---------- .../rpc_notify_txs_confirmation_changed.go | 33 +++++++------ app/appmessage/rpc_submit_transaction.go | 12 ++--- .../rpc_modify_notifying_addresses_txs.go | 20 ++++---- ...dify_notifying_txs_confirmation_changed.go | 13 +++-- .../protowire/rpc_notify_addresses_txs.go | 46 +++++++++--------- .../rpc_notify_txs_confirmation_changed.go | 20 ++++---- .../protowire/rpc_submit_transaction.go | 32 ++++++------- 12 files changed, 153 insertions(+), 155 deletions(-) diff --git a/app/appmessage/message.go b/app/appmessage/message.go index 1647aa2a5..8f7bd373c 100644 --- a/app/appmessage/message.go +++ b/app/appmessage/message.go @@ -322,16 +322,16 @@ var RPCMessageCommandToString = map[MessageCommand]string{ CmdGetTxsResponseMessage: "GetTxsResponse", CmdGetTxsConfirmationsRequestMessage: "GetTxsConfirmationsRequest", CmdGetTxsConfirmationsResponseMessage: "GetTxsConfirmationsResponse", - CmdNotifyTxsConfirmationChangedRequestMessage: "NotifyTxsConfirmationChangedRequest", - CmdNotifyTxsConfirmationChangedResponseMessage: "ModifyNotifyingTxsConfirmationChangedRequest", - CmdModifyNotifyingTxsConfirmationChangedRequestMessage: "ModifyNotifyingTxsConfirmationChangedResponse", - CmdModifyNotifyingTxsConfirmationChangedResponseMessage: "TxsConfirmationChangedNotification", - CmdTxsConfirmationChangedNotificationMessage: "TxsConfirmationChangedNotification", - CmdNotifyAddressesTxsRequestMessage: "NotifyAddressesTxsRequest", - CmdNotifyAddressesTxsResponseMessage: "NotifyAddressesTxsResponse", - CmdModifyNotifyingAddressesTxsRequestMessage: "ModifyNotifyingAddressesTxsRequest", - CmdModifyNotifyingAddressesTxsResponseMessage: "ModifyNotifyingAddressesTxsResponse", - CmdAddressesTxsNotificationMessage: "AddressesTxsNotification", + CmdNotifyTxsConfirmationChangedRequestMessage: "NotifyTxsConfirmationChangedRequest", + CmdNotifyTxsConfirmationChangedResponseMessage: "ModifyNotifyingTxsConfirmationChangedRequest", + CmdModifyNotifyingTxsConfirmationChangedRequestMessage: "ModifyNotifyingTxsConfirmationChangedResponse", + CmdModifyNotifyingTxsConfirmationChangedResponseMessage: "TxsConfirmationChangedNotification", + CmdTxsConfirmationChangedNotificationMessage: "TxsConfirmationChangedNotification", + CmdNotifyAddressesTxsRequestMessage: "NotifyAddressesTxsRequest", + CmdNotifyAddressesTxsResponseMessage: "NotifyAddressesTxsResponse", + CmdModifyNotifyingAddressesTxsRequestMessage: "ModifyNotifyingAddressesTxsRequest", + CmdModifyNotifyingAddressesTxsResponseMessage: "ModifyNotifyingAddressesTxsResponse", + CmdAddressesTxsNotificationMessage: "AddressesTxsNotification", } // Message is an interface that describes a kaspa message. A type that diff --git a/app/appmessage/rpc_get_info.go b/app/appmessage/rpc_get_info.go index af7b4e042..f70f6f139 100644 --- a/app/appmessage/rpc_get_info.go +++ b/app/appmessage/rpc_get_info.go @@ -24,8 +24,8 @@ type GetInfoResponseMessage struct { MempoolSize uint64 ServerVersion string IsUtxoIndexed bool - IsTxIndexed bool - IsArchival bool + IsTxIndexed bool + IsArchival bool IsSynced bool Error *RPCError @@ -37,15 +37,15 @@ func (msg *GetInfoResponseMessage) Command() MessageCommand { } // NewGetInfoResponseMessage returns a instance of the message -func NewGetInfoResponseMessage(p2pID string, mempoolSize uint64, serverVersion string, isUtxoIndexed bool, +func NewGetInfoResponseMessage(p2pID string, mempoolSize uint64, serverVersion string, isUtxoIndexed bool, isTxIndexed bool, isArchival bool, isSynced bool) *GetInfoResponseMessage { return &GetInfoResponseMessage{ P2PID: p2pID, MempoolSize: mempoolSize, ServerVersion: serverVersion, IsUtxoIndexed: isUtxoIndexed, - IsTxIndexed: isTxIndexed, - IsArchival: isArchival, + IsTxIndexed: isTxIndexed, + IsArchival: isArchival, IsSynced: isSynced, } } diff --git a/app/appmessage/rpc_modify_notifying_addresses_txs.go b/app/appmessage/rpc_modify_notifying_addresses_txs.go index b44665585..e3d306e91 100644 --- a/app/appmessage/rpc_modify_notifying_addresses_txs.go +++ b/app/appmessage/rpc_modify_notifying_addresses_txs.go @@ -1,13 +1,15 @@ package appmessage +// ModifyNotifyingAddressesTxsRequestMessage is an appmessage corresponding to +// its respective RPC message type ModifyNotifyingAddressesTxsRequestMessage struct { baseMessage - AddAddresses []string - RemoveAddresses []string - RequiredConfirmations uint32 - IncludePending bool - IncludeSending bool - IncludeReceiving bool + AddAddresses []string + RemoveAddresses []string + RequiredConfirmations uint32 + IncludePending bool + IncludeSending bool + IncludeReceiving bool } // Command returns the protocol command string for the message @@ -16,16 +18,16 @@ func (msg *ModifyNotifyingAddressesTxsRequestMessage) Command() MessageCommand { } // NewModifyNotifyingAddressesTxsRequestMessage returns a instance of the message -func NewModifyNotifyingAddressesTxsRequestMessage(addAddresses []string, removeAddresses []string, - requiredConfirmations uint32, includePending bool, includeSending bool, +func NewModifyNotifyingAddressesTxsRequestMessage(addAddresses []string, removeAddresses []string, + requiredConfirmations uint32, includePending bool, includeSending bool, includeReceiving bool) *ModifyNotifyingAddressesTxsRequestMessage { return &ModifyNotifyingAddressesTxsRequestMessage{ - AddAddresses: addAddresses, - RemoveAddresses: removeAddresses, - RequiredConfirmations: requiredConfirmations, - IncludePending: includePending, - IncludeSending: includeSending, - IncludeReceiving: includeReceiving, + AddAddresses: addAddresses, + RemoveAddresses: removeAddresses, + RequiredConfirmations: requiredConfirmations, + IncludePending: includePending, + IncludeSending: includeSending, + IncludeReceiving: includeReceiving, } } @@ -41,7 +43,7 @@ func (msg *ModifyNotifyingAddressesTxsResponseMessage) Command() MessageCommand return CmdModifyNotifyingAddressesTxsResponseMessage } -// NewModifyNotifyingAddressesTxsesponseMessage returns a instance of the message +// NewModifyNotifyingAddressesTxsResponseMessage returns a instance of the message func NewModifyNotifyingAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage { return &NotifyAddressesTxsResponseMessage{} } diff --git a/app/appmessage/rpc_modify_notifying_txs_confirmation_changed.go b/app/appmessage/rpc_modify_notifying_txs_confirmation_changed.go index 489f15182..910af4db2 100644 --- a/app/appmessage/rpc_modify_notifying_txs_confirmation_changed.go +++ b/app/appmessage/rpc_modify_notifying_txs_confirmation_changed.go @@ -1,11 +1,13 @@ package appmessage +// ModifyNotifyingTxsConfirmationChangedRequestMessage is an appmessage corresponding to +// its respective RPC message type ModifyNotifyingTxsConfirmationChangedRequestMessage struct { baseMessage - AddTxIDs []string - RemoveTxIDs []string - RequiredConfirmations uint32 - IncludePending bool + AddTxIDs []string + RemoveTxIDs []string + RequiredConfirmations uint32 + IncludePending bool } // Command returns the protocol command string for the message @@ -14,13 +16,13 @@ func (msg *ModifyNotifyingTxsConfirmationChangedRequestMessage) Command() Messag } // NewModifyNotifyingTxsConfirmationChangedRequestMessage returns a instance of the message -func NewModifyNotifyingTxsConfirmationChangedRequestMessage(addTxIDs []string, removeTxIDs []string, +func NewModifyNotifyingTxsConfirmationChangedRequestMessage(addTxIDs []string, removeTxIDs []string, requiredConfirmations uint32, includePending bool) *ModifyNotifyingTxsConfirmationChangedRequestMessage { return &ModifyNotifyingTxsConfirmationChangedRequestMessage{ - AddTxIDs: addTxIDs, - RemoveTxIDs: removeTxIDs, - RequiredConfirmations: requiredConfirmations, - IncludePending: includePending, + AddTxIDs: addTxIDs, + RemoveTxIDs: removeTxIDs, + RequiredConfirmations: requiredConfirmations, + IncludePending: includePending, } } @@ -36,7 +38,7 @@ func (msg *ModifyNotifyingTxsConfirmationChangedResponseMessage) Command() Messa return CmdModifyNotifyingTxsConfirmationChangedResponseMessage } -// NewModifyNotifyingTXChangedResponseMessage returns a instance of the message +// NewModifyNotifyingTxsChangedResponseMessage returns a instance of the message func NewModifyNotifyingTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage { return &NotifyTxsConfirmationChangedResponseMessage{} } diff --git a/app/appmessage/rpc_notify_addresses_txs.go b/app/appmessage/rpc_notify_addresses_txs.go index 029c06cb0..a23daba36 100644 --- a/app/appmessage/rpc_notify_addresses_txs.go +++ b/app/appmessage/rpc_notify_addresses_txs.go @@ -1,15 +1,14 @@ - package appmessage // NotifyAddressesTxsRequestMessage is an appmessage corresponding to // its respective RPC message type NotifyAddressesTxsRequestMessage struct { baseMessage - Addresses []string - RequiredConfirmations uint32 - IncludePending bool - IncludeSending bool - IncludeReceiving bool + Addresses []string + RequiredConfirmations uint32 + IncludePending bool + IncludeSending bool + IncludeReceiving bool } // Command returns the protocol command string for the message @@ -18,14 +17,14 @@ func (msg *NotifyAddressesTxsRequestMessage) Command() MessageCommand { } // NewNotifyAddressesTxsRequestMessage returns a instance of the message -func NewNotifyAddressesTxsRequestMessage(addresses []string, requiredConfirmations uint32, +func NewNotifyAddressesTxsRequestMessage(addresses []string, requiredConfirmations uint32, includePending bool, includeSending bool, includeReceiving bool) *NotifyAddressesTxsRequestMessage { return &NotifyAddressesTxsRequestMessage{ - Addresses: addresses, - RequiredConfirmations: requiredConfirmations, - IncludePending: includePending, - IncludeSending: includeSending, - IncludeReceiving: includeReceiving, + Addresses: addresses, + RequiredConfirmations: requiredConfirmations, + IncludePending: includePending, + IncludeSending: includeSending, + IncludeReceiving: includeReceiving, } } @@ -41,7 +40,7 @@ func (msg *NotifyAddressesTxsResponseMessage) Command() MessageCommand { return CmdNotifyAddressesTxsResponseMessage } -// NewNotifyTXChangedResponseMessage returns a instance of the message +// NewNotifyAddressesTxsResponseMessage returns a instance of the message func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage { return &NotifyAddressesTxsResponseMessage{} } @@ -51,10 +50,9 @@ func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage { type AddressesTxsNotificationMessage struct { baseMessage RequiredConfirmations uint32 - Pending *TxEntriesByAddresses - Confirmed *TxEntriesByAddresses - Unconfirmed *TxEntriesByAddresses - + Pending *TxEntriesByAddresses + Confirmed *TxEntriesByAddresses + Unconfirmed *TxEntriesByAddresses } // Command returns the protocol command string for the message @@ -63,27 +61,27 @@ func (msg *AddressesTxsNotificationMessage) Command() MessageCommand { } // NewAddressesTxsNotificationMessage returns a instance of the message -func NewAddressesTxsNotificationMessage(requiredConfirmations uint32, pending *TxEntriesByAddresses, +func NewAddressesTxsNotificationMessage(requiredConfirmations uint32, pending *TxEntriesByAddresses, confirmed *TxEntriesByAddresses, unconfirmed *TxEntriesByAddresses) *AddressesTxsNotificationMessage { return &AddressesTxsNotificationMessage{ RequiredConfirmations: requiredConfirmations, - Pending: pending, - Confirmed: confirmed, - Unconfirmed: unconfirmed, + Pending: pending, + Confirmed: confirmed, + Unconfirmed: unconfirmed, } } // TxEntriesByAddresses is an appmessage corresponding to // its respective RPC message type TxEntriesByAddresses struct { - Sent []*TxEntryByAddress + Sent []*TxEntryByAddress Received []*TxEntryByAddress } // TxEntryByAddress is an appmessage corresponding to // its respective RPC message type TxEntryByAddress struct { - Address string - TxID string + Address string + TxID string Confirmations uint32 -} \ No newline at end of file +} diff --git a/app/appmessage/rpc_notify_txs_confirmation_changed.go b/app/appmessage/rpc_notify_txs_confirmation_changed.go index b8d107799..63d28bcb5 100644 --- a/app/appmessage/rpc_notify_txs_confirmation_changed.go +++ b/app/appmessage/rpc_notify_txs_confirmation_changed.go @@ -4,9 +4,9 @@ package appmessage // its respective RPC message type NotifyTxsConfirmationChangedRequestMessage struct { baseMessage - TxIDs []string - RequiredConfirmations uint32 - IncludePending bool + TxIDs []string + RequiredConfirmations uint32 + IncludePending bool } // Command returns the protocol command string for the message @@ -15,12 +15,12 @@ func (msg *NotifyTxsConfirmationChangedRequestMessage) Command() MessageCommand } // NewNotifyTxsConfirmationChangedRequestMessage returns a instance of the message -func NewNotifyTxsConfirmationChangedRequestMessage(TxIDs []string, requiredConfirmations uint32, +func NewNotifyTxsConfirmationChangedRequestMessage(TxIDs []string, requiredConfirmations uint32, includePending bool) *NotifyTxsConfirmationChangedRequestMessage { return &NotifyTxsConfirmationChangedRequestMessage{ - TxIDs: TxIDs, - RequiredConfirmations: requiredConfirmations, - IncludePending: includePending, + TxIDs: TxIDs, + RequiredConfirmations: requiredConfirmations, + IncludePending: includePending, } } @@ -36,7 +36,7 @@ func (msg *NotifyTxsConfirmationChangedResponseMessage) Command() MessageCommand return CmdNotifyTxsConfirmationChangedResponseMessage } -// NewNotifyTXChangedResponseMessage returns a instance of the message +// NewNotifyTxsChangedResponseMessage returns a instance of the message func NewNotifyTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage { return &NotifyTxsConfirmationChangedResponseMessage{} } @@ -46,10 +46,9 @@ func NewNotifyTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseM type TxsConfirmationChangedNotificationMessage struct { baseMessage RequiredConfirmations uint32 - Pending []*TxIDConfirmationsPair - Confirmed []*TxIDConfirmationsPair - UnconfirmedTxIds []string - + Pending []*TxIDConfirmationsPair + Confirmed []*TxIDConfirmationsPair + UnconfirmedTxIds []string } // Command returns the protocol command string for the message @@ -58,12 +57,12 @@ func (msg *TxsConfirmationChangedNotificationMessage) Command() MessageCommand { } // NewTxsChangedNotificationMessage returns a instance of the message -func NewTxsChangedNotificationMessage(requiredConfirmations uint32, pending []*TxIDConfirmationsPair, - confirmed []*TxIDConfirmationsPair, unconfirmedTxIds []string) *TxsConfirmationChangedNotificationMessage { +func NewTxsChangedNotificationMessage(requiredConfirmations uint32, pending []*TxIDConfirmationsPair, + confirmed []*TxIDConfirmationsPair, unconfirmedTxIds []string) *TxsConfirmationChangedNotificationMessage { return &TxsConfirmationChangedNotificationMessage{ RequiredConfirmations: requiredConfirmations, - Pending: pending, - Confirmed: confirmed, - UnconfirmedTxIds : unconfirmedTxIds , + Pending: pending, + Confirmed: confirmed, + UnconfirmedTxIds: unconfirmedTxIds, } } diff --git a/app/appmessage/rpc_submit_transaction.go b/app/appmessage/rpc_submit_transaction.go index 01a90b5af..84cbdcae6 100644 --- a/app/appmessage/rpc_submit_transaction.go +++ b/app/appmessage/rpc_submit_transaction.go @@ -97,12 +97,12 @@ type RPCUTXOEntry struct { // RPCTransactionVerboseData holds verbose data about a transaction type RPCTransactionVerboseData struct { - TransactionID string - Hash string - Mass uint64 - BlockHash string - BlockTime uint64 - TxIndexed bool + TransactionID string + Hash string + Mass uint64 + BlockHash string + BlockTime uint64 + TxIndexed bool AcceptingBlockHash string Confirmations uint32 } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_addresses_txs.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_addresses_txs.go index 70be749f5..47256001d 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_addresses_txs.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_addresses_txs.go @@ -14,12 +14,12 @@ func (x *KaspadMessage_ModifyNotifyingAddressesTxsRequest) toAppMessage() (appme func (x *KaspadMessage_ModifyNotifyingAddressesTxsRequest) fromAppMessage(message *appmessage.ModifyNotifyingAddressesTxsRequestMessage) error { x.ModifyNotifyingAddressesTxsRequest = &ModifyNotifyingAddressesTxsRequestMessage{ - AddAddresses: message.AddAddresses, - RemoveAddresses: message.RemoveAddresses, + AddAddresses: message.AddAddresses, + RemoveAddresses: message.RemoveAddresses, RequiredConfirmations: message.RequiredConfirmations, - IncludePending: message.IncludePending, - IncludeSending: message.IncludeSending, - IncludeReceiving: message.IncludeReceiving, + IncludePending: message.IncludePending, + IncludeSending: message.IncludeSending, + IncludeReceiving: message.IncludeReceiving, } return nil } @@ -29,12 +29,12 @@ func (x *ModifyNotifyingAddressesTxsRequestMessage) toAppMessage() (appmessage.M return nil, errors.Wrapf(errorNil, "ModifyNotifyingAddressesTxsRequestMessage is nil") } return &appmessage.ModifyNotifyingAddressesTxsRequestMessage{ - AddAddresses: x.AddAddresses, - RemoveAddresses: x.RemoveAddresses, + AddAddresses: x.AddAddresses, + RemoveAddresses: x.RemoveAddresses, RequiredConfirmations: x.RequiredConfirmations, - IncludePending: x.IncludePending, - IncludeSending: x.IncludeSending, - IncludeReceiving: x.IncludeReceiving, + IncludePending: x.IncludePending, + IncludeSending: x.IncludeSending, + IncludeReceiving: x.IncludeReceiving, }, nil } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_txs_confirmation_changed.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_txs_confirmation_changed.go index 01bcef4bd..6c3b80054 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_txs_confirmation_changed.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_modify_notifying_txs_confirmation_changed.go @@ -14,10 +14,10 @@ func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedRequest) toAppMessag func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedRequest) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage) error { x.ModifyNotifyingTxsConfirmationChangedRequest = &ModifyNotifyingTxsConfirmationChangedRequestMessage{ - AddTxIDs: message.AddTxIDs, - RemoveTxIDs: message.RemoveTxIDs, + AddTxIDs: message.AddTxIDs, + RemoveTxIDs: message.RemoveTxIDs, RequiredConfirmations: message.RequiredConfirmations, - IncludePending: message.IncludePending, + IncludePending: message.IncludePending, } return nil } @@ -27,10 +27,10 @@ func (x *ModifyNotifyingTxsConfirmationChangedRequestMessage) toAppMessage() (ap return nil, errors.Wrapf(errorNil, "ModifyNotifyingTxsConfirmationChangedRequestMessage is nil") } return &appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage{ - AddTxIDs: x.AddTxIDs, - RemoveTxIDs: x.RemoveTxIDs, + AddTxIDs: x.AddTxIDs, + RemoveTxIDs: x.RemoveTxIDs, RequiredConfirmations: x.RequiredConfirmations, - IncludePending: x.IncludePending, + IncludePending: x.IncludePending, }, nil } @@ -55,7 +55,6 @@ func (x *ModifyNotifyingTxsConfirmationChangedResponseMessage) toAppMessage() (a }, nil } - func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedResponse) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedResponseMessage) error { var err *RPCError if message.Error != nil { diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_addresses_txs.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_addresses_txs.go index 5b0c7ce5a..7fc4ef1e6 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_addresses_txs.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_addresses_txs.go @@ -14,11 +14,11 @@ func (x *KaspadMessage_NotifyAddressesTxsRequest) toAppMessage() (appmessage.Mes func (x *KaspadMessage_NotifyAddressesTxsRequest) fromAppMessage(message *appmessage.NotifyAddressesTxsRequestMessage) error { x.NotifyAddressesTxsRequest = &NotifyAddressesTxsRequestMessage{ - Addresses : message.Addresses, + Addresses: message.Addresses, RequiredConfirmations: message.RequiredConfirmations, - IncludePending: message.IncludePending, - IncludeSending: message.IncludeSending, - IncludeReceiving: message.IncludeReceiving, + IncludePending: message.IncludePending, + IncludeSending: message.IncludeSending, + IncludeReceiving: message.IncludeReceiving, } return nil } @@ -28,11 +28,11 @@ func (x *NotifyAddressesTxsRequestMessage) toAppMessage() (appmessage.Message, e return nil, errors.Wrapf(errorNil, "NotifyAddressesTxsRequestMessage is nil") } return &appmessage.NotifyAddressesTxsRequestMessage{ - Addresses : x.Addresses, + Addresses: x.Addresses, RequiredConfirmations: x.RequiredConfirmations, - IncludePending: x.IncludePending, - IncludeSending: x.IncludeSending, - IncludeReceiving: x.IncludeReceiving, + IncludePending: x.IncludePending, + IncludeSending: x.IncludeSending, + IncludeReceiving: x.IncludeReceiving, }, nil } @@ -88,9 +88,9 @@ func (x *KaspadMessage_AddressesTxsNotification) fromAppMessage(message *appmess x.AddressesTxsNotification = &AddressesTxsNotificationMessage{ RequiredConfirmations: message.RequiredConfirmations, - Pending: pending, - Confirmed: confirmed, - Unconfirmed: unconfirmed, + Pending: pending, + Confirmed: confirmed, + Unconfirmed: unconfirmed, } return nil } @@ -116,13 +116,12 @@ func (x *AddressesTxsNotificationMessage) toAppMessage() (appmessage.Message, er return &appmessage.AddressesTxsNotificationMessage{ RequiredConfirmations: x.RequiredConfirmations, - Pending: pending, - Confirmed: confirmed, - Unconfirmed: unconfirmed, + Pending: pending, + Confirmed: confirmed, + Unconfirmed: unconfirmed, }, nil } - func (x *TxEntriesByAddresses) toAppMessage() (*appmessage.TxEntriesByAddresses, error) { if x == nil { return nil, errors.Wrapf(errorNil, "TxEntriesByAddresses is nil") @@ -146,10 +145,9 @@ func (x *TxEntriesByAddresses) toAppMessage() (*appmessage.TxEntriesByAddresses, received[i] = entry } - return &appmessage.TxEntriesByAddresses{ - Sent: sent, - Received: received, + Sent: sent, + Received: received, }, nil } @@ -168,8 +166,8 @@ func (x *TxEntriesByAddresses) fromAppMessage(message *appmessage.TxEntriesByAdd } *x = TxEntriesByAddresses{ - Sent: sent, - Received: received, + Sent: sent, + Received: received, } } @@ -179,8 +177,8 @@ func (x *TxEntryByAddress) toAppMessage() (*appmessage.TxEntryByAddress, error) } return &appmessage.TxEntryByAddress{ - Address: x.Address, - TxID: x.TxId, + Address: x.Address, + TxID: x.TxId, Confirmations: x.Confirmations, }, nil } @@ -188,8 +186,8 @@ func (x *TxEntryByAddress) toAppMessage() (*appmessage.TxEntryByAddress, error) func (x *TxEntryByAddress) fromAppMessage(message *appmessage.TxEntryByAddress) { *x = TxEntryByAddress{ - Address: message.Address, - TxId: message.TxID, + Address: message.Address, + TxId: message.TxID, Confirmations: message.Confirmations, } } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_txs_confirmation_changed.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_txs_confirmation_changed.go index 7107761a7..ffbc203e9 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_txs_confirmation_changed.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_notify_txs_confirmation_changed.go @@ -14,9 +14,9 @@ func (x *KaspadMessage_NotifyTxsConfirmationChangedRequst) toAppMessage() (appme func (x *KaspadMessage_NotifyTxsConfirmationChangedRequst) fromAppMessage(message *appmessage.NotifyTxsConfirmationChangedRequestMessage) error { x.NotifyTxsConfirmationChangedRequst = &NotifyTxsConfirmationChangedRequestMessage{ - TxIDs: message.TxIDs, + TxIDs: message.TxIDs, RequiredConfirmations: message.RequiredConfirmations, - IncludePending: message.IncludePending, + IncludePending: message.IncludePending, } return nil } @@ -26,9 +26,9 @@ func (x *NotifyTxsConfirmationChangedRequestMessage) toAppMessage() (appmessage. return nil, errors.Wrapf(errorNil, "NotifyTxsConfirmationChangedRequestMessage is nil") } return &appmessage.NotifyTxsConfirmationChangedRequestMessage{ - TxIDs: x.TxIDs, + TxIDs: x.TxIDs, RequiredConfirmations: x.RequiredConfirmations, - IncludePending: x.IncludePending, + IncludePending: x.IncludePending, }, nil } @@ -86,9 +86,9 @@ func (x *KaspadMessage_TxsConfirmationChangedNotification) fromAppMessage(messag x.TxsConfirmationChangedNotification = &TxsConfirmationChangedNotificationMessage{ RequiredConfirmations: message.RequiredConfirmations, - Pending: pending, - Confirmed: confirmed, - UnconfirmedTxIds : message.UnconfirmedTxIds , + Pending: pending, + Confirmed: confirmed, + UnconfirmedTxIds: message.UnconfirmedTxIds, } return nil } @@ -117,8 +117,8 @@ func (x *TxsConfirmationChangedNotificationMessage) toAppMessage() (appmessage.M return &appmessage.TxsConfirmationChangedNotificationMessage{ RequiredConfirmations: x.RequiredConfirmations, - Pending: pending, - Confirmed: confirmed, - UnconfirmedTxIds: x.UnconfirmedTxIds, + Pending: pending, + Confirmed: confirmed, + UnconfirmedTxIds: x.UnconfirmedTxIds, }, nil } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_submit_transaction.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_submit_transaction.go index 6741481f0..b43760b95 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_submit_transaction.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc_submit_transaction.go @@ -294,27 +294,27 @@ func (x *RpcTransactionVerboseData) toAppMessage() (*appmessage.RPCTransactionVe return nil, errors.Wrapf(errorNil, "RpcTransactionVerboseData is nil") } return &appmessage.RPCTransactionVerboseData{ - TransactionID: x.TransactionId, - Hash: x.Hash, - Mass: x.Mass, - BlockHash: x.BlockHash, - BlockTime: x.BlockTime, - TxIndexed: x.TxIndexed, - AcceptingBlockHash: x.AcceptingBlockHash, - Confirmations: x.Confirmations, + TransactionID: x.TransactionId, + Hash: x.Hash, + Mass: x.Mass, + BlockHash: x.BlockHash, + BlockTime: x.BlockTime, + TxIndexed: x.TxIndexed, + AcceptingBlockHash: x.AcceptingBlockHash, + Confirmations: x.Confirmations, }, nil } func (x *RpcTransactionVerboseData) fromAppMessage(message *appmessage.RPCTransactionVerboseData) { *x = RpcTransactionVerboseData{ - TransactionId: message.TransactionID, - Hash: message.Hash, - Mass: message.Mass, - BlockHash: message.BlockHash, - BlockTime: message.BlockTime, - TxIndexed: message.TxIndexed, - AcceptingBlockHash: message.AcceptingBlockHash, - Confirmations: message.Confirmations, + TransactionId: message.TransactionID, + Hash: message.Hash, + Mass: message.Mass, + BlockHash: message.BlockHash, + BlockTime: message.BlockTime, + TxIndexed: message.TxIndexed, + AcceptingBlockHash: message.AcceptingBlockHash, + Confirmations: message.Confirmations, } }