[#1454] Upgrade NeoFS SDK Go module with new IDs

Core changes:
 * avoid package-colliding variable naming
 * avoid using pointers to IDs where unnecessary
 * avoid using `idSDK` import alias pattern
 * use `EncodeToString` for protocol string calculation and `String` for
  printing

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-31 20:00:41 +03:00 committed by LeL
parent cc6209e8a0
commit 1c30414a6c
218 changed files with 2095 additions and 2521 deletions

View file

@ -13,13 +13,8 @@ import (
//
// Returns error if container ID is nil.
func Delete(c *Client, witness core.RemovalWitness) error {
id := witness.ContainerID()
if id == nil {
return errNilArgument
}
binCnr := make([]byte, sha256.Size)
id.Encode(binCnr)
witness.ContainerID().Encode(binCnr)
var prm DeletePrm
@ -35,7 +30,7 @@ func Delete(c *Client, witness core.RemovalWitness) error {
// DeletePrm groups parameters of Delete client operation.
type DeletePrm struct {
cid []byte
cnr []byte
signature []byte
token []byte
@ -44,7 +39,7 @@ type DeletePrm struct {
// SetCID sets container ID.
func (d *DeletePrm) SetCID(cid []byte) {
d.cid = cid
d.cnr = cid
}
// SetSignature sets signature.
@ -71,7 +66,7 @@ func (c *Client) Delete(p DeletePrm) error {
prm := client.InvokePrm{}
prm.SetMethod(deleteMethod)
prm.SetArgs(p.cid, p.signature, p.token)
prm.SetArgs(p.cnr, p.signature, p.token)
prm.InvokePrmOptional = p.InvokePrmOptional
err := c.client.Invoke(prm)