mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-29 10:16:45 +00:00

* Replace BlockMessage with RpcBlock in rpc.proto. * Convert everything in kaspad to use RPCBlocks and fix tests. * Fix compilation errors in stability tests and the miner. * Update TransactionVerboseData in rpc.proto. * Update TransactionVerboseData in the rest of kaspad. * Make golint happy. * Include RpcTransactionVerboseData in RpcTransaction instead of the other way around. * Regenerate rpc.pb.go after merge. * Update appmessage types. * Update appmessage request and response types. * Reimplement conversion functions between appmessage.RPCTransaction and protowire.RpcTransaction. * Extract RpcBlockHeader toAppMessage/fromAppMessage out of RpcBlock. * Fix compilation errors in getBlock, getBlocks, and submitBlock. * Fix compilation errors in getMempoolEntry. * Fix compilation errors in notifyBlockAdded. * Update verbosedata.go. * Fix compilation errors in getBlock and getBlocks. * Fix compilation errors in getBlocks tests. * Fix conversions between getBlocks message types. * Fix integration tests. * Fix a comment. * Add selectedParent to the verbose block response.
46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
package appmessage
|
|
|
|
// GetBlocksRequestMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetBlocksRequestMessage struct {
|
|
baseMessage
|
|
LowHash string
|
|
IncludeBlocks bool
|
|
IncludeTransactionVerboseData bool
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetBlocksRequestMessage) Command() MessageCommand {
|
|
return CmdGetBlocksRequestMessage
|
|
}
|
|
|
|
// NewGetBlocksRequestMessage returns a instance of the message
|
|
func NewGetBlocksRequestMessage(lowHash string, includeBlocks bool,
|
|
includeTransactionVerboseData bool) *GetBlocksRequestMessage {
|
|
return &GetBlocksRequestMessage{
|
|
LowHash: lowHash,
|
|
IncludeBlocks: includeBlocks,
|
|
IncludeTransactionVerboseData: includeTransactionVerboseData,
|
|
}
|
|
}
|
|
|
|
// GetBlocksResponseMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetBlocksResponseMessage struct {
|
|
baseMessage
|
|
BlockHashes []string
|
|
Blocks []*RPCBlock
|
|
|
|
Error *RPCError
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetBlocksResponseMessage) Command() MessageCommand {
|
|
return CmdGetBlocksResponseMessage
|
|
}
|
|
|
|
// NewGetBlocksResponseMessage returns a instance of the message
|
|
func NewGetBlocksResponseMessage() *GetBlocksResponseMessage {
|
|
return &GetBlocksResponseMessage{}
|
|
}
|