-
Notifications
You must be signed in to change notification settings - Fork 276
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
[refactor]: Move TriggerSet
to data_model
#2229
[refactor]: Move TriggerSet
to data_model
#2229
Conversation
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2229 +/- ##
==============================================
- Coverage 76.46% 0 -76.47%
==============================================
Files 186 0 -186
Lines 26929 0 -26929
==============================================
- Hits 20592 0 -20592
+ Misses 6337 0 -6337 Continue to review full report at Codecov.
|
7722290
to
bcfa66c
Compare
wsv.modify_triggers(|triggers| { | ||
triggers.remove(&trigger)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think that removal is an idempotent instruction, but since we flag many other repetitions as errors, this is a welcome change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was a Repetition error before, but it was done in TriggerSet
. Now it is done here, because TriggerSet
should know nothing about instructions
|
||
triggers.mod_repeats(&id, |n| { | ||
n.checked_add(self.object).ok_or(MathError::Overflow) | ||
n.checked_add(self.object) | ||
.ok_or(trigger::set::RepeatsOverflowError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specific kind of error, should help readability.
bcfa66c
to
49382d7
Compare
49382d7
to
4257195
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
4257195
to
793b7d7
Compare
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Description of the Change
Initially it suppose to close #1889 but in the middle of work it was decided to wait until we get dynamic wasm linking. Dynamic linking is important, cause it will remove
no_std
limitations fromdata_model
andTriggerSet
is not compatible withno_std
.So this PR contains only
TriggerSet
moving todata_model
. It should be useful for the future.Issue
None
Benefits
TriggerSet
now is stored there it should beTriggerSet
make more sensePossible Drawbacks
None