[#505] ir/container: Change the way to approve container delete event

Call `Delete` method on the wrapper over the Container contract's client
directly from `Processor.approveDeleteContainer`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-19 19:00:28 +03:00 committed by Alex Vanin
parent e3b4c9eda0
commit ff715c8037

View file

@ -9,10 +9,6 @@ import (
"go.uber.org/zap"
)
const (
deleteContainerMethod = "delete"
)
// Process new container from the user by checking container sanity
// and sending approve tx back to morph.
func (cp *Processor) processContainerPut(put *containerEvent.Put) {
@ -87,9 +83,8 @@ func (cp *Processor) checkDeleteContainer(e *containerEvent.Delete) error {
}
func (cp *Processor) approveDeleteContainer(e *containerEvent.Delete) {
err := cp.morphClient.NotaryInvoke(cp.containerContract, cp.feeProvider.SideChainFee(), deleteContainerMethod,
e.ContainerID(),
e.Signature())
// FIXME: here we should try notary invoke
err := cp.cnrClient.Delete(e.ContainerID(), e.Signature())
if err != nil {
cp.log.Error("could not approve delete container",
zap.String("error", err.Error()),