[#505] morph/container: Change get container API

Make `Get` method of the wrapper over Container contract's client to
accept binary container ID. Create `Get` function similar to the previous
`Get` variation. Use this function in Container service server in the place
where `Get` method was used.

Additionally implement `AsContainerSource` function which allows
to simply compose container Source interface from the wrapper.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-19 19:32:25 +03:00 committed by Alex Vanin
parent 6310535b3c
commit 83c27f6e8a
6 changed files with 33 additions and 19 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper"
"github.com/nspcc-dev/neofs-node/pkg/morph/event/container"
"go.uber.org/zap"
)
@ -58,7 +59,7 @@ func (cp *Processor) checkEACLOwnership(binTable []byte, key *keys.PublicKey) er
}
// receive owner of the related container
cnr, err := cp.cnrClient.Get(table.CID())
cnr, err := wrapper.Get(cp.cnrClient, table.CID())
if err != nil {
return fmt.Errorf("could not receive the container: %w", err)
}