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

CodeInfo support #57

Merged
merged 33 commits into from
Sep 7, 2023
Merged

CodeInfo support #57

merged 33 commits into from
Sep 7, 2023

Conversation

DariuszDepta
Copy link
Member

@DariuszDepta DariuszDepta commented Sep 1, 2023

closes #49

This PR adds CodeInfo support as requested in issue #49.

@DariuszDepta DariuszDepta marked this pull request as draft September 1, 2023 16:10
@DariuszDepta DariuszDepta changed the title CodeInfo and instantiate_2 support CodeInfo and Instantiate2 support Sep 1, 2023
@DariuszDepta DariuszDepta changed the title CodeInfo and Instantiate2 support CodeInfo support Sep 4, 2023
@DariuszDepta DariuszDepta marked this pull request as ready for review September 4, 2023 09:41
Copy link
Contributor

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Functionality itself looks good to me, but let's try to keep this non-breaking. I'd suggest to keep the old signature for store_code, setting a default creator in there and adding a new function with the creator param added.
I'm fine with the cosmetic changes, but would be nice to have these as a separate PR in the future, as it makes reviewing the actual changes easier.

src/app.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Show resolved Hide resolved
Copy link
Contributor

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

Functionality is fine, I think; I am not sure about how to properly approach calculating checksum - I am aware it is what I suggested, but I know it is not perfect, and I don't have the perfect solution. More in the comment.

I have some more comments to address there.

What I don't really like are changes that are personal preferences in the external code. Example - changing submsg to sub_msg. It is a long-living code that is nothing wrong with; it is our personal preference, while submsg is far more common in the ecosystem. In general - changing names because you like some better is not a good way, as this way everyone would change half of the existing names in the project because he likes some better.

This does not apply to obvious typos or grammar mistakes in documentation - those things are okay to fix; I am thinking about changing the naming convention out of nowhere. If you think naming in the project is subject to improve, we can have a discussion about it, but arbitrarily changing naming, especially in the code not affected in other way is a terrible practice, and also - because it is noisy it is difficult to pick up by the reviewer if he would disagree.

src/test_helpers/contracts/echo.rs Outdated Show resolved Hide resolved
src/test_helpers/contracts/error.rs Outdated Show resolved Hide resolved
src/test_helpers/contracts/hackatom.rs Outdated Show resolved Hide resolved
src/app.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Show resolved Hide resolved
Copy link
Contributor

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

Overall, it is good, but I prefer something else to the test approach - just improving test coverage blindly to fix annoying tarpaulin is not a way to go. When I asked you "why coverage dropped," it didn't mean that "we cannot merge it because coverage dropped". It men's "which parts you add which is not covered?" If it is a Debug trait, I am fine. On the other hand - the target right now is ~75%, which means that for every new code you write, only 75% has to be covered (target coverage is what we already have), and you should be able to reach it without logging testing.

src/app.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
src/wasm.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

LGTM

@DariuszDepta DariuszDepta merged commit 06e6df1 into main Sep 7, 2023
2 checks passed
@DariuszDepta DariuszDepta deleted the code-data-instantiate-2 branch September 7, 2023 12:46
@DariuszDepta DariuszDepta self-assigned this Sep 14, 2023
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.

Include CodeData support
4 participants