Repository navigation
Add recipient and deposit options to TicketBroker funding - #83
Merged
Merged
Conversation
Allow funding a separate account with --recipient. Use --deposit and --reserve with zero defaults, reject zero totals, and retain --amount as a silent compatibility alias tracked for removal in #72.
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues with the recipient-aware funding change.
No open issues 🎉
What changed in this PR
Extends the chain CLI’s TicketBroker funding command so the configured wallet can fund its own account or another recipient.
Changes:
- Supports independent
--depositand--reserveamounts, defaulting omitted values to zero and rejecting a zero total before RPC access. - Preserves
--amountas a silent alias for--deposit, while help and documentation use canonical flags. - Expands coverage for recipient funding, transaction encoding and signing, validation, help, and completion.
| File | Description |
|---|---|
go.mod |
Promotes pflag to a direct dependency for flag alias normalization. |
docs/chain.md |
Documents optional funding amounts and recipient selection. |
configs/chain/config.example.toml |
Updates the commented example to use --deposit. |
chain/transactions_test.go |
Adds signed recipient-funding transaction coverage. |
chain/params.go |
Defines deposit/reserve defaults and the optional recipient. |
chain/management_test.go |
Tests calldata, alias ordering, and single-sided funding. |
chain/cli.go |
Registers the funding command with the silent --amount alias. |
chain/cli_test.go |
Updates validation, help/completion, and input-source tests. |
chain/actions.go |
Builds recipient-aware funding actions and validates amounts. |
Review effort: Balanced
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
livepeer chain ticketbroker fund --recipient ADDRESSto fund another account's TicketBroker deposit and reserve using the configured wallet's ETH.Use
--depositand--reserveseparately or together in one transaction. Omitted amounts default to zero, and a zero total is rejected before RPC access. Existing scripts can continue using--amountas a silent alias for--deposit; its removal is tracked as C15 in #72. Help and documentation use the canonical flags.Validation:
go test ./chain ./cmd/livepeer -shortgo test ./cmd/livepeer -run '^TestRealBinaryOffchainFlow$' -count=1Coverage includes recipient/sender separation, signed transaction value and calldata, omitted and zero amounts, alias ordering, and CLI help/completion.