revenue-distribution: add configure-contributor-rewards CLI command#257
Conversation
|
Hi @RedaRahmani thank you for addressing this. We are spending some time with this CLI interaction to make sure this works as we like. But as far as addressing the issue, looks good so far. Will keep you updated, thanks again |
|
Hey @karl-dz , Thanks for the update and the review! I’m happy to tweak anything around the CLI UX behavior if you’d like changes, just let me know. |
Hi @RedaRahmani apologies for the delay in reviewing this. I'm going to give it another pass through, but overall looks good. Can you update the CHANGELOG when you get a chance? Thank you |
c59fe7b to
2a58c93
Compare
|
Hey @karl-dz Thanks for the review, I’ve updated the |
revenue-distribution: add configure-contributor-rewards CLI command
Closes : malbeclabs/doublezero#2663
Description
What’s included
ContributorRewardsaccount:--recipient PUBKEY:PERCENTinputs (human percent 1–100) and converts internally to basis points.Supports mutually exclusive flags:
--block-protocol-management--allow-protocol-managementBlock/allowflag instruction is only sent when requested, If you don’t pass--block-protocol-managementor--allow-protocol-management, the command does not change the “protocol management blocked” setting. It will only update recipients (if you provided--recipient). If you pass block or allow, it includes that extraon-chaininstruction.Strong input validation:
PUBKEY:PERCENT, invalid pubkeys, duplicates, out-of-range percents, and totals that don’t sum to 100.ComputeBudgetCU limit instruction so thetxhas enough compute. If you set--with-compute-unit-price, it also includes a priority fee (CU price) instruction. Instruction building is done in a small helper function so we can unit test the exact instruction list (order + what’s included) without RPC/sending a tx.ContributorRewardsand fails early ifsigner != current rewards_manager_key.Tests
Added unit tests covering:
PUBKEY:PERCENTparsing (missing/extra:, invalid pubkey, non-numeric percent)--block-protocol-management/--allow-protocol-managementValidated end-to-end on localnet.