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

Live Video Payment Mechanism #3225

Merged
merged 8 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"github.com/livepeer/go-livepeer/server.(*LivepeerServer).HandlePush.func1", "github.com/rjeczalik/notify.(*nonrecursiveTree).dispatch",
"github.com/rjeczalik/notify.(*nonrecursiveTree).internal", "github.com/livepeer/lpms/stream.NewBasicRTMPVideoStream.func1", "github.com/patrickmn/go-cache.(*janitor).Run",
"github.com/golang/glog.(*fileSink).flushDaemon", "github.com/livepeer/go-livepeer/core.(*LivepeerNode).transcodeFrames.func2", "github.com/ipfs/go-log/writer.(*MirrorWriter).logRoutine",
"github.com/livepeer/go-livepeer/core.(*Balances).StartCleanup",

Check warning on line 93 in common/testutil.go

View check run for this annotation

Codecov / codecov/patch

common/testutil.go#L93

Added line #L93 was not covered by tests
}

res := make([]goleak.Option, 0, len(funcs2ignore))
Expand Down
7 changes: 7 additions & 0 deletions core/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@
orch.node.Balances.Debit(addr, manifestID, priceRat.Mul(priceRat, big.NewRat(pixels, 1)))
}

func (orch *orchestrator) Balance(addr ethcommon.Address, manifestID ManifestID) *big.Rat {
if orch.node == nil || orch.node.Balances == nil {
return nil
}
return orch.node.Balances.Balance(addr, manifestID)

Check warning on line 411 in core/orchestrator.go

View check run for this annotation

Codecov / codecov/patch

core/orchestrator.go#L407-L411

Added lines #L407 - L411 were not covered by tests
}

func (orch *orchestrator) Capabilities() *net.Capabilities {
if orch.node == nil {
return nil
Expand Down
Loading
Loading