mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 14:35:53 +00:00
checkpoint: started work on handlers
This commit is contained in:
parent
38e9ab81e4
commit
e8e57fc2be
@ -5,6 +5,7 @@ package appmessage
|
|||||||
type GetAcceptingBlockOfTxRequestMessage struct {
|
type GetAcceptingBlockOfTxRequestMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
TxID string
|
TxID string
|
||||||
|
IncludeTransactions bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns the protocol command string for the message
|
// Command returns the protocol command string for the message
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package appmessage
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type TxIDBlockPair struct {
|
type TxIDBlockPair struct {
|
||||||
TxID string
|
TxID string
|
||||||
Block RPCBlock
|
Block *RPCBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAcceptingBlocksOfTxsRequestMessage is an appmessage corresponding to
|
// GetAcceptingBlocksOfTxsRequestMessage is an appmessage corresponding to
|
||||||
@ -12,6 +12,7 @@ type TxIDBlockPair struct {
|
|||||||
type GetAcceptingBlocksOfTxsRequestMessage struct {
|
type GetAcceptingBlocksOfTxsRequestMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
TxIDs []string
|
TxIDs []string
|
||||||
|
IncludeTransactions bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns the protocol command string for the message
|
// Command returns the protocol command string for the message
|
||||||
|
|||||||
64
app/rpc/rpchandlers/get_accepting_block_of_tx.go
Normal file
64
app/rpc/rpchandlers/get_accepting_block_of_tx.go
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetAcceptingBlockOfTx handles the respectively named RPC command
|
||||||
|
func HandleGetAcceptingBlockOfTx(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getAcceptingBlockHashOfTxRequest := request.(*appmessage.GetAcceptingBlockOfTxRequestMessage)
|
||||||
|
|
||||||
|
domainTxID, err := externalapi.NewDomainTransactionIDFromString(getAcceptingBlockHashOfTxRequest.TxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
acceptingBlock, found, err := context.TXIndex.TXAcceptingBlock(domainTxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Could not find accepting block in the txindex database for txID: %s", domainTxID.String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
rpcAcceptingBlock := appmessage.DomainBlockToRPCBlock(acceptingBlock)
|
||||||
|
err = context.PopulateBlockWithVerboseData(rpcAcceptingBlock, acceptingBlock.Header, acceptingBlock, getAcceptingBlockHashOfTxRequest.IncludeTransactions)
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, rpccontext.ErrBuildBlockVerboseDataInvalidBlock) {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Block %s is invalid", consensushashing.BlockHash(acceptingBlock).String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetAcceptingBlockOfTxResponse(rpcAcceptingBlock)
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
@ -25,7 +25,7 @@ func HandleGetAcceptingBlockHashOfTx(context *rpccontext.Context, _ *router.Rout
|
|||||||
if !errors.As(err, &rpcError) {
|
if !errors.As(err, &rpcError) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||||
errorMessage.Error = rpcError
|
errorMessage.Error = rpcError
|
||||||
return errorMessage, nil
|
return errorMessage, nil
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ func HandleGetAcceptingBlockHashOfTx(context *rpccontext.Context, _ *router.Rout
|
|||||||
if !errors.As(err, &rpcError) {
|
if !errors.As(err, &rpcError) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||||
errorMessage.Error = rpcError
|
errorMessage.Error = rpcError
|
||||||
return errorMessage, nil
|
return errorMessage, nil
|
||||||
}
|
}
|
||||||
57
app/rpc/rpchandlers/get_accepting_blockhashes_of_txs.go
Normal file
57
app/rpc/rpchandlers/get_accepting_blockhashes_of_txs.go
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetAcceptingBlockHashesOfTxs handles the respectively named RPC command
|
||||||
|
func HandleGetAcceptingBlockHashesOfTxs(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockHashesOfTxsResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getAcceptingBlockHashesOfTxsRequest := request.(*appmessage.GetAcceptingBlockHashesOfTxsRequestMessage)
|
||||||
|
|
||||||
|
domainTxIDs := make([]*externalapi.DomainTransactionID, len(getAcceptingBlockHashesOfTxsRequest.TxIDs))
|
||||||
|
for i := range domainTxIDs {
|
||||||
|
domainTxIDs[i], err = externalapi.NewDomainTransactionIDFromString(getAcceptingBlockHashesOfTxsRequest.TxIDs[i])
|
||||||
|
if err != nil {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockHashesOfTxsResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("error parsing txID: %s", getAcceptingBlockHashesOfTxsRequest.TxIDs[i])
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
acceptingBlockHashes, _, err := context.TXIndex.TXAcceptingBlockHashes(domainTxIDs)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
txIDBlockHashpairs := make([]*appmessage.TxIDBlockHashPair, len(acceptingBlockHashes))
|
||||||
|
i := 0
|
||||||
|
for txID, blockHash := range acceptingBlockHashes {
|
||||||
|
txIDBlockHashpairs[i] = &appmessage.TxIDBlockHashPair{
|
||||||
|
TxID: txID.String(),
|
||||||
|
Hash: blockHash.String(),
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetAcceptingBlockHashesOfTxsResponse(txIDBlockHashpairs)
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
68
app/rpc/rpchandlers/get_accepting_blocks_of_txs.go
Normal file
68
app/rpc/rpchandlers/get_accepting_blocks_of_txs.go
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetAcceptingBlocksOfTx handles the respectively named RPC command
|
||||||
|
func HandleGetAcceptingBlocksOfTx(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlocksOfTxsResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getAcceptingBlocksOfTxsRequest := request.(*appmessage.GetAcceptingBlocksOfTxsRequestMessage)
|
||||||
|
|
||||||
|
domainTxIDs := make([]*externalapi.DomainTransactionID, len(getAcceptingBlocksOfTxsRequest.TxIDs))
|
||||||
|
for i := range domainTxIDs {
|
||||||
|
domainTxIDs[i], err = externalapi.NewDomainTransactionIDFromString(getAcceptingBlocksOfTxsRequest.TxIDs[i])
|
||||||
|
if err != nil {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlocksOfTxsResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("error parsing txID: %s, %s", getAcceptingBlocksOfTxsRequest.TxIDs[i], err.Error())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
acceptingBlockHashes, _, err := context.TXIndex.TXAcceptingBlocks(domainTxIDs)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
txIDBlockPairs := make([]*appmessage.TxIDBlockPair, len(acceptingBlockHashes))
|
||||||
|
i := 0
|
||||||
|
for txID, acceptingBlock := range acceptingBlockHashes {
|
||||||
|
rpcAcceptingBlock := appmessage.DomainBlockToRPCBlock(acceptingBlock)
|
||||||
|
err = context.PopulateBlockWithVerboseData(rpcAcceptingBlock, acceptingBlock.Header, acceptingBlock, getAcceptingBlocksOfTxsRequest.IncludeTransactions)
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, rpccontext.ErrBuildBlockVerboseDataInvalidBlock) {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Block %s is invalid", consensushashing.BlockHash(acceptingBlock).String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
txIDBlockPairs[i] = &appmessage.TxIDBlockPair{
|
||||||
|
TxID: txID.String(),
|
||||||
|
Block: rpcAcceptingBlock,
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetAcceptingBlocksOfTxsResponse(txIDBlockPairs)
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
52
app/rpc/rpchandlers/get_including_blockhash_of_tx.go
Normal file
52
app/rpc/rpchandlers/get_including_blockhash_of_tx.go
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetIncludingBlockHashOfTx handles the respectively named RPC command
|
||||||
|
func HandleGetIncludingBlockHashOfTx(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetIncludingBlockHashOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getIncludingBlockHashOfTxRequest := request.(*appmessage.GetIncludingBlockHashOfTxRequestMessage)
|
||||||
|
|
||||||
|
domainTxID, err := externalapi.NewDomainTransactionIDFromString(getIncludingBlockHashOfTxRequest.TxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetIncludingBlockHashOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
includingBlockHash, found, err := context.TXIndex.TXIncludingBlockHash(domainTxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetIncludingBlockHashOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Could not find including block hash in the txindex database for txID: %s", domainTxID.String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetIncludingBlockHashOfTxResponse(includingBlockHash.String())
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
80
app/rpc/rpchandlers/get_tx.go
Normal file
80
app/rpc/rpchandlers/get_tx.go
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetTx handles the respectively named RPC command
|
||||||
|
func HandleGetTx(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getTxRequest := request.(*appmessage.GetTxRequestMessage)
|
||||||
|
|
||||||
|
domainTxID, err := externalapi.NewDomainTransactionIDFromString(getTxRequest.TxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
transaction, found, err := context.TXIndex.GetTX(domainTxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Could not find tx in the txindex database for txID: %s", domainTxID.String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
blockForVerboseData, found, err := context.TXIndex.TXAcceptingBlock(domainTxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Could not find accepting block in the txindex database for txID: %s", domainTxID.String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
|
||||||
|
err = context.PopulateTransactionWithVerboseData(rpcTransaction, blockForVerboseData.Header)
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, rpccontext.ErrBuildBlockVerboseDataInvalidBlock) {
|
||||||
|
errorMessage := &appmessage.GetTxResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Block %s is invalid", consensushashing.BlockHash(blockForVerboseData).String())
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetTxResponse(rpcTransaction)
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
47
app/rpc/rpchandlers/get_tx_confirmations.go
Normal file
47
app/rpc/rpchandlers/get_tx_confirmations.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetTxConfirmations handles the respectively named RPC command
|
||||||
|
func HandleGetTxConfirmations(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
if !context.Config.TXIndex {
|
||||||
|
errorMessage := &appmessage.GetTxConfirmationsResponseMessage{}
|
||||||
|
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --txindex")
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
getTxConfirmationsRequest := request.(*appmessage.GetTxConfirmationsRequestMessage)
|
||||||
|
|
||||||
|
domainTxID, err := externalapi.NewDomainTransactionIDFromString(getTxConfirmationsRequest.TxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetTxConfirmationsResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmations, _, err := context.TXIndex.GetTXConfirmations(domainTxID)
|
||||||
|
if err != nil {
|
||||||
|
rpcError := &appmessage.RPCError{}
|
||||||
|
if !errors.As(err, &rpcError) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
errorMessage := &appmessage.GetTxConfirmationsResponseMessage{}
|
||||||
|
errorMessage.Error = rpcError
|
||||||
|
return errorMessage, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
response := appmessage.NewGetTxConfirmationsResponse(confirmations)
|
||||||
|
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
12
app/rpc/rpchandlers/get_txs.go
Normal file
12
app/rpc/rpchandlers/get_txs.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetTxs handles the respectively named RPC command
|
||||||
|
func HandleGetTxs(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
12
app/rpc/rpchandlers/get_txs_confirmations.go
Normal file
12
app/rpc/rpchandlers/get_txs_confirmations.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package rpchandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
|
)
|
||||||
|
|
||||||
|
// HandleGetTxsConfirmations handles the respectively named RPC command
|
||||||
|
func HandleGetTxsConfirmations(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
@ -19,6 +19,9 @@ type TxIDsToBlockHashes map[*externalapi.DomainTransactionID]*externalapi.Domain
|
|||||||
//TxIDsToBlocks is a map of TxIDs to corrospnding blocks
|
//TxIDsToBlocks is a map of TxIDs to corrospnding blocks
|
||||||
type TxIDsToBlocks map[*externalapi.DomainTransactionID]*externalapi.DomainBlock
|
type TxIDsToBlocks map[*externalapi.DomainTransactionID]*externalapi.DomainBlock
|
||||||
|
|
||||||
|
//TxIDsToConfirmations is a map of TxIDs to corrospnding Confirmations
|
||||||
|
type TxIDsToConfirmations map[*externalapi.DomainTransactionID]int64
|
||||||
|
|
||||||
// ConvertDomainHashToString converts the given DomainHash to a string
|
// ConvertDomainHashToString converts the given DomainHash to a string
|
||||||
func ConvertDomainHashToString(blockHash *externalapi.DomainHash) string {
|
func ConvertDomainHashToString(blockHash *externalapi.DomainHash) string {
|
||||||
return hex.EncodeToString(blockHash.ByteSlice())
|
return hex.EncodeToString(blockHash.ByteSlice())
|
||||||
|
|||||||
@ -247,7 +247,7 @@ func (tis *txIndexStore) getTxAcceptingBlockHashes(txIDs []*externalapi.DomainTr
|
|||||||
serializedAcceptingBlockHash, err := tis.database.Get(key)
|
serializedAcceptingBlockHash, err := tis.database.Get(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if database.IsNotFoundError(err) {
|
if database.IsNotFoundError(err) {
|
||||||
return nil, false, nil
|
continue //ignore not found errors we expect this to happen frequently with queries
|
||||||
}
|
}
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -302,7 +302,7 @@ func (ti *TXIndex) TXAcceptingBlock(txID *externalapi.DomainTransactionID) (
|
|||||||
|
|
||||||
// TXAcceptingBlocks returns the accepting blocks for for the given txIDs
|
// TXAcceptingBlocks returns the accepting blocks for for the given txIDs
|
||||||
func (ti *TXIndex) TXAcceptingBlocks(txIDs []*externalapi.DomainTransactionID) (
|
func (ti *TXIndex) TXAcceptingBlocks(txIDs []*externalapi.DomainTransactionID) (
|
||||||
acceptingBlocks []*externalapi.DomainBlock, found bool, err error) {
|
acceptingBlocks TxIDsToBlocks, found bool, err error) {
|
||||||
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.TXAcceptingBlock")
|
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.TXAcceptingBlock")
|
||||||
defer onEnd()
|
defer onEnd()
|
||||||
|
|
||||||
@ -314,22 +314,19 @@ func (ti *TXIndex) TXAcceptingBlocks(txIDs []*externalapi.DomainTransactionID) (
|
|||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptingBlockHashes := make([]*externalapi.DomainHash, len(acceptingBlockHashTxIDPairs))
|
acceptingBlocks = make(TxIDsToBlocks)
|
||||||
|
|
||||||
i := 0
|
i := 0
|
||||||
for _, acceptingBlockHash := range acceptingBlockHashTxIDPairs {
|
for txID, blockHash := range acceptingBlockHashTxIDPairs {
|
||||||
acceptingBlockHashes[i] = acceptingBlockHash
|
acceptingBlocks[txID], err = ti.domain.Consensus().GetBlock(blockHash)
|
||||||
i++
|
|
||||||
}
|
|
||||||
|
|
||||||
if !found {
|
|
||||||
return nil, false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
acceptingBlocks, err = ti.domain.Consensus().GetBlocks(acceptingBlockHashes)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if database.IsNotFoundError(err) {
|
||||||
|
continue // ignore
|
||||||
|
} else {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
return acceptingBlocks, true, nil
|
return acceptingBlocks, true, nil
|
||||||
}
|
}
|
||||||
@ -365,9 +362,44 @@ func (ti *TXIndex) GetTX(txID *externalapi.DomainTransactionID) (
|
|||||||
return nil, false, fmt.Errorf("Could not find transaction with ID %s in Txindex database", txID.String())
|
return nil, false, fmt.Errorf("Could not find transaction with ID %s in Txindex database", txID.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTXs returns the domain transaction for for the given txIDs
|
||||||
|
func (ti *TXIndex) GetTXs(txIDs []*externalapi.DomainTransactionID) (
|
||||||
|
txs []*externalapi.DomainTransaction, found bool, err error) {
|
||||||
|
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.GetTXs")
|
||||||
|
defer onEnd()
|
||||||
|
|
||||||
|
ti.mutex.Lock()
|
||||||
|
defer ti.mutex.Unlock()
|
||||||
|
|
||||||
|
acceptingBlockHashes, found, err := ti.store.getTxAcceptingBlockHashes(txIDs)
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
txs = make([]*externalapi.DomainTransaction, 0)
|
||||||
|
for txID, acceptingBlockHash := range acceptingBlockHashes {
|
||||||
|
acceptingBlock, err := ti.domain.Consensus().GetBlock(acceptingBlockHash)
|
||||||
|
if err != nil {
|
||||||
|
if database.IsNotFoundError(err) {
|
||||||
|
continue // ignore
|
||||||
|
} else {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, tx := range acceptingBlock.Transactions {
|
||||||
|
if consensushashing.TransactionID(tx).Equal(txID) {
|
||||||
|
txs = append(txs, tx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return txs, true, nil
|
||||||
|
}
|
||||||
|
|
||||||
// GetTXConfirmations returns the tx confirmations for for the given txID
|
// GetTXConfirmations returns the tx confirmations for for the given txID
|
||||||
func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
||||||
BlockHashTxIDPair uint64, found bool, err error) {
|
Confirmations int64, found bool, err error) {
|
||||||
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.GetTXConfirmations")
|
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.GetTXConfirmations")
|
||||||
defer onEnd()
|
defer onEnd()
|
||||||
|
|
||||||
@ -381,7 +413,7 @@ func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
|||||||
|
|
||||||
acceptingBlockHeader, err := ti.domain.Consensus().GetBlockHeader(acceptingBlockHash)
|
acceptingBlockHeader, err := ti.domain.Consensus().GetBlockHeader(acceptingBlockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, false, err
|
return -1, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
virtualBlock, err := ti.domain.Consensus().GetVirtualInfo()
|
virtualBlock, err := ti.domain.Consensus().GetVirtualInfo()
|
||||||
@ -389,7 +421,38 @@ func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
|||||||
return 0, false, err
|
return 0, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return virtualBlock.BlueScore - acceptingBlockHeader.BlueScore(), true, nil
|
return int64(virtualBlock.BlueScore - acceptingBlockHeader.BlueScore()), true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTXsConfirmations returns the tx confirmations for for the given txIDs
|
||||||
|
func (ti *TXIndex) GetTXsConfirmations(txIDs []*externalapi.DomainTransactionID) (
|
||||||
|
Confirmations TxIDsToConfirmations, found bool, err error) {
|
||||||
|
onEnd := logger.LogAndMeasureExecutionTime(log, "TXIndex.GetTXsConfirmations")
|
||||||
|
defer onEnd()
|
||||||
|
|
||||||
|
ti.mutex.Lock()
|
||||||
|
defer ti.mutex.Unlock()
|
||||||
|
|
||||||
|
virtualBlock, err := ti.domain.Consensus().GetVirtualInfo()
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
acceptingBlockHashes, _, err := ti.store.getTxAcceptingBlockHashes(txIDs)
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Confirmations = make(TxIDsToConfirmations)
|
||||||
|
for txID, acceptingBlockHash := range acceptingBlockHashes {
|
||||||
|
acceptingBlockHeader, err := ti.domain.Consensus().GetBlockHeader(acceptingBlockHash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, false, err
|
||||||
|
}
|
||||||
|
Confirmations[txID] = int64(acceptingBlockHeader.BlueScore() - virtualBlock.BlueScore)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Confirmations, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TXIncludingBlockHash returns the including block hash for the given txID
|
// TXIncludingBlockHash returns the including block hash for the given txID
|
||||||
|
|||||||
@ -1998,6 +1998,7 @@ See NotifyNewBlockTemplateRequestMessage
|
|||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
| ----- | ---- | ----- | ----------- |
|
| ----- | ---- | ----- | ----------- |
|
||||||
| txID | [string](#string) | | |
|
| txID | [string](#string) | | |
|
||||||
|
| includeTransactions | [bool](#bool) | | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2029,6 +2030,7 @@ See NotifyNewBlockTemplateRequestMessage
|
|||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
| ----- | ---- | ----- | ----------- |
|
| ----- | ---- | ----- | ----------- |
|
||||||
| txIDs | [string](#string) | repeated | |
|
| txIDs | [string](#string) | repeated | |
|
||||||
|
| includeTransactions | [bool](#bool) | | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6488,6 +6488,7 @@ type GetAcceptingBlockOfTxRequestMessage struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
TxID string `protobuf:"bytes,1,opt,name=txID,proto3" json:"txID,omitempty"`
|
TxID string `protobuf:"bytes,1,opt,name=txID,proto3" json:"txID,omitempty"`
|
||||||
|
IncludeTransactions bool `protobuf:"varint,2,opt,name=includeTransactions,proto3" json:"includeTransactions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetAcceptingBlockOfTxRequestMessage) Reset() {
|
func (x *GetAcceptingBlockOfTxRequestMessage) Reset() {
|
||||||
@ -6529,6 +6530,13 @@ func (x *GetAcceptingBlockOfTxRequestMessage) GetTxID() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *GetAcceptingBlockOfTxRequestMessage) GetIncludeTransactions() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.IncludeTransactions
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type GetAcceptingBlockOfTxResponseMessage struct {
|
type GetAcceptingBlockOfTxResponseMessage struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -6590,6 +6598,7 @@ type GetAcceptingBlocksOfTxsRequestMessage struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
TxIDs []string `protobuf:"bytes,1,rep,name=txIDs,proto3" json:"txIDs,omitempty"`
|
TxIDs []string `protobuf:"bytes,1,rep,name=txIDs,proto3" json:"txIDs,omitempty"`
|
||||||
|
IncludeTransactions bool `protobuf:"varint,2,opt,name=includeTransactions,proto3" json:"includeTransactions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetAcceptingBlocksOfTxsRequestMessage) Reset() {
|
func (x *GetAcceptingBlocksOfTxsRequestMessage) Reset() {
|
||||||
@ -6631,6 +6640,13 @@ func (x *GetAcceptingBlocksOfTxsRequestMessage) GetTxIDs() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *GetAcceptingBlocksOfTxsRequestMessage) GetIncludeTransactions() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.IncludeTransactions
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type GetAcceptingBlocksOfTxsResponseMessage struct {
|
type GetAcceptingBlocksOfTxsResponseMessage struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -8039,93 +8055,99 @@ var file_rpc_proto_rawDesc = []byte{
|
|||||||
0x68, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
|
0x68, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
|
||||||
0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||||
0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72,
|
0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72,
|
||||||
0x6f, 0x72, 0x22, 0x39, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69,
|
0x6f, 0x72, 0x22, 0x6b, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69,
|
||||||
0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49,
|
0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49,
|
||||||
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x7d, 0x0a,
|
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x12, 0x30, 0x0a,
|
||||||
0x24, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f,
|
0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||||
0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65,
|
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c,
|
||||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01,
|
0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
|
0x7d, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42,
|
||||||
0x2e, 0x52, 0x70, 0x63, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b,
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||||
0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3d, 0x0a, 0x25,
|
0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f,
|
||||||
0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63,
|
0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01,
|
||||||
0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65,
|
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52,
|
||||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x18, 0x01,
|
0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x6f,
|
||||||
0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x26,
|
0x0a, 0x25, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c,
|
||||||
0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63,
|
0x6f, 0x63, 0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x74, 0x78, 0x49, 0x44, 0x42, 0x6c,
|
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x12, 0x30, 0x0a,
|
||||||
0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18,
|
0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54, 0x78, 0x49, 0x44, 0x42,
|
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c,
|
||||||
0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x74, 0x78, 0x49, 0x44, 0x42, 0x6c,
|
0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22,
|
||||||
0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f,
|
0x96, 0x01, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67,
|
||||||
0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65,
|
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x74, 0x78,
|
||||||
0x72, 0x72, 0x6f, 0x72, 0x22, 0x3d, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75,
|
0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||||
0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x4f, 0x66, 0x54,
|
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54,
|
||||||
0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
|
0x78, 0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x74, 0x78,
|
||||||
0x12, 0x0a, 0x04, 0x74, 0x78, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
|
0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05,
|
||||||
0x78, 0x49, 0x44, 0x22, 0x6a, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64,
|
0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70,
|
||||||
0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x4f, 0x66, 0x54, 0x78,
|
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
|
0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x3d, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x49,
|
||||||
0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68,
|
0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
|
||||||
0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20,
|
0x68, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
||||||
|
0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x6a, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x49, 0x6e,
|
||||||
|
0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68,
|
||||||
|
0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73,
|
||||||
|
0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
|
||||||
|
0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||||
|
0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72,
|
||||||
|
0x72, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75,
|
||||||
|
0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78,
|
||||||
|
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x7f,
|
||||||
|
0x0a, 0x14, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
|
||||||
|
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
|
||||||
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x72, 0x61, 0x6e, 0x73,
|
||||||
|
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||||
|
0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||||
0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22,
|
0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22,
|
||||||
0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d,
|
0x2c, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73,
|
||||||
|
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x22, 0x82, 0x01,
|
||||||
|
0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
||||||
|
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x72, 0x61,
|
||||||
|
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
|
||||||
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
|
||||||
|
0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||||
|
0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72,
|
||||||
|
0x6f, 0x72, 0x22, 0x36, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x54, 0x78, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49, 0x44, 0x18, 0x01,
|
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49, 0x44, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x7f, 0x0a, 0x14, 0x47, 0x65,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x75, 0x0a, 0x21, 0x47, 0x65,
|
||||||
0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
0x74, 0x54, 0x78, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||||
0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
|
||||||
0x69, 0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
|
|
||||||
0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
|
||||||
0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
|
||||||
0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45,
|
|
||||||
0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2c, 0x0a, 0x14, 0x47,
|
|
||||||
0x65, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
|
||||||
0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03,
|
|
||||||
0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x47, 0x65,
|
|
||||||
0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73,
|
|
||||||
0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
|
|
||||||
0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
|
||||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01,
|
|
||||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52,
|
|
||||||
0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x36,
|
|
||||||
0x0a, 0x20, 0x47, 0x65, 0x74, 0x54, 0x78, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74,
|
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
|
||||||
0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x22, 0x75, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x54, 0x78, 0x43,
|
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70,
|
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63,
|
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01,
|
|
||||||
0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
|
||||||
0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28,
|
|
||||||
0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50,
|
|
||||||
0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x39, 0x0a,
|
|
||||||
0x21, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74,
|
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
|
||||||
0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
|
|
||||||
0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x22, 0x47, 0x65, 0x74,
|
|
||||||
0x54, 0x78, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
|
||||||
0x58, 0x0a, 0x16, 0x74, 0x78, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74,
|
0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61,
|
||||||
0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54, 0x78, 0x49, 0x44,
|
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x69,
|
0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||||
0x72, 0x52, 0x16, 0x74, 0x78, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74,
|
0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72,
|
0x72, 0x22, 0x39, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d,
|
||||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05,
|
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x18,
|
||||||
0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x49, 0x44, 0x73, 0x22, 0xaa, 0x01, 0x0a,
|
||||||
0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61, 0x73,
|
0x22, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74,
|
||||||
0x70, 0x61, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x62, 0x06, 0x70,
|
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x61, 0x67, 0x65, 0x12, 0x58, 0x0a, 0x16, 0x74, 0x78, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20,
|
||||||
|
0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||||
|
0x54, 0x78, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x73, 0x50, 0x61, 0x69, 0x72, 0x52, 0x16, 0x74, 0x78, 0x49, 0x44, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
|
0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x0a,
|
||||||
|
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72,
|
||||||
|
0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74,
|
||||||
|
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74,
|
||||||
|
0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||||
|
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@ -761,6 +761,7 @@ message GetAcceptingBlockHashesOfTxsResponseMessage{
|
|||||||
|
|
||||||
message GetAcceptingBlockOfTxRequestMessage{
|
message GetAcceptingBlockOfTxRequestMessage{
|
||||||
string txID = 1;
|
string txID = 1;
|
||||||
|
bool includeTransactions = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetAcceptingBlockOfTxResponseMessage{
|
message GetAcceptingBlockOfTxResponseMessage{
|
||||||
@ -771,6 +772,7 @@ message GetAcceptingBlockOfTxResponseMessage{
|
|||||||
|
|
||||||
message GetAcceptingBlocksOfTxsRequestMessage{
|
message GetAcceptingBlocksOfTxsRequestMessage{
|
||||||
repeated string txIDs = 1;
|
repeated string txIDs = 1;
|
||||||
|
bool includeTransactions = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetAcceptingBlocksOfTxsResponseMessage{
|
message GetAcceptingBlocksOfTxsResponseMessage{
|
||||||
|
|||||||
@ -15,6 +15,7 @@ func (x *KaspadMessage_GetAcceptingBlockOfTxRequest) toAppMessage() (appmessage.
|
|||||||
func (x *KaspadMessage_GetAcceptingBlockOfTxRequest) fromAppMessage(message *appmessage.GetAcceptingBlockOfTxRequestMessage) error {
|
func (x *KaspadMessage_GetAcceptingBlockOfTxRequest) fromAppMessage(message *appmessage.GetAcceptingBlockOfTxRequestMessage) error {
|
||||||
x.GetAcceptingBlockOfTxRequest = &GetAcceptingBlockOfTxRequestMessage{
|
x.GetAcceptingBlockOfTxRequest = &GetAcceptingBlockOfTxRequestMessage{
|
||||||
TxID: message.TxID,
|
TxID: message.TxID,
|
||||||
|
IncludeTransactions: message.IncludeTransactions,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -25,6 +26,7 @@ func (x *GetAcceptingBlockOfTxRequestMessage) toAppMessage() (appmessage.Message
|
|||||||
}
|
}
|
||||||
return &appmessage.GetAcceptingBlockOfTxRequestMessage{
|
return &appmessage.GetAcceptingBlockOfTxRequestMessage{
|
||||||
TxID: x.TxID,
|
TxID: x.TxID,
|
||||||
|
IncludeTransactions: x.IncludeTransactions,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,6 +99,5 @@ func (x *TxIDBlockHashPair) fromAppMessage(message *appmessage.TxIDBlockHashPair
|
|||||||
*x = TxIDBlockHashPair{
|
*x = TxIDBlockHashPair{
|
||||||
TxID: message.TxID,
|
TxID: message.TxID,
|
||||||
Hash: message.Hash,
|
Hash: message.Hash,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ func (x *KaspadMessage_GetAcceptingBlocksOfTxsRequest) toAppMessage() (appmessag
|
|||||||
func (x *KaspadMessage_GetAcceptingBlocksOfTxsRequest) fromAppMessage(message *appmessage.GetAcceptingBlocksOfTxsRequestMessage) error {
|
func (x *KaspadMessage_GetAcceptingBlocksOfTxsRequest) fromAppMessage(message *appmessage.GetAcceptingBlocksOfTxsRequestMessage) error {
|
||||||
x.GetAcceptingBlocksOfTxsRequest = &GetAcceptingBlocksOfTxsRequestMessage{
|
x.GetAcceptingBlocksOfTxsRequest = &GetAcceptingBlocksOfTxsRequestMessage{
|
||||||
TxIDs: message.TxIDs,
|
TxIDs: message.TxIDs,
|
||||||
|
IncludeTransactions: message.IncludeTransactions,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -25,6 +26,7 @@ func (x *GetAcceptingBlocksOfTxsRequestMessage) toAppMessage() (appmessage.Messa
|
|||||||
}
|
}
|
||||||
return &appmessage.GetAcceptingBlocksOfTxsRequestMessage{
|
return &appmessage.GetAcceptingBlocksOfTxsRequestMessage{
|
||||||
TxIDs: x.TxIDs,
|
TxIDs: x.TxIDs,
|
||||||
|
IncludeTransactions: x.IncludeTransactions,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +100,7 @@ func (x *TxIDBlockPair) toAppMessage() (*appmessage.TxIDBlockPair, error) {
|
|||||||
|
|
||||||
return &appmessage.TxIDBlockPair{
|
return &appmessage.TxIDBlockPair{
|
||||||
TxID: x.TxID,
|
TxID: x.TxID,
|
||||||
Block: *appBlock,
|
Block: appBlock,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,14 +108,13 @@ func (x *TxIDBlockPair) fromAppMessage(message *appmessage.TxIDBlockPair) error
|
|||||||
|
|
||||||
rpcBlock := &RpcBlock{}
|
rpcBlock := &RpcBlock{}
|
||||||
|
|
||||||
err := rpcBlock.fromAppMessage(&message.Block)
|
err := rpcBlock.fromAppMessage(message.Block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
*x = TxIDBlockPair{
|
*x = TxIDBlockPair{
|
||||||
TxID: message.TxID,
|
TxID: message.TxID,
|
||||||
Block: rpcBlock,
|
Block: rpcBlock,
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user