-
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
[fix] #2017: Fix role unregistration #2313
[fix] #2017: Fix role unregistration #2313
Conversation
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2313 +/- ##
==============================================
- Coverage 65.50% 65.43% -0.07%
==============================================
Files 133 133
Lines 24697 24720 +23
==============================================
- Hits 16177 16176 -1
- Misses 8520 8544 +24
Continue to review full report at Codecov.
|
445c839
to
e691ef8
Compare
@@ -297,6 +297,7 @@ impl<W: WorldTrait> Execute<W> for UnregisterBox { | |||
Unregister::<Domain>::new(domain_id).execute(authority, wsv) | |||
} | |||
IdBox::PeerId(peer_id) => Unregister::<Peer>::new(peer_id).execute(authority, wsv), | |||
IdBox::RoleId(role_id) => Unregister::<Role>::new(role_id).execute(authority, wsv), |
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.
Bug with forgetting about adding new match arm when a new instruction was added appears too often.
@appetrosyan , @mversic , how do you think, can we add a test for it based on procedural macro for every Execute
trait implementation? It's all core
crate so macro expansion should work fine. At least should be only false-positive triggering, non false-negative
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.
we can make a totally safe implementation (no tests needed) with a (simple?) declarative macro. But in this case the implementations of Execute
for e.g. RegisterBox
and it's variants need to be grouped inside the macro. I can write an example if needed, but have a look at the ffi/src/lib.rs
for inspiration.
this is what I would prefer since these unboxing implementations are so similar that they cry out to be implemented in a macro. I would prefer declarative, but that is at discretion of the person implementing the macro
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
e691ef8
to
176d4ff
Compare
Signed-off-by: Shanin Roman shahin1000@yandex.ru
Description of the Change
Role
-related match arm inUnregisterBox
execution;Unregister<Role>::execute
by:Role
-related queries to client;Role
-related queries.Issue
Resolves #2017
Benefits
Possible Drawbacks
None.
Usage Examples or Tests
cargo test --package iroha_client --test mod -- integration::roles::unregistred_role_removed_from_account --exact --nocapture
cargo test --package iroha_client --test mod -- integration::queries::role