From ce05a503f815a73ed65694fed9940d29c077e6ad Mon Sep 17 00:00:00 2001 From: topianet <130279998+fabbez@users.noreply.github.com> Date: Sat, 23 Dec 2023 02:09:59 +0100 Subject: [PATCH] Update reflection_helpers.go --- cmd/kaspactl/reflection_helpers.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/kaspactl/reflection_helpers.go b/cmd/kaspactl/reflection_helpers.go index 491229287..9d7e5b761 100644 --- a/cmd/kaspactl/reflection_helpers.go +++ b/cmd/kaspactl/reflection_helpers.go @@ -4,12 +4,12 @@ import ( "reflect" "unicode" - "github.com/kaspanet/kaspad/infrastructure/network/netadapter/server/grpcserver/protowire" + "github.com/fabbez/topiad/infrastructure/network/netadapter/server/grpcserver/protowire" ) // protobuf generates the command types with two types: // 1. A concrete type that holds the fields of the command bearing the name of the command with `RequestMessage` as suffix -// 2. A wrapper that implements isKaspadMessage_Payload, having a single field pointing to the concrete command +// 2. A wrapper that implements istopiadMessage_Payload, having a single field pointing to the concrete command // bearing the name of the command with `KaspadMessage_` prefix and `Request` suffix // unwrapCommandType converts a reflect.Type signifying a wrapper type into the concrete request type @@ -28,14 +28,14 @@ func isFieldExported(field reflect.StructField) bool { return unicode.IsUpper(rune(field.Name[0])) } -// generateKaspadMessage generates a wrapped KaspadMessage with the given `commandValue` -func generateKaspadMessage(commandValue reflect.Value, commandDesc *commandDescription) (*protowire.KaspadMessage, error) { +// generatetopiaddMessage generates a wrapped topiadMessage with the given `commandValue` +func generatetopiadMessage(commandValue reflect.Value, commandDesc *commandDescription) (*protowire.topiadMessage, error) { commandWrapper := reflect.New(commandDesc.typeof) unwrapCommandValue(commandWrapper).Set(commandValue) - kaspadMessage := reflect.New(reflect.TypeOf(protowire.KaspadMessage{})) - kaspadMessage.Elem().FieldByName("Payload").Set(commandWrapper) - return kaspadMessage.Interface().(*protowire.KaspadMessage), nil + topiadMessage := reflect.New(reflect.TypeOf(protowire.topiadMessage{})) + topiadMessage.Elem().FieldByName("Payload").Set(commandWrapper) + return topiadMessage.Interface().(*protowire.topiadMessage), nil } // pointerToValue returns a reflect.Value that represents a pointer to the given value