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

Invalid type used in whitelist query registration #5048

Closed
byeongsu-hong opened this issue May 2, 2023 · 0 comments · Fixed by #5066
Closed

Invalid type used in whitelist query registration #5048

byeongsu-hong opened this issue May 2, 2023 · 0 comments · Fixed by #5066

Comments

@byeongsu-hong
Copy link
Contributor

byeongsu-hong commented May 2, 2023

setWhitelistedQuery("/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountOut", &poolmanagerqueryproto.EstimateSwapExactAmountOutRequest{})

I encountered an error when trying to query EstimateSwapExactAmountOut in a Cosmwasm contract. The error message stated, Simulate query error. err: 'Error parsing into type osmosis_std::types::osmosis::poolmanager::v1beta1::EstimateSwapExactAmountOutResponse: missing field token_in_amount'

To perform the query without errors, the code should be written as follows:

let resp: EstimateSwapExactAmountOutRequest = deps.querier.query(
    &EstimateSwapExactAmountOutRequest {
        sender,
        pool_id,
        token_out,
        routes,
    }
    .into(),
)?;

Note that the EstimateSwapExactAmountOutRequest type should be used instead of the EstimateSwapExactAmountOutResponse type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant