call paychmgr wait funcs, make sure tests are passing

This commit is contained in:
shannonwells 2020-04-20 14:44:27 -07:00
parent 162784e98f
commit a9c98eab8d
3 changed files with 10 additions and 7 deletions

2
go.sum
View File

@ -147,8 +147,6 @@ github.com/filecoin-project/go-data-transfer v0.0.0-20200408061858-82c58b423ca6/
github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5 h1:yvQJCW9mmi9zy+51xA01Ea2X7/dL7r8eKDPuGUjRmbo= github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5 h1:yvQJCW9mmi9zy+51xA01Ea2X7/dL7r8eKDPuGUjRmbo=
github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5/go.mod h1:JbkIgFF/Z9BDlvrJO1FuKkaWsH673/UdFaiVS6uIHlA= github.com/filecoin-project/go-fil-commcid v0.0.0-20200208005934-2b8bd03caca5/go.mod h1:JbkIgFF/Z9BDlvrJO1FuKkaWsH673/UdFaiVS6uIHlA=
github.com/filecoin-project/go-fil-markets v0.0.0-20200114015428-74d100f305f8/go.mod h1:c8NTjvFVy1Ud02mmGDjOiMeawY2t6ALfrrdvAB01FQc= github.com/filecoin-project/go-fil-markets v0.0.0-20200114015428-74d100f305f8/go.mod h1:c8NTjvFVy1Ud02mmGDjOiMeawY2t6ALfrrdvAB01FQc=
github.com/filecoin-project/go-fil-markets v0.0.0-20200413201123-731e6ca89984 h1:QY5jgd5T4txUEC2k9BPqWRlhDUTdFx5f1z/StOlh92g=
github.com/filecoin-project/go-fil-markets v0.0.0-20200413201123-731e6ca89984/go.mod h1:vcX3y5FVyuclIZgogPG1uIvJxHLSBU54B1ANJ88uMNk=
github.com/filecoin-project/go-fil-markets v0.0.0-20200415011556-4378bd41b91f h1:mPmWWrEwc/5zZW2E14m8a7HMrrOWREaflGZL1Iun/Aw= github.com/filecoin-project/go-fil-markets v0.0.0-20200415011556-4378bd41b91f h1:mPmWWrEwc/5zZW2E14m8a7HMrrOWREaflGZL1Iun/Aw=
github.com/filecoin-project/go-fil-markets v0.0.0-20200415011556-4378bd41b91f/go.mod h1:vcX3y5FVyuclIZgogPG1uIvJxHLSBU54B1ANJ88uMNk= github.com/filecoin-project/go-fil-markets v0.0.0-20200415011556-4378bd41b91f/go.mod h1:vcX3y5FVyuclIZgogPG1uIvJxHLSBU54B1ANJ88uMNk=
github.com/filecoin-project/go-padreader v0.0.0-20200210211231-548257017ca6 h1:92PET+sx1Hb4W/8CgFwGuxaKbttwY+UNspYZTvXY0vs= github.com/filecoin-project/go-padreader v0.0.0-20200210211231-548257017ca6 h1:92PET+sx1Hb4W/8CgFwGuxaKbttwY+UNspYZTvXY0vs=

View File

@ -65,11 +65,13 @@ func (rcn *retrievalClientNode) GetChainHead(ctx context.Context) (shared.TipSet
return head.Key().Bytes(), head.Height(), nil return head.Key().Bytes(), head.Height(), nil
} }
// WaitForPaymentChannelAddFunds waits for messageCID to appear on chain.
func (rcn *retrievalClientNode) WaitForPaymentChannelAddFunds(messageCID cid.Cid) error { func (rcn *retrievalClientNode) WaitForPaymentChannelAddFunds(messageCID cid.Cid) error {
panic("implement me") return rcn.pmgr.WaitForAddFundsMsg(context.TODO(), messageCID)
} }
// WaitForPaymentChannelCreation waits for messageCID to appear on chain and returns
// the address of the payment channel
func (rcn *retrievalClientNode) WaitForPaymentChannelCreation(messageCID cid.Cid) (address.Address, error) { func (rcn *retrievalClientNode) WaitForPaymentChannelCreation(messageCID cid.Cid) (address.Address, error) {
panic("implement me") return rcn.pmgr.WaitForPaychCreateMsg(context.TODO(), messageCID)
} }

View File

@ -49,7 +49,9 @@ func (pm *Manager) createPaych(ctx context.Context, from, to address.Address, am
return smsg.Cid(), nil return smsg.Cid(), nil
} }
func (pm *Manager) waitForPaychCreateMsg(ctx context.Context, mcid cid.Cid) (address.Address, error) { // WaitForPaychCreateMsg waits for mcid to appear on chain and returns the robust address of the
// created payment channel
func (pm *Manager) WaitForPaychCreateMsg(ctx context.Context, mcid cid.Cid) (address.Address, error) {
mwait, err := pm.state.StateWaitMsg(ctx, mcid) mwait, err := pm.state.StateWaitMsg(ctx, mcid)
if err != nil { if err != nil {
return address.Undef, xerrors.Errorf("wait msg: %w", err) return address.Undef, xerrors.Errorf("wait msg: %w", err)
@ -95,7 +97,8 @@ func (pm *Manager) addFunds(ctx context.Context, ch address.Address, from addres
return smsg.Cid(), nil return smsg.Cid(), nil
} }
func (pm *Manager) waitForAddFundsMsg(ctx context.Context, mcid cid.Cid) error { // WaitForAddFundsMsg waits for mcid to appear on chain and returns error, if any
func (pm *Manager) WaitForAddFundsMsg(ctx context.Context, mcid cid.Cid) error {
mwait, err := pm.state.StateWaitMsg(ctx, mcid) // TODO: wait outside the store lock! mwait, err := pm.state.StateWaitMsg(ctx, mcid) // TODO: wait outside the store lock!
if err != nil { if err != nil {