From db981e9c99391817e85420be97f85c8997259f02 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 22 Nov 2022 20:21:10 +0300 Subject: [PATCH] [#2079] cli: Do not panic in `object hash` Sign RPC requests with the provided key. Signed-off-by: Pavel Karpy --- CHANGELOG.md | 1 + cmd/neofs-cli/modules/object/hash.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb2d23bd5..ef5afb33b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ Changelog for NeoFS Node - Write-cache flush duplication (#2074) - Ignore error if a transaction already exists in a morph client (#2075) - Pack arguments of `setPrice` invocation during contract update (#2078) +- `neofs-cli object hash` panic (#2079) ### Removed ### Updated diff --git a/cmd/neofs-cli/modules/object/hash.go b/cmd/neofs-cli/modules/object/hash.go index 3695d0d30..c5a5b6283 100644 --- a/cmd/neofs-cli/modules/object/hash.go +++ b/cmd/neofs-cli/modules/object/hash.go @@ -64,11 +64,13 @@ func getObjectHash(cmd *cobra.Command, _ []string) { common.ExitOnErr(cmd, "could not decode salt: %w", err) pk := key.GetOrGenerate(cmd) + cli := internalclient.GetSDKClientByFlag(cmd, pk, commonflags.RPC) tz := typ == hashTz fullHash := len(ranges) == 0 if fullHash { var headPrm internalclient.HeadObjectPrm + headPrm.SetClient(cli) Prepare(cmd, &headPrm) headPrm.SetAddress(objAddr) @@ -94,8 +96,6 @@ func getObjectHash(cmd *cobra.Command, _ []string) { return } - cli := internalclient.GetSDKClientByFlag(cmd, pk, commonflags.RPC) - var hashPrm internalclient.HashPayloadRangesPrm hashPrm.SetClient(cli) Prepare(cmd, &hashPrm)