fix fmt and linting

This commit is contained in:
D-Stacks 2022-10-16 13:44:48 +02:00
parent e9f7169d99
commit ee09eb568a
12 changed files with 153 additions and 155 deletions

View File

@ -322,16 +322,16 @@ var RPCMessageCommandToString = map[MessageCommand]string{
CmdGetTxsResponseMessage: "GetTxsResponse", CmdGetTxsResponseMessage: "GetTxsResponse",
CmdGetTxsConfirmationsRequestMessage: "GetTxsConfirmationsRequest", CmdGetTxsConfirmationsRequestMessage: "GetTxsConfirmationsRequest",
CmdGetTxsConfirmationsResponseMessage: "GetTxsConfirmationsResponse", CmdGetTxsConfirmationsResponseMessage: "GetTxsConfirmationsResponse",
CmdNotifyTxsConfirmationChangedRequestMessage: "NotifyTxsConfirmationChangedRequest", CmdNotifyTxsConfirmationChangedRequestMessage: "NotifyTxsConfirmationChangedRequest",
CmdNotifyTxsConfirmationChangedResponseMessage: "ModifyNotifyingTxsConfirmationChangedRequest", CmdNotifyTxsConfirmationChangedResponseMessage: "ModifyNotifyingTxsConfirmationChangedRequest",
CmdModifyNotifyingTxsConfirmationChangedRequestMessage: "ModifyNotifyingTxsConfirmationChangedResponse", CmdModifyNotifyingTxsConfirmationChangedRequestMessage: "ModifyNotifyingTxsConfirmationChangedResponse",
CmdModifyNotifyingTxsConfirmationChangedResponseMessage: "TxsConfirmationChangedNotification", CmdModifyNotifyingTxsConfirmationChangedResponseMessage: "TxsConfirmationChangedNotification",
CmdTxsConfirmationChangedNotificationMessage: "TxsConfirmationChangedNotification", CmdTxsConfirmationChangedNotificationMessage: "TxsConfirmationChangedNotification",
CmdNotifyAddressesTxsRequestMessage: "NotifyAddressesTxsRequest", CmdNotifyAddressesTxsRequestMessage: "NotifyAddressesTxsRequest",
CmdNotifyAddressesTxsResponseMessage: "NotifyAddressesTxsResponse", CmdNotifyAddressesTxsResponseMessage: "NotifyAddressesTxsResponse",
CmdModifyNotifyingAddressesTxsRequestMessage: "ModifyNotifyingAddressesTxsRequest", CmdModifyNotifyingAddressesTxsRequestMessage: "ModifyNotifyingAddressesTxsRequest",
CmdModifyNotifyingAddressesTxsResponseMessage: "ModifyNotifyingAddressesTxsResponse", CmdModifyNotifyingAddressesTxsResponseMessage: "ModifyNotifyingAddressesTxsResponse",
CmdAddressesTxsNotificationMessage: "AddressesTxsNotification", CmdAddressesTxsNotificationMessage: "AddressesTxsNotification",
} }
// Message is an interface that describes a kaspa message. A type that // Message is an interface that describes a kaspa message. A type that

View File

@ -24,8 +24,8 @@ type GetInfoResponseMessage struct {
MempoolSize uint64 MempoolSize uint64
ServerVersion string ServerVersion string
IsUtxoIndexed bool IsUtxoIndexed bool
IsTxIndexed bool IsTxIndexed bool
IsArchival bool IsArchival bool
IsSynced bool IsSynced bool
Error *RPCError Error *RPCError
@ -37,15 +37,15 @@ func (msg *GetInfoResponseMessage) Command() MessageCommand {
} }
// NewGetInfoResponseMessage returns a instance of the message // 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 { isTxIndexed bool, isArchival bool, isSynced bool) *GetInfoResponseMessage {
return &GetInfoResponseMessage{ return &GetInfoResponseMessage{
P2PID: p2pID, P2PID: p2pID,
MempoolSize: mempoolSize, MempoolSize: mempoolSize,
ServerVersion: serverVersion, ServerVersion: serverVersion,
IsUtxoIndexed: isUtxoIndexed, IsUtxoIndexed: isUtxoIndexed,
IsTxIndexed: isTxIndexed, IsTxIndexed: isTxIndexed,
IsArchival: isArchival, IsArchival: isArchival,
IsSynced: isSynced, IsSynced: isSynced,
} }
} }

