Update command_parser.go

This commit is contained in:
topianet 2023-12-23 02:00:44 +01:00 committed by GitHub
parent a0ef77decd
commit b643ca0964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,11 @@ import (
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/server/grpcserver/protowire" "github.com/fabbez/topiad/infrastructure/network/netadapter/server/grpcserver/protowire"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
func parseCommand(args []string, commandDescs []*commandDescription) (*protowire.KaspadMessage, error) { func parseCommand(args []string, commandDescs []*commandDescription) (*protowire.topiadMessage, error) {
commandName, parameterStrings := args[0], args[1:] commandName, parameterStrings := args[0], args[1:]
var commandDesc *commandDescription var commandDesc *commandDescription
@ -39,7 +39,7 @@ func parseCommand(args []string, commandDescs []*commandDescription) (*protowire
setField(commandValue, parameterValue, parameterDesc) setField(commandValue, parameterValue, parameterDesc)
} }
return generateKaspadMessage(commandValue, commandDesc) return generatetopiadMessage(commandValue, commandDesc)
} }
func setField(commandValue reflect.Value, parameterValue reflect.Value, parameterDesc *parameterDescription) { func setField(commandValue reflect.Value, parameterValue reflect.Value, parameterDesc *parameterDescription) {