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
@ -4,7 +4,8 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type GetAcceptingBlockOfTxRequestMessage struct {
|
||||
baseMessage
|
||||
TxID string
|
||||
TxID string
|
||||
IncludeTransactions bool
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
|
||||
@ -3,8 +3,8 @@ package appmessage
|
||||
// TxIDBlockHashPair is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type TxIDBlockHashPair struct {
|
||||
TxID string
|
||||
Hash string
|
||||
TxID string
|
||||
Hash string
|
||||
}
|
||||
|
||||
// GetAcceptingBlockHashesOfTxsRequestMessage is an appmessage corresponding to
|
||||
|
||||
@ -3,15 +3,16 @@ package appmessage
|
||||
// TxIDBlockPair is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type TxIDBlockPair struct {
|
||||
TxID string
|
||||
Block RPCBlock
|
||||
TxID string
|
||||
Block *RPCBlock
|
||||
}
|
||||
|
||||
// GetAcceptingBlocksOfTxsRequestMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type GetAcceptingBlocksOfTxsRequestMessage struct {
|
||||
baseMessage
|
||||
TxIDs []string
|
||||
TxIDs []string
|
||||
IncludeTransactions bool
|
||||
}
|
||||
|
||||
// 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) {
|
||||
return nil, err
|
||||
}
|
||||
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
||||
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||
errorMessage.Error = rpcError
|
||||
return errorMessage, nil
|
||||
}
|
||||
@ -36,7 +36,7 @@ func HandleGetAcceptingBlockHashOfTx(context *rpccontext.Context, _ *router.Rout
|
||||
if !errors.As(err, &rpcError) {
|
||||
return nil, err
|
||||
}
|
||||
errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{}
|
||||
errorMessage := &appmessage.GetAcceptingBlockHashOfTxResponseMessage{}
|
||||
errorMessage.Error = rpcError
|
||||
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
|
||||
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
|
||||
func ConvertDomainHashToString(blockHash *externalapi.DomainHash) string {
|
||||
return hex.EncodeToString(blockHash.ByteSlice())
|
||||
|
||||
@ -247,7 +247,7 @@ func (tis *txIndexStore) getTxAcceptingBlockHashes(txIDs []*externalapi.DomainTr
|
||||
serializedAcceptingBlockHash, err := tis.database.Get(key)
|
||||
if err != nil {
|
||||
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
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ func (ti *TXIndex) TXAcceptingBlock(txID *externalapi.DomainTransactionID) (
|
||||
|
||||
// TXAcceptingBlocks returns the accepting blocks for for the given txIDs
|
||||
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")
|
||||
defer onEnd()
|
||||
|
||||
@ -314,23 +314,20 @@ func (ti *TXIndex) TXAcceptingBlocks(txIDs []*externalapi.DomainTransactionID) (
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
acceptingBlockHashes := make([]*externalapi.DomainHash, len(acceptingBlockHashTxIDPairs))
|
||||
|
||||
acceptingBlocks = make(TxIDsToBlocks)
|
||||
i := 0
|
||||
for _, acceptingBlockHash := range acceptingBlockHashTxIDPairs {
|
||||
acceptingBlockHashes[i] = acceptingBlockHash
|
||||
for txID, blockHash := range acceptingBlockHashTxIDPairs {
|
||||
acceptingBlocks[txID], err = ti.domain.Consensus().GetBlock(blockHash)
|
||||
if err != nil {
|
||||
if database.IsNotFoundError(err) {
|
||||
continue // ignore
|
||||
} else {
|
||||
return nil, false, err
|
||||
}
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
acceptingBlocks, err = ti.domain.Consensus().GetBlocks(acceptingBlockHashes)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
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())
|
||||
}
|
||||
|
||||
// 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
|
||||
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")
|
||||
defer onEnd()
|
||||
|
||||
@ -381,7 +413,7 @@ func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
||||
|
||||
acceptingBlockHeader, err := ti.domain.Consensus().GetBlockHeader(acceptingBlockHash)
|
||||
if err != nil {
|
||||
return 0, false, err
|
||||
return -1, false, err
|
||||
}
|
||||
|
||||
virtualBlock, err := ti.domain.Consensus().GetVirtualInfo()
|
||||
@ -389,7 +421,38 @@ func (ti *TXIndex) GetTXConfirmations(txID *externalapi.DomainTransactionID) (
|
||||
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
|
||||
|
||||
@ -1998,6 +1998,7 @@ See NotifyNewBlockTemplateRequestMessage
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| txID | [string](#string) | | |
|
||||
| includeTransactions | [bool](#bool) | | |
|
||||
|
||||
|
||||
|
||||
@ -2029,6 +2030,7 @@ See NotifyNewBlockTemplateRequestMessage
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| txIDs | [string](#string) | repeated | |
|
||||
| includeTransactions | [bool](#bool) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6487,7 +6487,8 @@ type GetAcceptingBlockOfTxRequestMessage struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
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() {
|
||||
@ -6529,6 +6530,13 @@ func (x *GetAcceptingBlockOfTxRequestMessage) GetTxID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetAcceptingBlockOfTxRequestMessage) GetIncludeTransactions() bool {
|
||||
if x != nil {
|
||||
return x.IncludeTransactions
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type GetAcceptingBlockOfTxResponseMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -6589,7 +6597,8 @@ type GetAcceptingBlocksOfTxsRequestMessage struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
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() {
|
||||
@ -6631,6 +6640,13 @@ func (x *GetAcceptingBlocksOfTxsRequestMessage) GetTxIDs() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetAcceptingBlocksOfTxsRequestMessage) GetIncludeTransactions() bool {
|
||||
if x != nil {
|
||||
return x.IncludeTransactions
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type GetAcceptingBlocksOfTxsResponseMessage struct {
|
||||
state protoimpl.MessageState
|
||||
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,
|
||||
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, 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,
|
||||
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,
|
||||
0x24, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
|
||||
0x2e, 0x52, 0x70, 0x63, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
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, 0x3d, 0x0a, 0x25,
|
||||
0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x73, 0x4f, 0x66, 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, 0x96, 0x01, 0x0a, 0x26,
|
||||
0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x74, 0x78, 0x49, 0x44, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54, 0x78, 0x49, 0x44, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x74, 0x78, 0x49, 0x44, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 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, 0x22, 0x3d, 0x0a, 0x27, 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, 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,
|
||||
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x44, 0x12, 0x30, 0x0a,
|
||||
0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c,
|
||||
0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22,
|
||||
0x7d, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x66, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x52, 0x70, 0x63, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 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, 0x6f,
|
||||
0x0a, 0x25, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x4f, 0x66, 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, 0x12, 0x30, 0x0a,
|
||||
0x13, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x6e, 0x63, 0x6c,
|
||||
0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22,
|
||||
0x96, 0x01, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4f, 0x66, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x74, 0x78,
|
||||
0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54,
|
||||
0x78, 0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0e, 0x74, 0x78,
|
||||
0x49, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 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, 0x22, 0x3d, 0x0a, 0x27, 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, 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,
|
||||
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,
|
||||
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, 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,
|
||||
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,
|
||||
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,
|
||||
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, 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 (
|
||||
|
||||
@ -761,6 +761,7 @@ message GetAcceptingBlockHashesOfTxsResponseMessage{
|
||||
|
||||
message GetAcceptingBlockOfTxRequestMessage{
|
||||
string txID = 1;
|
||||
bool includeTransactions = 2;
|
||||
}
|
||||
|
||||
message GetAcceptingBlockOfTxResponseMessage{
|
||||
@ -771,6 +772,7 @@ message GetAcceptingBlockOfTxResponseMessage{
|
||||
|
||||
message GetAcceptingBlocksOfTxsRequestMessage{
|
||||
repeated string txIDs = 1;
|
||||
bool includeTransactions = 2;
|
||||
}
|
||||
|
||||
message GetAcceptingBlocksOfTxsResponseMessage{
|
||||
|
||||
@ -14,7 +14,8 @@ func (x *KaspadMessage_GetAcceptingBlockOfTxRequest) toAppMessage() (appmessage.
|
||||
|
||||
func (x *KaspadMessage_GetAcceptingBlockOfTxRequest) fromAppMessage(message *appmessage.GetAcceptingBlockOfTxRequestMessage) error {
|
||||
x.GetAcceptingBlockOfTxRequest = &GetAcceptingBlockOfTxRequestMessage{
|
||||
TxID: message.TxID,
|
||||
TxID: message.TxID,
|
||||
IncludeTransactions: message.IncludeTransactions,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -24,7 +25,8 @@ func (x *GetAcceptingBlockOfTxRequestMessage) toAppMessage() (appmessage.Message
|
||||
return nil, errors.Wrapf(errorNil, "GetAcceptingBlockOfTxRequestMessage is nil")
|
||||
}
|
||||
return &appmessage.GetAcceptingBlockOfTxRequestMessage{
|
||||
TxID: x.TxID,
|
||||
TxID: x.TxID,
|
||||
IncludeTransactions: x.IncludeTransactions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -42,7 +44,7 @@ func (x *KaspadMessage_GetAcceptingBlockOfTxResponse) fromAppMessage(message *ap
|
||||
rpcErr = &RPCError{Message: message.Error.Message}
|
||||
}
|
||||
rpcBlock := &RpcBlock{}
|
||||
|
||||
|
||||
err := rpcBlock.fromAppMessage(message.Block)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -75,7 +77,7 @@ func (x *GetAcceptingBlockOfTxResponseMessage) toAppMessage() (appmessage.Messag
|
||||
}
|
||||
|
||||
return &appmessage.GetAcceptingBlockOfTxResponseMessage{
|
||||
Block: appBlock,
|
||||
Block: appBlock,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ func (x *KaspadMessage_GetAcceptingBlockHashesOfTxsResponse) fromAppMessage(mess
|
||||
for i := range rpcTxIDBlockHashPairs {
|
||||
rpcTxIDBlockHashPairs[i].fromAppMessage(message.TxIDBlockHashPairs[i])
|
||||
}
|
||||
|
||||
|
||||
x.GetAcceptingBlockHashesOfTxsResponse = &GetAcceptingBlockHashesOfTxsResponseMessage{
|
||||
TxIDBlockHashPairs: rpcTxIDBlockHashPairs,
|
||||
|
||||
@ -78,8 +78,8 @@ func (x *GetAcceptingBlockHashesOfTxsResponseMessage) toAppMessage() (appmessage
|
||||
}
|
||||
|
||||
return &appmessage.GetAcceptingBlockHashesOfTxsResponseMessage{
|
||||
TxIDBlockHashPairs: appTxIDBlockHashPairs,
|
||||
Error: rpcErr,
|
||||
TxIDBlockHashPairs: appTxIDBlockHashPairs,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -89,16 +89,15 @@ func (x *TxIDBlockHashPair) toAppMessage() (*appmessage.TxIDBlockHashPair, error
|
||||
}
|
||||
|
||||
return &appmessage.TxIDBlockHashPair{
|
||||
TxID: x.TxID,
|
||||
Hash: x.Hash,
|
||||
TxID: x.TxID,
|
||||
Hash: x.Hash,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *TxIDBlockHashPair) fromAppMessage(message *appmessage.TxIDBlockHashPair) {
|
||||
|
||||
|
||||
*x = TxIDBlockHashPair{
|
||||
TxID: message.TxID,
|
||||
Hash: message.Hash,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,8 @@ func (x *KaspadMessage_GetAcceptingBlocksOfTxsRequest) toAppMessage() (appmessag
|
||||
|
||||
func (x *KaspadMessage_GetAcceptingBlocksOfTxsRequest) fromAppMessage(message *appmessage.GetAcceptingBlocksOfTxsRequestMessage) error {
|
||||
x.GetAcceptingBlocksOfTxsRequest = &GetAcceptingBlocksOfTxsRequestMessage{
|
||||
TxIDs: message.TxIDs,
|
||||
TxIDs: message.TxIDs,
|
||||
IncludeTransactions: message.IncludeTransactions,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -24,7 +25,8 @@ func (x *GetAcceptingBlocksOfTxsRequestMessage) toAppMessage() (appmessage.Messa
|
||||
return nil, errors.Wrapf(errorNil, "GetAcceptingBlocksOfTxsRequestMessage is nil")
|
||||
}
|
||||
return &appmessage.GetAcceptingBlocksOfTxsRequestMessage{
|
||||
TxIDs: x.TxIDs,
|
||||
TxIDs: x.TxIDs,
|
||||
IncludeTransactions: x.IncludeTransactions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -49,7 +51,7 @@ func (x *KaspadMessage_GetAcceptingBlocksOfTxsResponse) fromAppMessage(message *
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
x.GetAcceptingBlocksOfTxsResponse = &GetAcceptingBlocksOfTxsResponseMessage{
|
||||
TxIDBlockPairs: rpcTxIDBlockPairs,
|
||||
|
||||
@ -81,8 +83,8 @@ func (x *GetAcceptingBlocksOfTxsResponseMessage) toAppMessage() (appmessage.Mess
|
||||
}
|
||||
|
||||
return &appmessage.GetAcceptingBlocksOfTxsResponseMessage{
|
||||
TxIDBlockPairs: appTxIDBlockPairs,
|
||||
Error: rpcErr,
|
||||
TxIDBlockPairs: appTxIDBlockPairs,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -98,22 +100,21 @@ func (x *TxIDBlockPair) toAppMessage() (*appmessage.TxIDBlockPair, error) {
|
||||
|
||||
return &appmessage.TxIDBlockPair{
|
||||
TxID: x.TxID,
|
||||
Block: *appBlock,
|
||||
Block: appBlock,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *TxIDBlockPair) fromAppMessage(message *appmessage.TxIDBlockPair) error {
|
||||
|
||||
|
||||
rpcBlock := &RpcBlock{}
|
||||
|
||||
err := rpcBlock.fromAppMessage(&message.Block)
|
||||
|
||||
err := rpcBlock.fromAppMessage(message.Block)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = TxIDBlockPair{
|
||||
TxID: message.TxID,
|
||||
TxID: message.TxID,
|
||||
Block: rpcBlock,
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ func (x *KaspadMessage_GetTxResponse) fromAppMessage(message *appmessage.GetTxRe
|
||||
}
|
||||
rpcTransaction := &RpcTransaction{}
|
||||
rpcTransaction.fromAppMessage(message.Transaction)
|
||||
|
||||
|
||||
x.GetTxResponse = &GetTxResponseMessage{
|
||||
Transaction: rpcTransaction,
|
||||
|
||||
@ -72,7 +72,7 @@ func (x *GetTxResponseMessage) toAppMessage() (appmessage.Message, error) {
|
||||
}
|
||||
|
||||
return &appmessage.GetTxResponseMessage{
|
||||
Transaction: appTransaction,
|
||||
Error: rpcErr,
|
||||
Transaction: appTransaction,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ func (x *KaspadMessage_GetTxConfirmationsResponse) fromAppMessage(message *appme
|
||||
if message.Error != nil {
|
||||
rpcErr = &RPCError{Message: message.Error.Message}
|
||||
}
|
||||
|
||||
|
||||
x.GetTxConfirmationsResponse = &GetTxConfirmationsResponseMessage{
|
||||
Confirmations: message.Confirmations,
|
||||
|
||||
@ -65,7 +65,7 @@ func (x *GetTxConfirmationsResponseMessage) toAppMessage() (appmessage.Message,
|
||||
}
|
||||
|
||||
return &appmessage.GetTxConfirmationsResponseMessage{
|
||||
Confirmations: x.Confirmations,
|
||||
Error: rpcErr,
|
||||
Confirmations: x.Confirmations,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ func (x *KaspadMessage_GetTxsResponse) fromAppMessage(message *appmessage.GetTxs
|
||||
for i := range rpcTransactions {
|
||||
rpcTransactions[i].fromAppMessage(message.Transactions[i])
|
||||
}
|
||||
|
||||
|
||||
x.GetTxsResponse = &GetTxsResponseMessage{
|
||||
Transactions: rpcTransactions,
|
||||
|
||||
@ -78,7 +78,7 @@ func (x *GetTxsResponseMessage) toAppMessage() (appmessage.Message, error) {
|
||||
}
|
||||
|
||||
return &appmessage.GetTxsResponseMessage{
|
||||
Transactions: appTransactions,
|
||||
Error: rpcErr,
|
||||
Transactions: appTransactions,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ func (x *KaspadMessage_GetTxsConfirmationsResponse) fromAppMessage(message *appm
|
||||
for i := range rpcTxIDConfirmationsPairs {
|
||||
rpcTxIDConfirmationsPairs[i].fromAppMessage(message.TxIDConfirmationsPairs[i])
|
||||
}
|
||||
|
||||
|
||||
x.GetTxsConfirmationsResponse = &GetTxsConfirmationsResponseMessage{
|
||||
TxIDConfirmationsPairs: rpcTxIDConfirmationsPairs,
|
||||
|
||||
@ -78,8 +78,8 @@ func (x *GetTxsConfirmationsResponseMessage) toAppMessage() (appmessage.Message,
|
||||
}
|
||||
|
||||
return &appmessage.GetTxsConfirmationsResponseMessage{
|
||||
TxIDConfirmationsPairs: appTxIDConfirmationsPairs,
|
||||
Error: rpcErr,
|
||||
TxIDConfirmationsPairs: appTxIDConfirmationsPairs,
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -89,15 +89,15 @@ func (x *TxIDConfirmationsPair) toAppMessage() (*appmessage.TxIDConfirmationsPai
|
||||
}
|
||||
|
||||
return &appmessage.TxIDConfirmationsPair{
|
||||
TxID: x.TxID,
|
||||
Confirmations: x.Confirmations,
|
||||
TxID: x.TxID,
|
||||
Confirmations: x.Confirmations,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *TxIDConfirmationsPair) fromAppMessage(message *appmessage.TxIDConfirmationsPair) {
|
||||
|
||||
|
||||
*x = TxIDConfirmationsPair{
|
||||
TxID: message.TxID,
|
||||
TxID: message.TxID,
|
||||
Confirmations: message.Confirmations,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user