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

Use ContractInfoResponse from cosmwasm_std #646

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

webmaster128
Copy link
Member

If I understand correctly, "due to non_exhaustive" really means we have no way to construct it. This is a feature initially because ContractInfoResponse instances are always provided to the contract developer and it should be hard to create them.

In CosmWasm/cosmwasm#1177 a constructor was added sets the two fields which have no default and use default values for the rest. This can be used now to remove the copied type.

@@ -25,20 +25,6 @@ use cosmwasm_std::testing::mock_wasmd_attr;

use anyhow::{bail, Context, Result as AnyResult};

// TODO: we should import this from cosmwasm-std, but cannot due to non_exhaustive so copy here
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ContractInfoResponse {
Copy link
Member Author

Choose a reason for hiding this comment

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

This pub was never used, right? At least I did not find something.

Copy link
Member

Choose a reason for hiding this comment

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

It was not. Maybe pub for test cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably just copy/paste from the cosmwasm repo

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Good cleanup now we updated the deps.

Thanks.

@ethanfrey ethanfrey merged commit 3a58302 into main Feb 2, 2022
@ethanfrey ethanfrey deleted the dedup-ContractInfoResponse branch February 2, 2022 19:56
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