refactor: move collect inside paych manager

This commit is contained in:
Dirk McCormick
2020-08-10 13:21:25 -04:00
parent fb0afbf3b0
commit a6100b7e46
3 changed files with 33 additions and 19 deletions
+1 -19
View File
@@ -116,25 +116,7 @@ func (a *PaychAPI) PaychSettle(ctx context.Context, addr address.Address) (cid.C
}
func (a *PaychAPI) PaychCollect(ctx context.Context, addr address.Address) (cid.Cid, error) {
ci, err := a.PaychMgr.GetChannelInfo(addr)
if err != nil {
return cid.Undef, err
}
msg := &types.Message{
To: addr,
From: ci.Control,
Value: types.NewInt(0),
Method: builtin.MethodsPaych.Collect,
}
smsg, err := a.MpoolPushMessage(ctx, msg)
if err != nil {
return cid.Undef, err
}
return smsg.Cid(), nil
return a.PaychMgr.Collect(ctx, addr)
}
func (a *PaychAPI) PaychVoucherCheckValid(ctx context.Context, ch address.Address, sv *paych.SignedVoucher) error {