View File

@ -1,13 +1,15 @@
package appmessage package appmessage
// ModifyNotifyingAddressesTxsRequestMessage is an appmessage corresponding to
// its respective RPC message
type ModifyNotifyingAddressesTxsRequestMessage struct { type ModifyNotifyingAddressesTxsRequestMessage struct {
baseMessage baseMessage
AddAddresses []string AddAddresses []string
RemoveAddresses []string RemoveAddresses []string
RequiredConfirmations uint32 RequiredConfirmations uint32
IncludePending bool IncludePending bool
IncludeSending bool IncludeSending bool
IncludeReceiving bool IncludeReceiving bool
} }
// Command returns the protocol command string for the message // 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 // NewModifyNotifyingAddressesTxsRequestMessage returns a instance of the message
func NewModifyNotifyingAddressesTxsRequestMessage(addAddresses []string, removeAddresses []string, func NewModifyNotifyingAddressesTxsRequestMessage(addAddresses []string, removeAddresses []string,
requiredConfirmations uint32, includePending bool, includeSending bool, requiredConfirmations uint32, includePending bool, includeSending bool,
includeReceiving bool) *ModifyNotifyingAddressesTxsRequestMessage { includeReceiving bool) *ModifyNotifyingAddressesTxsRequestMessage {
return &ModifyNotifyingAddressesTxsRequestMessage{ return &ModifyNotifyingAddressesTxsRequestMessage{
AddAddresses: addAddresses, AddAddresses: addAddresses,
RemoveAddresses: removeAddresses, RemoveAddresses: removeAddresses,
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
IncludePending: includePending, IncludePending: includePending,
IncludeSending: includeSending, IncludeSending: includeSending,
IncludeReceiving: includeReceiving, IncludeReceiving: includeReceiving,
} }
} }
@ -41,7 +43,7 @@ func (msg *ModifyNotifyingAddressesTxsResponseMessage) Command() MessageCommand
return CmdModifyNotifyingAddressesTxsResponseMessage return CmdModifyNotifyingAddressesTxsResponseMessage
} }
// NewModifyNotifyingAddressesTxsesponseMessage returns a instance of the message // NewModifyNotifyingAddressesTxsResponseMessage returns a instance of the message
func NewModifyNotifyingAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage { func NewModifyNotifyingAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage {
return &NotifyAddressesTxsResponseMessage{} return &NotifyAddressesTxsResponseMessage{}
} }

View File

@ -1,11 +1,13 @@
package appmessage package appmessage
// ModifyNotifyingTxsConfirmationChangedRequestMessage is an appmessage corresponding to
// its respective RPC message
type ModifyNotifyingTxsConfirmationChangedRequestMessage struct { type ModifyNotifyingTxsConfirmationChangedRequestMessage struct {
baseMessage baseMessage
AddTxIDs []string AddTxIDs []string
RemoveTxIDs []string RemoveTxIDs []string
RequiredConfirmations uint32 RequiredConfirmations uint32
IncludePending bool IncludePending bool
} }
// Command returns the protocol command string for the message // 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 // NewModifyNotifyingTxsConfirmationChangedRequestMessage returns a instance of the message
func NewModifyNotifyingTxsConfirmationChangedRequestMessage(addTxIDs []string, removeTxIDs []string, func NewModifyNotifyingTxsConfirmationChangedRequestMessage(addTxIDs []string, removeTxIDs []string,
requiredConfirmations uint32, includePending bool) *ModifyNotifyingTxsConfirmationChangedRequestMessage { requiredConfirmations uint32, includePending bool) *ModifyNotifyingTxsConfirmationChangedRequestMessage {
return &ModifyNotifyingTxsConfirmationChangedRequestMessage{ return &ModifyNotifyingTxsConfirmationChangedRequestMessage{
AddTxIDs: addTxIDs, AddTxIDs: addTxIDs,
RemoveTxIDs: removeTxIDs, RemoveTxIDs: removeTxIDs,
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
IncludePending: includePending, IncludePending: includePending,
} }
} }
@ -36,7 +38,7 @@ func (msg *ModifyNotifyingTxsConfirmationChangedResponseMessage) Command() Messa
return CmdModifyNotifyingTxsConfirmationChangedResponseMessage return CmdModifyNotifyingTxsConfirmationChangedResponseMessage
} }
// NewModifyNotifyingTXChangedResponseMessage returns a instance of the message // NewModifyNotifyingTxsChangedResponseMessage returns a instance of the message
func NewModifyNotifyingTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage { func NewModifyNotifyingTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage {
return &NotifyTxsConfirmationChangedResponseMessage{} return &NotifyTxsConfirmationChangedResponseMessage{}
} }

