-
Notifications
You must be signed in to change notification settings - Fork 81
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
Use enums instead of u32 to distinguish connection FSM states on Rust layer #294
Conversation
… layer Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
@@ -41,6 +41,13 @@ struct ConnectionInfo { | |||
their: Option<SideConnectionInfo>, | |||
} | |||
|
|||
#[derive(Debug, PartialEq)] | |||
pub enum ConnectionState { |
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'll be able to remove this enum once we split general Connection
into Inviter
and Invitee
VCX objects, analogically to issuer
and holder
I am sitting on fence whether it wouldn't be better just to return the existing structures (what this PR renamed to |
Codecov Report
@@ Coverage Diff @@
## master #294 +/- ##
==========================================
- Coverage 49.81% 45.64% -4.17%
==========================================
Files 153 152 -1
Lines 19430 18596 -834
Branches 6105 5798 -307
==========================================
- Hits 9679 8489 -1190
- Misses 4999 6036 +1037
+ Partials 4752 4071 -681
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@Patrik-Stas Awesome, I love this change. As for returning the full state structs instead of just enums, I dislike the idea. I think that the contract between |
@@ -0,0 +1,28 @@ | |||
use crate::aries::handlers::connection::connection::ConnectionState; |
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.
How about moving this code to src/api/mod.rs
, or moving some of the enum conversion stuff to this module, along with src/api/return_types_u32.rs
?
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.
happy to do that 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.
Well I played a bit and took this suggestion few more steps ahead - I turned it into separate PR https://github.com/hyperledger/aries-vcx/pull/295/files so the original purpose of this one does not get too polluted
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.
That's perfect, thank you
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Replaces
u32
representation of AriesFMS states by enums (which do not contain complete copy of state details). u32 representation of FSM state exists only so it could be used on C ABI layer and therefore it should also be expressed in that layer.Signed-off-by: Patrik Stas patrik.stas@absa.africa