From 9cc23216cce860722a7d9cd8fc6ccbdda0321176 Mon Sep 17 00:00:00 2001 From: gpabst Date: Fri, 13 Dec 2024 09:04:43 -0500 Subject: [PATCH] feat: gate new rewards v2 commands to holesky --- pkg/operator/get_operator_split.go | 5 +++++ pkg/operator/set_operator_split.go | 5 +++++ pkg/rewards/claim.go | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/pkg/operator/get_operator_split.go b/pkg/operator/get_operator_split.go index b12d47b2..9e94c2e4 100644 --- a/pkg/operator/get_operator_split.go +++ b/pkg/operator/get_operator_split.go @@ -1,6 +1,7 @@ package operator import ( + "errors" "sort" "github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common" @@ -50,6 +51,10 @@ func GetOperatorSplit(cCtx *cli.Context, isProgrammaticIncentive bool) error { logger := common.GetLogger(cCtx) config, err := readAndValidateGetOperatorSplitConfig(cCtx, logger, isProgrammaticIncentive) + if config.Network != "holesky" { + return errors.New("getting operator split only supported on holesky with this version of CLI") + } + if err != nil { return eigenSdkUtils.WrapError("failed to read and validate operator split config", err) } diff --git a/pkg/operator/set_operator_split.go b/pkg/operator/set_operator_split.go index 2d5e43c1..aee16add 100644 --- a/pkg/operator/set_operator_split.go +++ b/pkg/operator/set_operator_split.go @@ -1,6 +1,7 @@ package operator import ( + "errors" "fmt" "sort" @@ -42,6 +43,10 @@ func SetOperatorSplit(cCtx *cli.Context, p utils.Prompter, isProgrammaticIncenti return eigenSdkUtils.WrapError("failed to read and validate operator split config", err) } + if config.Network != "holesky" { + return errors.New("setting operator split only supported on holesky with this version of CLI") + } + cCtx.App.Metadata["network"] = config.ChainID.String() ethClient, err := ethclient.Dial(config.RPCUrl) diff --git a/pkg/rewards/claim.go b/pkg/rewards/claim.go index fb078fca..c50a5127 100644 --- a/pkg/rewards/claim.go +++ b/pkg/rewards/claim.go @@ -222,6 +222,10 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error { return eigenSdkUtils.WrapError("failed to read and validate claim config", err) } + if config.Network != "holesky" && config.BatchClaimFile != "" { + return errors.New("batch claim only supported on holesky with this version of CLI") + } + cCtx.App.Metadata["network"] = config.ChainID.String() ethClient, err := ethclient.Dial(config.RPCUrl)