Skip to content
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

Don't validate validator addresses #173

Closed
webmaster128 opened this issue May 30, 2024 · 0 comments · Fixed by #183
Closed

Don't validate validator addresses #173

webmaster128 opened this issue May 30, 2024 · 0 comments · Fixed by #183
Assignees
Milestone

Comments

@webmaster128
Copy link
Member

webmaster128 commented May 30, 2024

In some places in MultiTest, validator addresses are validated with let val_addr = api.addr_validate(&validator.address)?;. But the validator addresses are not the same as regular account addresses. I.e. I cannot use MultiTest to test with validator addresses.

Usually they have a different prefix, like mychainvaloper1... instead of mychain1.... This is the reason why they are always typed as String in cosmwasm-std, not Addr. The Addr type only works for user addresses.

So we need to avoid the use of the Addr type in the staking implementation:

  • const VALIDATOR_MAP: Map<&Addr, Validator> = Map::new("validator_map");
  • const VALIDATOR_INFO: Map<&Addr, ValidatorInfo> = Map::new("validator_info");
  • pub validator: Addr,
  • fn add_validator
  • StakingMsg::Delegate implementation
  • StakingQuery::Delegation implementation
  • ...
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 a pull request may close this issue.

2 participants