View File

@ -1,15 +1,14 @@
package appmessage package appmessage
// NotifyAddressesTxsRequestMessage is an appmessage corresponding to // NotifyAddressesTxsRequestMessage is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type NotifyAddressesTxsRequestMessage struct { type NotifyAddressesTxsRequestMessage struct {
baseMessage baseMessage
Addresses []string Addresses []string
RequiredConfirmations uint32 RequiredConfirmations uint32
IncludePending bool IncludePending bool
IncludeSending bool IncludeSending bool
IncludeReceiving bool IncludeReceiving bool
} }
// Command returns the protocol command string for the message // 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 // 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 { includePending bool, includeSending bool, includeReceiving bool) *NotifyAddressesTxsRequestMessage {
return &NotifyAddressesTxsRequestMessage{ return &NotifyAddressesTxsRequestMessage{
Addresses: addresses, Addresses: addresses,
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
IncludePending: includePending, IncludePending: includePending,
IncludeSending: includeSending, IncludeSending: includeSending,
IncludeReceiving: includeReceiving, IncludeReceiving: includeReceiving,
} }
} }
@ -41,7 +40,7 @@ func (msg *NotifyAddressesTxsResponseMessage) Command() MessageCommand {
return CmdNotifyAddressesTxsResponseMessage return CmdNotifyAddressesTxsResponseMessage
} }
// NewNotifyTXChangedResponseMessage returns a instance of the message // NewNotifyAddressesTxsResponseMessage returns a instance of the message
func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage { func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage {
return &NotifyAddressesTxsResponseMessage{} return &NotifyAddressesTxsResponseMessage{}
} }
@ -51,10 +50,9 @@ func NewNotifyAddressesTxsResponseMessage() *NotifyAddressesTxsResponseMessage {
type AddressesTxsNotificationMessage struct { type AddressesTxsNotificationMessage struct {
baseMessage baseMessage
RequiredConfirmations uint32 RequiredConfirmations uint32
Pending *TxEntriesByAddresses Pending *TxEntriesByAddresses
Confirmed *TxEntriesByAddresses Confirmed *TxEntriesByAddresses
Unconfirmed *TxEntriesByAddresses Unconfirmed *TxEntriesByAddresses
} }
// Command returns the protocol command string for the message // 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 // NewAddressesTxsNotificationMessage returns a instance of the message
func NewAddressesTxsNotificationMessage(requiredConfirmations uint32, pending *TxEntriesByAddresses, func NewAddressesTxsNotificationMessage(requiredConfirmations uint32, pending *TxEntriesByAddresses,
confirmed *TxEntriesByAddresses, unconfirmed *TxEntriesByAddresses) *AddressesTxsNotificationMessage { confirmed *TxEntriesByAddresses, unconfirmed *TxEntriesByAddresses) *AddressesTxsNotificationMessage {
return &AddressesTxsNotificationMessage{ return &AddressesTxsNotificationMessage{
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
Unconfirmed: unconfirmed, Unconfirmed: unconfirmed,
} }
} }
// TxEntriesByAddresses is an appmessage corresponding to // TxEntriesByAddresses is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type TxEntriesByAddresses struct { type TxEntriesByAddresses struct {
Sent []*TxEntryByAddress Sent []*TxEntryByAddress
Received []*TxEntryByAddress Received []*TxEntryByAddress
} }
// TxEntryByAddress is an appmessage corresponding to // TxEntryByAddress is an appmessage corresponding to
// its respective RPC message // its respective RPC message
type TxEntryByAddress struct { type TxEntryByAddress struct {
Address string Address string
TxID string TxID string
Confirmations uint32 Confirmations uint32
} }

View File

@ -4,9 +4,9 @@ package appmessage
// its respective RPC message // its respective RPC message
type NotifyTxsConfirmationChangedRequestMessage struct { type NotifyTxsConfirmationChangedRequestMessage struct {
baseMessage baseMessage
TxIDs []string TxIDs []string
RequiredConfirmations uint32 RequiredConfirmations uint32
IncludePending bool IncludePending bool
} }
// Command returns the protocol command string for the message // 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 // NewNotifyTxsConfirmationChangedRequestMessage returns a instance of the message
func NewNotifyTxsConfirmationChangedRequestMessage(TxIDs []string, requiredConfirmations uint32, func NewNotifyTxsConfirmationChangedRequestMessage(TxIDs []string, requiredConfirmations uint32,
includePending bool) *NotifyTxsConfirmationChangedRequestMessage { includePending bool) *NotifyTxsConfirmationChangedRequestMessage {
return &NotifyTxsConfirmationChangedRequestMessage{ return &NotifyTxsConfirmationChangedRequestMessage{
TxIDs: TxIDs, TxIDs: TxIDs,
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
IncludePending: includePending, IncludePending: includePending,
} }
} }
@ -36,7 +36,7 @@ func (msg *NotifyTxsConfirmationChangedResponseMessage) Command() MessageCommand
return CmdNotifyTxsConfirmationChangedResponseMessage return CmdNotifyTxsConfirmationChangedResponseMessage
} }
// NewNotifyTXChangedResponseMessage returns a instance of the message // NewNotifyTxsChangedResponseMessage returns a instance of the message
func NewNotifyTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage { func NewNotifyTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseMessage {
return &NotifyTxsConfirmationChangedResponseMessage{} return &NotifyTxsConfirmationChangedResponseMessage{}
} }
@ -46,10 +46,9 @@ func NewNotifyTxsChangedResponseMessage() *NotifyTxsConfirmationChangedResponseM
type TxsConfirmationChangedNotificationMessage struct { type TxsConfirmationChangedNotificationMessage struct {
baseMessage baseMessage
RequiredConfirmations uint32 RequiredConfirmations uint32
Pending []*TxIDConfirmationsPair Pending []*TxIDConfirmationsPair
Confirmed []*TxIDConfirmationsPair Confirmed []*TxIDConfirmationsPair
UnconfirmedTxIds []string UnconfirmedTxIds []string
} }
// Command returns the protocol command string for the message // 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 // NewTxsChangedNotificationMessage returns a instance of the message
func NewTxsChangedNotificationMessage(requiredConfirmations uint32, pending []*TxIDConfirmationsPair, func NewTxsChangedNotificationMessage(requiredConfirmations uint32, pending []*TxIDConfirmationsPair,
confirmed []*TxIDConfirmationsPair, unconfirmedTxIds []string) *TxsConfirmationChangedNotificationMessage { confirmed []*TxIDConfirmationsPair, unconfirmedTxIds []string) *TxsConfirmationChangedNotificationMessage {
return &TxsConfirmationChangedNotificationMessage{ return &TxsConfirmationChangedNotificationMessage{
RequiredConfirmations: requiredConfirmations, RequiredConfirmations: requiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
UnconfirmedTxIds : unconfirmedTxIds , UnconfirmedTxIds: unconfirmedTxIds,
} }
} }

View File

@ -97,12 +97,12 @@ type RPCUTXOEntry struct {
// RPCTransactionVerboseData holds verbose data about a transaction // RPCTransactionVerboseData holds verbose data about a transaction
type RPCTransactionVerboseData struct { type RPCTransactionVerboseData struct {
TransactionID string TransactionID string
Hash string Hash string
Mass uint64 Mass uint64
BlockHash string BlockHash string
BlockTime uint64 BlockTime uint64
TxIndexed bool TxIndexed bool
AcceptingBlockHash string AcceptingBlockHash string
Confirmations uint32 Confirmations uint32
} }

View File

@ -14,12 +14,12 @@ func (x *KaspadMessage_ModifyNotifyingAddressesTxsRequest) toAppMessage() (appme
func (x *KaspadMessage_ModifyNotifyingAddressesTxsRequest) fromAppMessage(message *appmessage.ModifyNotifyingAddressesTxsRequestMessage) error { func (x *KaspadMessage_ModifyNotifyingAddressesTxsRequest) fromAppMessage(message *appmessage.ModifyNotifyingAddressesTxsRequestMessage) error {
x.ModifyNotifyingAddressesTxsRequest = &ModifyNotifyingAddressesTxsRequestMessage{ x.ModifyNotifyingAddressesTxsRequest = &ModifyNotifyingAddressesTxsRequestMessage{
AddAddresses: message.AddAddresses, AddAddresses: message.AddAddresses,
RemoveAddresses: message.RemoveAddresses, RemoveAddresses: message.RemoveAddresses,
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
IncludePending: message.IncludePending, IncludePending: message.IncludePending,
IncludeSending: message.IncludeSending, IncludeSending: message.IncludeSending,
IncludeReceiving: message.IncludeReceiving, IncludeReceiving: message.IncludeReceiving,
} }
return nil return nil
} }
@ -29,12 +29,12 @@ func (x *ModifyNotifyingAddressesTxsRequestMessage) toAppMessage() (appmessage.M
return nil, errors.Wrapf(errorNil, "ModifyNotifyingAddressesTxsRequestMessage is nil") return nil, errors.Wrapf(errorNil, "ModifyNotifyingAddressesTxsRequestMessage is nil")
} }
return &appmessage.ModifyNotifyingAddressesTxsRequestMessage{ return &appmessage.ModifyNotifyingAddressesTxsRequestMessage{
AddAddresses: x.AddAddresses, AddAddresses: x.AddAddresses,
RemoveAddresses: x.RemoveAddresses, RemoveAddresses: x.RemoveAddresses,
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
IncludePending: x.IncludePending, IncludePending: x.IncludePending,
IncludeSending: x.IncludeSending, IncludeSending: x.IncludeSending,
IncludeReceiving: x.IncludeReceiving, IncludeReceiving: x.IncludeReceiving,
}, nil }, nil
} }

