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

Add proc macro package for automatic IndexList<T> implementation #737

Merged
merged 8 commits into from
Jul 17, 2022

Conversation

y-pakorn
Copy link
Contributor

@y-pakorn y-pakorn commented Jun 14, 2022

This will resolve #736

macro crate feature on cw-storage-plus is not enabled by default.

cw-storage-macro doesn't need to be published into crate.io because the macro is re-exported in cw-storage-plus package.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct Token {
  pub owner: Addr,
  pub ticker: String,
  pub identifier: u8,
}

#[index_list(Token)]
pub struct TokenIndexes<'a> {
  pub identifier: UniqueIndex<'a, U8Key, Token>,
}

@CLAassistant
Copy link

CLAassistant commented Jun 14, 2022

CLA assistant check
All committers have signed the CLA.

@ueco-jb ueco-jb requested a review from maurolacy July 12, 2022 08:35
@maurolacy maurolacy force-pushed the feat/storage-macro branch from 8e1ce60 to 3f29e20 Compare July 17, 2022 08:40
Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

LTGM. Just some docs / comments style suggestions.

packages/storage-macro/Cargo.toml Outdated Show resolved Hide resolved
packages/storage-macro/NOTICE Outdated Show resolved Hide resolved
packages/storage-macro/README.md Outdated Show resolved Hide resolved
packages/storage-macro/README.md Outdated Show resolved Hide resolved
packages/storage-macro/README.md Outdated Show resolved Hide resolved
packages/storage-macro/tests/index_list.rs Outdated Show resolved Hide resolved
packages/storage-plus/Cargo.toml Show resolved Hide resolved
@maurolacy
Copy link
Contributor

Seems the code coverage tool is being confused by the macro. We need to solve that before merging.

Co-authored-by: Mauro Lacy <maurolacy@users.noreply.github.com>
@y-pakorn
Copy link
Contributor Author

Seems the code coverage tool is being confused by the macro. We need to solve that before merging.

Might we need an additional tarpaulin config flag to cover integration tests?

@maurolacy
Copy link
Contributor

Seems the code coverage tool is being confused by the macro. We need to solve that before merging.

Might we need an additional tarpaulin config flag to cover integration tests?

Not sure how to address this. Also, please add the new storage-macro package to the README.md, under Utilities.

@maurolacy
Copy link
Contributor

maurolacy commented Jul 17, 2022

Seems the code coverage tool is being confused by the macro. We need to solve that before merging.

Might we need an additional tarpaulin config flag to cover integration tests?

Not sure how to address this. Also, please add the new storage-macro package to the README.md, under Utilities.

This is just because this is a new package, that doesn't have previous runs.

Merging now. Adding to README is not needed, because this is a private package.

@maurolacy maurolacy merged commit 5988632 into CosmWasm:main Jul 17, 2022
@y-pakorn y-pakorn deleted the feat/storage-macro branch July 18, 2022 03:13
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.

Provide proc macro package for automatic IndexList<T> implementation on any index struct
3 participants