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 tx.Complete = true
} }
newHead, err := vmctx.Storage().Put(self) return nil, msa.save(vmctx, head, 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
} }
func (msa MultiSigActor) Cancel(act *types.Actor, vmctx types.VMContext, 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 tx.Canceled = true
newHead, err := vmctx.Storage().Put(self) return nil, msa.save(vmctx, head, 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
} }
type MultiSigSigner struct { type MultiSigSigner struct {