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

feat: remove asset from create note #686

Merged
merged 4 commits into from
May 13, 2024

Conversation

Dominik1999
Copy link
Collaborator

Closes #596

Supersedes #614

I remove ASSET from the create_note procedure and the subsequent procedures. I also needed to adjust the event handler.

@Dominik1999 Dominik1999 changed the base branch from main to next May 10, 2024 19:16
@Dominik1999 Dominik1999 force-pushed the dominik_remove_ASSET_from_create_note branch from df2e7de to 710ccaf Compare May 10, 2024 19:19
@Dominik1999 Dominik1999 changed the title Dominik remove asset from create note feat: remove asset from create note May 10, 2024
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left some comments inline.

Probably the thing that took me the most time to review is handling of padding (and I'm not 100% sure I thought it through completely). For the next release, one of the first things we do should definitely be #685.

CHANGELOG.md Outdated
@@ -2,6 +2,7 @@

## 0.3.0 (TBD)

* [BREAKING] Removed assets from `create_note` procedure and added new procedure `add_asset_to_note` (#686, #674).
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit: could we move this to the end of the list (I try to keep this list in ascending order).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Jup,

I think the AccountStorageMap is missing in the list. Should I add it in this PR or should I open a new one only for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add it in this PR.

Comment on lines +72 to +73
# prepare the stack for return - stack has 5 elements too many
movupw.3 dropw swap drop
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to do this now while previously we didn't have to?

Separately, I wonder if a better approach here would be to call sys::truncate_stack. It would be a bit more expensive - but also generic in a way we won't need to worry about how many elements on the staack are extra. This could be done as a part of #685.

@Dominik1999 Dominik1999 requested a review from bobbinth May 12, 2024 04:48
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a few small comments inline. Once these are addressed, we can merge.

@bobbinth
Copy link
Contributor

One other thing I think we should do is add a comment here to say that if there are no assets, [ZERO; 4] is returned as the asset hash.

@Dominik1999 Dominik1999 force-pushed the dominik_remove_ASSET_from_create_note branch from 06c72a3 to 82064b1 Compare May 13, 2024 04:07
@Dominik1999 Dominik1999 merged commit fbdb548 into next May 13, 2024
9 checks passed
@Dominik1999 Dominik1999 deleted the dominik_remove_ASSET_from_create_note branch May 13, 2024 10:29
bobbinth pushed a commit that referenced this pull request May 13, 2024
* feat: creating notes without assets

* after review

* pacifying linter

* after review
bobbinth pushed a commit that referenced this pull request May 14, 2024
* feat: creating notes without assets

* after review

* pacifying linter

* after review
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.

Create notes without assets
2 participants