More save reuse
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
c2cb2c4184
commit
b6b4c04cda
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user