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

fix(Clarity2):Factor out 'stx-transfer-memo' into a separate function #2732

Merged
merged 38 commits into from
Jul 13, 2021

Conversation

gregorycoppola
Copy link
Contributor

@gregorycoppola gregorycoppola commented Jun 22, 2021

Fixes #2615

Motivation

Currently, in the next branch, it is possible to supply a memo to stx-transfer?. However, it has been decided that it might be better to force the user to use a different function,stx-transfer-memo? if they are going to add a memo. The reason for this is to allow better type checking -- the user will either have to add a memo or not, depending on which version of the function they use, and they won't be able to forget to put a memo if they are using the "memo" version.

We also version-guard this function, so that one has to be using Stacks 2.1 in order to use it.

Testing

Tested using unit tests. The following tests have been modified:

M	src/vm/analysis/arithmetic_checker/tests.rs
M	src/vm/analysis/type_checker/tests/mod.rs
M	src/vm/tests/costs.rs
M	src/vm/tests/events.rs
M	src/vm/tests/simple_apply_eval.rs

@project-bot project-bot bot added this to Review in progress in Stacks Blockchain Board Jun 22, 2021
@gregorycoppola gregorycoppola marked this pull request as ready for review June 28, 2021 22:27
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM! Just commented about a small test addition.

Copy link
Contributor Author

@gregorycoppola gregorycoppola 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 review!

src/vm/analysis/type_checker/tests/mod.rs Show resolved Hide resolved
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

I didn't see any gating for stx-transfer-memo?. I think you'll want to add that in first before merging -- stx-transfer-memo? is not valid in Clarity 1.

Copy link
Contributor Author

@gregorycoppola gregorycoppola left a comment

Choose a reason for hiding this comment

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

@jcnelson thanks for the comments.

I rebased against 'next' so now this PR has version guarding.

Refactored tests in src/vm/analysis/arithmetic_checker/tests.rs test the version guarding.

src/vm/functions/assets.rs Show resolved Hide resolved
src/vm/costs/cost_functions.rs Outdated Show resolved Hide resolved
src/vm/analysis/arithmetic_checker/tests.rs Show resolved Hide resolved
src/vm/functions/mod.rs Show resolved Hide resolved
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM now. Thanks @gregorycoppola!

@jcnelson jcnelson self-requested a review July 8, 2021 23:24
Stacks Blockchain Board automation moved this from Review in progress to Reviewer approved Jul 8, 2021
@gregorycoppola
Copy link
Contributor Author

Thanks for the reviews everyone.

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

Successfully merging this pull request may close these issues.

Extension contract: stx-transfer-memo?
3 participants