[#525] morph/container: Accept container session token in Delete

`Delete` method of latest `Container` contract accepts binary session token
as an argument.

Provide `DeleteArgs.SetSessionToken` method. Accept session token as a
`[]byte` in `Wrapper.Put` method and attach it to `PutArgs`. Marshal session
token from `RemovalWitness` in `wrapper.Delete` function and pass it to the
method.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-26 14:01:38 +03:00 committed by Leonard Lyubich
parent 166e5440ab
commit 631d7b0e07
3 changed files with 17 additions and 4 deletions

View file

@ -124,7 +124,7 @@ func (cp *Processor) checkDeleteContainer(e *containerEvent.Delete) error {
func (cp *Processor) approveDeleteContainer(e *containerEvent.Delete) {
// FIXME: here we should try notary invoke
err := cp.cnrClient.Delete(e.ContainerID(), e.Signature())
err := cp.cnrClient.Delete(e.ContainerID(), e.Signature(), nil)
if err != nil {
cp.log.Error("could not approve delete container",
zap.String("error", err.Error()),