[#33] session/storage: Change Get method signature

In previous implementation session Storage.Get method took a v2 owner
identifier as an argument.

Change method signature to as an argument owner identifier from NeoFS SDK.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-21 12:38:13 +03:00 committed by Alex Vanin
parent 4024b3c30e
commit d3b5ff9526

View file

@ -5,7 +5,7 @@ import (
"sync"
"github.com/mr-tron/base58"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
)
type key struct {
@ -34,8 +34,8 @@ func New() *TokenStore {
// Get returns private token corresponding to the given identifiers.
//
// Returns nil is there is no element in storage.
func (s *TokenStore) Get(ownerID *refs.OwnerID, tokenID []byte) *PrivateToken {
ownerBytes, err := ownerID.StableMarshal(nil)
func (s *TokenStore) Get(ownerID *owner.ID, tokenID []byte) *PrivateToken {
ownerBytes, err := ownerID.ToV2().StableMarshal(nil)
if err != nil {
panic(err)
}