View File

@ -14,10 +14,10 @@ func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedRequest) toAppMessag
func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedRequest) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage) error { func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedRequest) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage) error {
x.ModifyNotifyingTxsConfirmationChangedRequest = &ModifyNotifyingTxsConfirmationChangedRequestMessage{ x.ModifyNotifyingTxsConfirmationChangedRequest = &ModifyNotifyingTxsConfirmationChangedRequestMessage{
AddTxIDs: message.AddTxIDs, AddTxIDs: message.AddTxIDs,
RemoveTxIDs: message.RemoveTxIDs, RemoveTxIDs: message.RemoveTxIDs,
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
IncludePending: message.IncludePending, IncludePending: message.IncludePending,
} }
return nil return nil
} }
@ -27,10 +27,10 @@ func (x *ModifyNotifyingTxsConfirmationChangedRequestMessage) toAppMessage() (ap
return nil, errors.Wrapf(errorNil, "ModifyNotifyingTxsConfirmationChangedRequestMessage is nil") return nil, errors.Wrapf(errorNil, "ModifyNotifyingTxsConfirmationChangedRequestMessage is nil")
} }
return &appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage{ return &appmessage.ModifyNotifyingTxsConfirmationChangedRequestMessage{
AddTxIDs: x.AddTxIDs, AddTxIDs: x.AddTxIDs,
RemoveTxIDs: x.RemoveTxIDs, RemoveTxIDs: x.RemoveTxIDs,
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
IncludePending: x.IncludePending, IncludePending: x.IncludePending,
}, nil }, nil
} }
@ -55,7 +55,6 @@ func (x *ModifyNotifyingTxsConfirmationChangedResponseMessage) toAppMessage() (a
}, nil }, nil
} }
func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedResponse) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedResponseMessage) error { func (x *KaspadMessage_ModifyNotifyingTxsConfirmationChangedResponse) fromAppMessage(message *appmessage.ModifyNotifyingTxsConfirmationChangedResponseMessage) error {
var err *RPCError var err *RPCError
if message.Error != nil { if message.Error != nil {

View File

@ -14,11 +14,11 @@ func (x *KaspadMessage_NotifyAddressesTxsRequest) toAppMessage() (appmessage.Mes
func (x *KaspadMessage_NotifyAddressesTxsRequest) fromAppMessage(message *appmessage.NotifyAddressesTxsRequestMessage) error { func (x *KaspadMessage_NotifyAddressesTxsRequest) fromAppMessage(message *appmessage.NotifyAddressesTxsRequestMessage) error {
x.NotifyAddressesTxsRequest = &NotifyAddressesTxsRequestMessage{ x.NotifyAddressesTxsRequest = &NotifyAddressesTxsRequestMessage{
Addresses : message.Addresses, Addresses: message.Addresses,
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
IncludePending: message.IncludePending, IncludePending: message.IncludePending,
IncludeSending: message.IncludeSending, IncludeSending: message.IncludeSending,
IncludeReceiving: message.IncludeReceiving, IncludeReceiving: message.IncludeReceiving,
} }
return nil return nil
} }
@ -28,11 +28,11 @@ func (x *NotifyAddressesTxsRequestMessage) toAppMessage() (appmessage.Message, e
return nil, errors.Wrapf(errorNil, "NotifyAddressesTxsRequestMessage is nil") return nil, errors.Wrapf(errorNil, "NotifyAddressesTxsRequestMessage is nil")
} }
return &appmessage.NotifyAddressesTxsRequestMessage{ return &appmessage.NotifyAddressesTxsRequestMessage{
Addresses : x.Addresses, Addresses: x.Addresses,
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
IncludePending: x.IncludePending, IncludePending: x.IncludePending,
IncludeSending: x.IncludeSending, IncludeSending: x.IncludeSending,
IncludeReceiving: x.IncludeReceiving, IncludeReceiving: x.IncludeReceiving,
}, nil }, nil
} }
@ -88,9 +88,9 @@ func (x *KaspadMessage_AddressesTxsNotification) fromAppMessage(message *appmess
x.AddressesTxsNotification = &AddressesTxsNotificationMessage{ x.AddressesTxsNotification = &AddressesTxsNotificationMessage{
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
Unconfirmed: unconfirmed, Unconfirmed: unconfirmed,
} }
return nil return nil
} }
@ -116,13 +116,12 @@ func (x *AddressesTxsNotificationMessage) toAppMessage() (appmessage.Message, er
return &appmessage.AddressesTxsNotificationMessage{ return &appmessage.AddressesTxsNotificationMessage{
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
Unconfirmed: unconfirmed, Unconfirmed: unconfirmed,
}, nil }, nil
} }
func (x *TxEntriesByAddresses) toAppMessage() (*appmessage.TxEntriesByAddresses, error) { func (x *TxEntriesByAddresses) toAppMessage() (*appmessage.TxEntriesByAddresses, error) {
if x == nil { if x == nil {
return nil, errors.Wrapf(errorNil, "TxEntriesByAddresses is nil") return nil, errors.Wrapf(errorNil, "TxEntriesByAddresses is nil")
@ -146,10 +145,9 @@ func (x *TxEntriesByAddresses) toAppMessage() (*appmessage.TxEntriesByAddresses,
received[i] = entry received[i] = entry
} }
return &appmessage.TxEntriesByAddresses{ return &appmessage.TxEntriesByAddresses{
Sent: sent, Sent: sent,
Received: received, Received: received,
}, nil }, nil
} }
@ -168,8 +166,8 @@ func (x *TxEntriesByAddresses) fromAppMessage(message *appmessage.TxEntriesByAdd
} }
*x = TxEntriesByAddresses{ *x = TxEntriesByAddresses{
Sent: sent, Sent: sent,
Received: received, Received: received,
} }
} }
@ -179,8 +177,8 @@ func (x *TxEntryByAddress) toAppMessage() (*appmessage.TxEntryByAddress, error)
} }
return &appmessage.TxEntryByAddress{ return &appmessage.TxEntryByAddress{
Address: x.Address, Address: x.Address,
TxID: x.TxId, TxID: x.TxId,
Confirmations: x.Confirmations, Confirmations: x.Confirmations,
}, nil }, nil
} }
@ -188,8 +186,8 @@ func (x *TxEntryByAddress) toAppMessage() (*appmessage.TxEntryByAddress, error)
func (x *TxEntryByAddress) fromAppMessage(message *appmessage.TxEntryByAddress) { func (x *TxEntryByAddress) fromAppMessage(message *appmessage.TxEntryByAddress) {
*x = TxEntryByAddress{ *x = TxEntryByAddress{
Address: message.Address, Address: message.Address,
TxId: message.TxID, TxId: message.TxID,
Confirmations: message.Confirmations, Confirmations: message.Confirmations,
} }
} }

View File

@ -14,9 +14,9 @@ func (x *KaspadMessage_NotifyTxsConfirmationChangedRequst) toAppMessage() (appme
func (x *KaspadMessage_NotifyTxsConfirmationChangedRequst) fromAppMessage(message *appmessage.NotifyTxsConfirmationChangedRequestMessage) error { func (x *KaspadMessage_NotifyTxsConfirmationChangedRequst) fromAppMessage(message *appmessage.NotifyTxsConfirmationChangedRequestMessage) error {
x.NotifyTxsConfirmationChangedRequst = &NotifyTxsConfirmationChangedRequestMessage{ x.NotifyTxsConfirmationChangedRequst = &NotifyTxsConfirmationChangedRequestMessage{
TxIDs: message.TxIDs, TxIDs: message.TxIDs,
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
IncludePending: message.IncludePending, IncludePending: message.IncludePending,
} }
return nil return nil
} }
@ -26,9 +26,9 @@ func (x *NotifyTxsConfirmationChangedRequestMessage) toAppMessage() (appmessage.
return nil, errors.Wrapf(errorNil, "NotifyTxsConfirmationChangedRequestMessage is nil") return nil, errors.Wrapf(errorNil, "NotifyTxsConfirmationChangedRequestMessage is nil")
} }
return &appmessage.NotifyTxsConfirmationChangedRequestMessage{ return &appmessage.NotifyTxsConfirmationChangedRequestMessage{
TxIDs: x.TxIDs, TxIDs: x.TxIDs,
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
IncludePending: x.IncludePending, IncludePending: x.IncludePending,
}, nil }, nil
} }
@ -86,9 +86,9 @@ func (x *KaspadMessage_TxsConfirmationChangedNotification) fromAppMessage(messag
x.TxsConfirmationChangedNotification = &TxsConfirmationChangedNotificationMessage{ x.TxsConfirmationChangedNotification = &TxsConfirmationChangedNotificationMessage{
RequiredConfirmations: message.RequiredConfirmations, RequiredConfirmations: message.RequiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
UnconfirmedTxIds : message.UnconfirmedTxIds , UnconfirmedTxIds: message.UnconfirmedTxIds,
} }
return nil return nil
} }
@ -117,8 +117,8 @@ func (x *TxsConfirmationChangedNotificationMessage) toAppMessage() (appmessage.M
return &appmessage.TxsConfirmationChangedNotificationMessage{ return &appmessage.TxsConfirmationChangedNotificationMessage{
RequiredConfirmations: x.RequiredConfirmations, RequiredConfirmations: x.RequiredConfirmations,
Pending: pending, Pending: pending,
Confirmed: confirmed, Confirmed: confirmed,
UnconfirmedTxIds: x.UnconfirmedTxIds, UnconfirmedTxIds: x.UnconfirmedTxIds,
}, nil }, nil
} }

