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

Backend [Integration Test] bounty.go handlers PollInvoice For Bounty Keysend Payment #1586

Closed
2 tasks
elraphty opened this issue Mar 5, 2024 · 2 comments · Fixed by #1597
Closed
2 tasks
Assignees
Labels
backend bounties go Pull requests that update Go code Posted testing
Milestone

Comments

@elraphty
Copy link
Contributor

elraphty commented Mar 5, 2024

Context

We are trying to increase the test coverage for our Golang backend.

File to to test

handlers/bounty.go

Design

Write tests for the bounty handlers, the test should:

  • Should test that a 401 error is returned if a user is unauthorized
  • Mock a call to relay GET /invoice?payment_request=${paymentRequest} to get the status of the invoice
  • If there is an invoice error a 403 status error should be returned
  • If the invoice is settled and the invoice.Type is equal to KEYSEND mock a keysend payment to relay /payment with body request of bodyData := utils.BuildKeysendBodyData(amount, invData.UserPubkey, invData.RouteHint)
  • If the mock relay payment is successful update the bounty associated with the invoice and set the paid = true.

Tribes Handlers To Test

PollInvoice

Add tests to bounty_test.go

Acceptance Criteria

  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 2 days of taking the bounty

References

Here is an example backend test

@elraphty elraphty added backend bounties go Pull requests that update Go code testing labels Mar 5, 2024
@elraphty elraphty added this to the UCI Tests milestone Mar 5, 2024
@AbdulWahab3181
Copy link
Contributor

AbdulWahab3181 commented Mar 5, 2024

@ecurrencyhodler could you please assign me?

@AbdulWahab3181
Copy link
Contributor

@ecurrencyhodler Could you please assign me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bounties go Pull requests that update Go code Posted testing
Projects
Status: ✅ Done
3 participants