Skip to content

Updating output code path to correctly detect empty string input for caller-address #274

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

Conversation

bdchatham
Copy link
Contributor

@bdchatham bdchatham commented Dec 19, 2024

Updating output code path to correctly detect empty string input for caller-address. Because the input was wrapped in an address object, it defaulted to the 0x0.. address which doesn't match the empty string check enforced.

When the caller address is not provided we want to default to the account-address provided.

What Changed?

  • properly detects empty caller-address and replaces withaccount-address.

"github.com/urfave/cli/v2"
)

func PopulateCallerAddress(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could technically put this function in a more generic way where allocations commands can also use it. Instead of account address we can just say defaultAddress so we can pass account or operator address.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can push that in separate PR. should be fine for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Talked offline -- agree and thought about this but opting for easier solution to keep flags specific to their use-cases for now and will address in the CLI refactor workstream.

@bdchatham bdchatham merged commit 283790f into Layr-Labs:madhur/slashing-allocations Dec 19, 2024
6 checks passed
@bdchatham bdchatham deleted the chatham/bugfix-empty-caller-address branch December 19, 2024 00:44
shrimalmadhur pushed a commit that referenced this pull request Dec 19, 2024
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