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

Make sure SendParameters's mode value makes sense #180

Open
anton-trunov opened this issue Mar 20, 2024 · 2 comments
Open

Make sure SendParameters's mode value makes sense #180

anton-trunov opened this issue Mar 20, 2024 · 2 comments

Comments

@anton-trunov
Copy link
Member

For instance,

SendParameters{
    ...
    mode: SendRemainingValue + SendRemainingValue, 
    ...
}

should result in a compilation error.

  • flags in the mode field should be used at most one time;
  • the mode expression should only contain the + sign;
  • TODO: check if some combinations of flags are meaningless;
  • integer literals should not be used, only symbolic constants.

Ideally, arithmetics should be excluded here at all and the mode field should have its own unique type. But it looks like an idea for Tact 2.0, because we break backwards compatibility in this case.

@Gusarich
Copy link
Member

Actually it would make sense to move from + to | operation for applying flags because it literally sets specific bit to 1, and in that case applying the same flag multiple times won't change anything

@anton-trunov
Copy link
Member Author

This is indeed a nice suggestion for the current implementation!

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

No branches or pull requests

2 participants