[#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

@ -8,7 +8,7 @@ import (
// RemovalWitness groups the information required
// to prove and verify the removal of a container.
type RemovalWitness struct {
cid *cid.ID
cnr cid.ID
sig []byte
@ -17,14 +17,14 @@ type RemovalWitness struct {
// ContainerID returns the identifier of the container
// to be removed.
func (x RemovalWitness) ContainerID() *cid.ID {
return x.cid
func (x RemovalWitness) ContainerID() cid.ID {
return x.cnr
}
// SetContainerID sets the identifier of the container
// to be removed.
func (x *RemovalWitness) SetContainerID(id *cid.ID) {
x.cid = id
func (x *RemovalWitness) SetContainerID(id cid.ID) {
x.cnr = id
}
// Signature returns the signature of the container identifier.

View file

@ -27,10 +27,10 @@ func TestCheckFormat(t *testing.T) {
require.Error(t, CheckFormat(c))
var oid user.ID
user.IDFromKey(&oid, test.DecodeKey(-1).PublicKey)
var idUser user.ID
user.IDFromKey(&idUser, test.DecodeKey(-1).PublicKey)
c.SetOwnerID(&oid)
c.SetOwnerID(&idUser)
// set incorrect nonce
cV2 := c.ToV2()

View file

@ -19,7 +19,7 @@ type Source interface {
//
// Implementations must not retain the container pointer and modify
// the container through it.
Get(*cid.ID) (*container.Container, error)
Get(cid.ID) (*container.Container, error)
}
// IsErrNotFound checks if the error returned by Source.Get corresponds