tact
tact copied to clipboard
Make sure SendParameters's mode value makes sense
For instance,
SendParameters{
...
mode: SendRemainingValue + SendRemainingValue,
...
}
should result in a compilation error.
- flags in the
modefield should be used at most one time; - the
modeexpression 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.
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
This is indeed a nice suggestion for the current implementation!