refactor(poa)!: parse validator address as AccAddress#144
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIntroduces ChangesPOA message validation and keeper parsing fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
AdriaCarrera
left a comment
There was a problem hiding this comment.
Also add ValidateBasic function for message validation
| return k.authority | ||
| } | ||
|
|
||
| // parseValidatorAddress parses a validator's account address (the cosmos.AddressString |
There was a problem hiding this comment.
This function is not needed. Remove it and perform the parsing at each time.
| { | ||
| name: "remove unexisting validator - random address - with balance", | ||
| valAddress: randomValAddr.String(), | ||
| valAddress: randomAccs[0].Address.String(), |
There was a problem hiding this comment.
Why not sdk.AccAddress(randomValAddr).String()?
parse validator address as AccAddress
The address parameter in MsgAddValidator and MsgRemoveValidator should always be of type AccAddress. ExecuteRemoveValidator parsed it as a ValAddress (ethmvaloper1…), contradicting the cosmos.AddressString proto annotation and AddValidator's behavior.
Changes
Considerations
Summary by CodeRabbit
Release Notes