Skip to content

Commit

Permalink
Updating appointee mutation commands to use tx receipt.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdchatham committed Dec 10, 2024
1 parent b860ca8 commit 239d36c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Layr-Labs/eigenlayer-contracts v0.3.2-mainnet-rewards
github.com/Layr-Labs/eigenlayer-rewards-proofs v0.2.12
github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-5c11a259293e
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210204558-54685ff8f493
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210222107-c2ed40624db7
github.com/blang/semver/v4 v4.0.0
github.com/consensys/gnark-crypto v0.12.1
github.com/ethereum/go-ethereum v1.14.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-
github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-5c11a259293e/go.mod h1:T7tYN8bTdca2pkMnz9G2+ZwXYWw5gWqQUIu4KLgC/vM=
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210204558-54685ff8f493 h1:9HsmuJAML9mcV0zBgQCmLVfCGb+QkHB8qsntwxrE55c=
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210204558-54685ff8f493/go.mod h1:aYdNURUhaqeYOS+Cq12TfSdPbjFfiLaHkxPdR4Exq/s=
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210222107-c2ed40624db7 h1:1kehcGgMyVloGzrd36CSibYz+fC2BkKV0fqeYCpovIQ=
github.com/Layr-Labs/eigensdk-go v0.1.14-0.20241210222107-c2ed40624db7/go.mod h1:aYdNURUhaqeYOS+Cq12TfSdPbjFfiLaHkxPdR4Exq/s=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
Expand Down
10 changes: 8 additions & 2 deletions pkg/user/appointee/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/Layr-Labs/eigensdk-go/logging"
eigenSdkUtils "github.com/Layr-Labs/eigensdk-go/utils"
gethcommon "github.com/ethereum/go-ethereum/common"
gethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"

"github.com/urfave/cli/v2"
Expand All @@ -21,7 +22,7 @@ type RemoveUserPermissionWriter interface {
RemovePermission(
ctx context.Context,
request elcontracts.RemovePermissionRequest,
) error
) (*gethtypes.Receipt, error)
}

func RemoveCmd(readerGenerator func(logging.Logger, *removeConfig) (RemoveUserPermissionWriter, error)) *cli.Command {
Expand Down Expand Up @@ -58,7 +59,7 @@ func removeUserPermission(
if err != nil {
return err
}
return permissionWriter.RemovePermission(
receipt, err := permissionWriter.RemovePermission(
ctx,
elcontracts.RemovePermissionRequest{
Account: config.AccountAddress,
Expand All @@ -68,6 +69,11 @@ func removeUserPermission(
WaitForReceipt: true,
},
)
if err != nil {
return err
}
common.PrintTransactionInfo(receipt.TxHash.String(), config.ChainID)
return nil
}

func generateRemoveUserPermissionWriter(
Expand Down
10 changes: 8 additions & 2 deletions pkg/user/appointee/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/Layr-Labs/eigensdk-go/logging"
eigenSdkUtils "github.com/Layr-Labs/eigensdk-go/utils"
gethcommon "github.com/ethereum/go-ethereum/common"
gethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"

"github.com/urfave/cli/v2"
Expand All @@ -21,7 +22,7 @@ type SetUserPermissionWriter interface {
SetPermission(
ctx context.Context,
request elcontracts.SetPermissionRequest,
) error
) (*gethtypes.Receipt, error)
}

func SetCmd(generator func(logging.Logger, *setConfig) (SetUserPermissionWriter, error)) *cli.Command {
Expand Down Expand Up @@ -58,7 +59,7 @@ func setUserPermission(
if err != nil {
return err
}
return permissionWriter.SetPermission(
receipt, err := permissionWriter.SetPermission(
ctx,
elcontracts.SetPermissionRequest{
Account: config.AccountAddress,
Expand All @@ -68,6 +69,11 @@ func setUserPermission(
WaitForReceipt: true,
},
)
if err != nil {
return err
}
common.PrintTransactionInfo(receipt.TxHash.String(), config.ChainID)
return nil
}

func generateSetUserPermissionWriter(
Expand Down

0 comments on commit 239d36c

Please sign in to comment.