mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 06:25:55 +00:00
fix fmt and linting
This commit is contained in:
parent
e9f7169d99
commit
ee09eb568a
@ -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
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@ -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{}
|
||||
}
|
||||
|
||||
@ -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{}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user