diff --git a/CHANGELOG.md b/CHANGELOG.md index d602b0e69..2c64c930d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Changelog for NeoFS Node - Panic in IR when performing HEAD requests (#2069) - Write-cache flush duplication (#2074) - Ignore error if a transaction already exists in a morph client (#2075) +- ObjectID signature output in the CLI (#2104) ### Removed ### Updated diff --git a/cmd/neofs-cli/modules/object/head.go b/cmd/neofs-cli/modules/object/head.go index 417362856..81ac42cdc 100644 --- a/cmd/neofs-cli/modules/object/head.go +++ b/cmd/neofs-cli/modules/object/head.go @@ -160,6 +160,17 @@ func printHeader(cmd *cobra.Command, obj *object.Object) error { cmd.Printf(" %s=%s\n", attr.Key(), attr.Value()) } + if signature := obj.Signature(); signature != nil { + cmd.Print("ID signature:\n") + + // TODO(@carpawell): #1387 implement and use another approach to avoid conversion + var sigV2 refs.Signature + signature.WriteToV2(&sigV2) + + cmd.Printf(" public key: %s\n", hex.EncodeToString(sigV2.GetKey())) + cmd.Printf(" signature: %s\n", hex.EncodeToString(sigV2.GetSign())) + } + return printSplitHeader(cmd, obj) } @@ -180,17 +191,6 @@ func printSplitHeader(cmd *cobra.Command, obj *object.Object) error { cmd.Printf("Split ChildID: %s\n", child.String()) } - if signature := obj.Signature(); signature != nil { - cmd.Print("Split Header Signature:\n") - - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion - var sigV2 refs.Signature - signature.WriteToV2(&sigV2) - - cmd.Printf(" public key: %s\n", hex.EncodeToString(sigV2.GetKey())) - cmd.Printf(" signature: %s\n", hex.EncodeToString(sigV2.GetSign())) - } - parent := obj.Parent() if parent != nil { cmd.Print("\nSplit Parent Header:\n")