View File

@ -294,27 +294,27 @@ func (x *RpcTransactionVerboseData) toAppMessage() (*appmessage.RPCTransactionVe
return nil, errors.Wrapf(errorNil, "RpcTransactionVerboseData is nil") return nil, errors.Wrapf(errorNil, "RpcTransactionVerboseData is nil")
} }
return &appmessage.RPCTransactionVerboseData{ return &appmessage.RPCTransactionVerboseData{
TransactionID: x.TransactionId, TransactionID: x.TransactionId,
Hash: x.Hash, Hash: x.Hash,
Mass: x.Mass, Mass: x.Mass,
BlockHash: x.BlockHash, BlockHash: x.BlockHash,
BlockTime: x.BlockTime, BlockTime: x.BlockTime,
TxIndexed: x.TxIndexed, TxIndexed: x.TxIndexed,
AcceptingBlockHash: x.AcceptingBlockHash, AcceptingBlockHash: x.AcceptingBlockHash,
Confirmations: x.Confirmations, Confirmations: x.Confirmations,
}, nil }, nil
} }
func (x *RpcTransactionVerboseData) fromAppMessage(message *appmessage.RPCTransactionVerboseData) { func (x *RpcTransactionVerboseData) fromAppMessage(message *appmessage.RPCTransactionVerboseData) {
*x = RpcTransactionVerboseData{ *x = RpcTransactionVerboseData{
TransactionId: message.TransactionID, TransactionId: message.TransactionID,
Hash: message.Hash, Hash: message.Hash,
Mass: message.Mass, Mass: message.Mass,
BlockHash: message.BlockHash, BlockHash: message.BlockHash,
BlockTime: message.BlockTime, BlockTime: message.BlockTime,
TxIndexed: message.TxIndexed, TxIndexed: message.TxIndexed,
AcceptingBlockHash: message.AcceptingBlockHash, AcceptingBlockHash: message.AcceptingBlockHash,
Confirmations: message.Confirmations, Confirmations: message.Confirmations,
} }
} }