Skip to content

feat: Get and set commands for operatorset split #287

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

Merged

Conversation

gpabst
Copy link
Contributor

@gpabst gpabst commented Feb 9, 2025

Adds get and set commands for operatorset split

@gpabst gpabst marked this pull request as ready for review February 10, 2025 22:48
@gpabst gpabst requested a review from bdchatham February 25, 2025 21:35
@@ -46,14 +46,11 @@ func getGetOperatorSplitFlags() []cli.Flag {
return baseFlags
}

func GetOperatorSplit(cCtx *cli.Context, isProgrammaticIncentive bool) error {
func GetOperatorSplit(cCtx *cli.Context, isProgrammaticIncentive bool, isOperatorSet bool) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually suggested against passing booleans to alter code branches of a method. Makes methods hard to immediately understand for users. I'd recommend making this an interface and having separate implementations and explicitly implementing only the logic which is different. In this case, you'd have some method getSplit that each interface implements and the generic code will call the implementation given for the specific struct you've created.

Name: "get-operatorset-split",
Usage: "Get OperatorSet rewards split",
Action: func(cCtx *cli.Context) error {
return GetOperatorSplit(cCtx, true, true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the previous comment about parameters I'd suggest constructing the applicable version of the GetOperatorSplit struct here, then you get the right behavior.

@gpabst gpabst merged commit 9611414 into madhur/slashing-allocations Feb 26, 2025
10 checks passed
@gpabst gpabst deleted the george-elo-464-rewards-v21-cli-sdk-updates branch February 26, 2025 19:18
@gpabst gpabst restored the george-elo-464-rewards-v21-cli-sdk-updates branch February 26, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants