Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new retrieval market Client API functions from latest go-fil-markets #1552

Closed
shannonwells opened this issue Apr 16, 2020 · 0 comments · Fixed by #1565
Closed

Implement new retrieval market Client API functions from latest go-fil-markets #1552

shannonwells opened this issue Apr 16, 2020 · 0 comments · Fixed by #1565
Assignees

Comments

@shannonwells
Copy link
Contributor

Description

go-fil-markets PR #190 modifies the return values of its Client API function, GetOrCreatePaymentChannel, and adds two API calls to the retrieval market API which allow creating or adding funds to a payment channel to be non-blocking waiting for messages to be on chain.

  1. Modify GetOrCreatePaymentChannel:

    • if payment channel does not exist, call create without waiting for the message to be mined, then return address.Undef, message CID, error/nil
    • If payment channel exists, send requested funds to the payment channel without waiting for the message to be mined, then return the payment channel address, message CID, error/nil
  2. Implement WaitForPaymentChannelCreation

     // WaitForPaymentChannelCreation waits for a message on chain that a
     // payment channel has been created
     WaitForPaymentChannelCreation(messageCID cid.Cid) (address.Address, error)
    

    If the message is mined within the timeout, return the new payment channel unique address.
    This function also receives a message CID to wait for with a timeout after which it will error.

  3. Implement WaitForPaymentChannelAddFunds

     // WaitForPaymentChannelAddFunds waits for a message on chain that funds have
     // been sent to a payment channel
     WaitForPaymentChannelAddFunds(messageCID cid.Cid) error
    

    This function receives a message CID to wait for with a timeout, after which it returns error, otherwise nil

This function will return

Acceptance criteria

Above implemented as subscribed, with unit tests and integration test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants