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

How about adding single validator staking query #819

Closed
yun-yeo opened this issue Mar 5, 2021 · 5 comments · Fixed by #879
Closed

How about adding single validator staking query #819

yun-yeo opened this issue Mar 5, 2021 · 5 comments · Fixed by #879
Assignees
Milestone

Comments

@yun-yeo
Copy link

yun-yeo commented Mar 5, 2021

Currently Cosmwasm only has all validators query here

pub fn query_validators(&self) -> StdResult<Vec<Validator>> {
let request = StakingQuery::Validators {}.into();
let res: ValidatorsResponse = self.query(&request)?;
Ok(res.validators)
}

In many cases, a contract does not want all validators info, but just want a single validator info or some validators info. so changing query_validators query to receive the optional validator_addresses will make query_validators cost efficient.

@ethanfrey
Copy link
Member

Nice point. We have not used these queries heavily, so the APIs were best guesses.

I would rather add a new query type (that required one address and returns one value, not an array). But the idea is valid.

@yun-yeo
Copy link
Author

yun-yeo commented Mar 7, 2021

Yea thanks for consideration. I think adding new type of query also good approach.

@ethanfrey
Copy link
Member

What about including this in 0.14 milestone?

@webmaster128
Copy link
Member

Yeah, sure. Sounds straight forward.

@webmaster128 webmaster128 added this to the 0.14.0 milestone Apr 7, 2021
@webmaster128 webmaster128 self-assigned this Apr 14, 2021
@webmaster128 webmaster128 assigned yun-yeo and unassigned yun-yeo Apr 14, 2021
@webmaster128
Copy link
Member

@YunSuk-Yeo, this is implemented in #879. Thanks for opening the issue.

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.

3 participants