More save reuse

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-29 23:26:12 +02:00
parent c2cb2c4184
commit b6b4c04cda

View File

@ -234,16 +234,7 @@ func (msa MultiSigActor) Approve(act *types.Actor, vmctx types.VMContext,
tx.Complete = true
}
newHead, err := vmctx.Storage().Put(self)
if err != nil {
return nil, aerrors.Wrap(err, "could not put new head")
}
err = vmctx.Storage().Commit(head, newHead)
if err != nil {
return nil, aerrors.Wrap(err, "could not commit new head")
}
return nil, nil
return nil, msa.save(vmctx, head, self)
}
func (msa MultiSigActor) Cancel(act *types.Actor, vmctx types.VMContext,
@ -265,16 +256,7 @@ func (msa MultiSigActor) Cancel(act *types.Actor, vmctx types.VMContext,
}
tx.Canceled = true
newHead, err := vmctx.Storage().Put(self)
if err != nil {
return nil, aerrors.Wrap(err, "could not put new head")
}
err = vmctx.Storage().Commit(head, newHead)
if err != nil {
return nil, aerrors.Wrap(err, "could not commit new head")
}
return nil, nil
return nil, msa.save(vmctx, head, self)
}
type MultiSigSigner struct {