Skip to content

fix: PrettyPrintStruct was panicing due to incorrect reflect parsing #324

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seanmcgary
Copy link
Member

Original error:

------- Claim generated -------
panic: reflect: call of reflect.Value.NumField on ptr Value

goroutine 1 [running]:
reflect.flag.mustBe(...)
        /Users/seanmcgary/Code/gocode/go1.23.6/src/reflect/value.go:218
reflect.Value.NumField({0x10590df60?, 0x140004ddd60?, 0x1400061efe8?})
        /Users/seanmcgary/Code/gocode/go1.23.6/src/reflect/value.go:2111 +0x90
github.com/Layr-Labs/eigenlayer-cli/pkg/internal/common.PrettyPrintStruct({0x10590df60?, 0x140004ddd60?})
        /Users/seanmcgary/Code/eigenlayer-cli/pkg/internal/common/print.go:12 +0x1f0
github.com/Layr-Labs/eigenlayer-cli/pkg/rewards.broadcastClaims(0x14000000480, 0x1400051a680, {0x105b86a60, 0x1400051a5d0}, {0x105b80aa0, 0x106411500}, {0x105b7ec30, 0x106411500}, {0x1400061f6e0, 0x1, ...})
        /Users/seanmcgary/Code/eigenlayer-cli/pkg/rewards/claim.go:438 +0x8b0
github.com/Layr-Labs/eigenlayer-cli/pkg/rewards.ClaimCmd.Execute({{0x105b80aa0?, 0x106411500?}}, 0x1400026e2c0)
        /Users/seanmcgary/Code/eigenlayer-cli/pkg/rewards/claim.go:315 +0x3d8
github.com/Layr-Labs/eigenlayer-cli/pkg/internal/command.NewWriteableCallDataCommand.func1(0x1400026e2c0?)
        /Users/seanmcgary/Code/eigenlayer-cli/pkg/internal/command/NewWriteableCallDataCommand.go:29 +0x30
github.com/urfave/cli/v2.(*Command).Run(0x140001551e0, 0x1400026e2c0, {0x140000c0300, 0x10, 0x10})
        /Users/seanmcgary/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/urfave/cli/[email protected]/command.go:276 +0x600
github.com/urfave/cli/v2.(*Command).Run(0x14000155600, 0x1400026e200, {0x14000000360, 0x11, 0x11})
        /Users/seanmcgary/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0x83c
github.com/urfave/cli/v2.(*Command).Run(0x140002bc000, 0x1400026e0c0, {0x140001c4000, 0x12, 0x12})
        /Users/seanmcgary/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0x83c
github.com/urfave/cli/v2.(*App).RunContext(0x140002b9400, {0x105b7ec30, 0x106411500}, {0x140001c4000, 0x12, 0x12})
        /Users/seanmcgary/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/urfave/cli/[email protected]/app.go:333 +0x51c
github.com/urfave/cli/v2.(*App).Run(...)
        /Users/seanmcgary/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/urfave/cli/[email protected]/app.go:307
main.main()
        /Users/seanmcgary/Code/eigenlayer-cli/cmd/eigenlayer/main.go:48 +0x4f4
exit status 2

What Changed?

This change fixes the reflect logic to correctly print the object and not panic.

@seanmcgary seanmcgary requested a review from shrimalmadhur May 1, 2025 13:57
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.

1 participant