go-livepeer icon indicating copy to clipboard operation
go-livepeer copied to clipboard

BYOC: fix payment ticket count calc

Open ad-astra-video opened this issue 5 months ago • 1 comments

What does this pull request do? Explain your changes. (required)

Updates createPayment to accurately calculate ticket count.

Specific updates (required)

  • The slice created with make did not have a length as expected. Instead it has a capacity of the provided len(ticket.SenderParams)

How did you test each of these updates (required)

Tested locally using Agent SPE request example and observed the ticket count changed with each change in timeout_seconds in the request to accurately send 1 ticket per second of expected compute.

Does this pull request close any open issues?

Checklist:

  • [ ] Read the contribution guide
  • [X] make runs successfully
  • [X] All tests in ./test.sh pass
  • [ ] README and other documentation updated
  • [ ] Pending changelog updated

ad-astra-video avatar Jun 26 '25 12:06 ad-astra-video

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 31.96943%. Comparing base (32516bc) to head (64597cb). Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3650         +/-   ##
===================================================
+ Coverage   31.86089%   31.96943%   +0.10854%     
===================================================
  Files            156         156                 
  Lines          47359       47364          +5     
===================================================
+ Hits           15089       15142         +53     
+ Misses         31382       31328         -54     
- Partials         888         894          +6     
Files with missing lines Coverage Δ
server/job_rpc.go 30.02309% <100.00000%> (+6.56200%) :arrow_up:

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 32516bc...64597cb. Read the comment docs.

Files with missing lines Coverage Δ
server/job_rpc.go 30.02309% <100.00000%> (+6.56200%) :arrow_up:

... and 2 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 26 '25 13:06 codecov[bot]