-
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
refactor: move ledger to a separate crate #1172
Conversation
7a34c50
to
95a16e5
Compare
b7ec668
to
7ced0f0
Compare
Signed-off-by: Ondrej Prazak <ondrej.prazak@absa.africa>
7ced0f0
to
c1d0e23
Compare
@@ -0,0 +1,49 @@ | |||
use indy_vdr::{ |
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.
It seems that this is reason why indy_vdr
was introduced as dependency - but aries_vcx
shouldn't know anything about the underlying ledger implementation.
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.
Doesn't the mapping for VcxLedgerError
in the file below suffice?
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.
This file is the reason why indy_vdr
is now a dependency - it was moved from aries_vcx_core
. There used to be VdrError
-> AriesVcxCoreErrr
-> AriesVcxError
conversion path but because aries_vcx_core
is going away, we need to change to a direct VdrError
-> AriesVcxError
mapping. Alternatively, we could create an error variant in VcxLedgerError
for each VdrError
.
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.
The mapping from VcxLedgerError
currently does not suffice, because VcxLedgerError
does not create its own variant for each VdrError
but rather wrapps it
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.
Lets do the changes necessary to shield off vcx from indy-vdr
, be it creating/adjusting VcxLedgerError
. There's not much code relying on specific ledger error kinds (afaik the only place where we directly deal with them is when we are creating credential definition, and we have some specific behaviour based on whether the same cred-definition already exists/not exist on ledger.
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 merge after this is sorted
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[features] | ||
vdr_proxy_ledger = ["dep:indy-vdr-proxy-client"] |
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.
Not actionable in this PR:
It would be ideal if we use vdr_proxy_ledger
, we don't actually compile and bring in indy-vdr
itself (as it brings/requires all the zmq stuff with it).
I suppose the reason why this can't be done now (having 2 separate feature vdr_proxy_ledger
and vdr_zmq_ledger
) is because even when you use proxy implementations, I guess we are still relying on some types defined indy indy-vdr
(which carries the zmq stuff).
If you can confirm my suspition, there's potential refactoring task:
Refactor indy-vdr library such that it's broken down into
- types crates
- logic
So that we can use the types, given that's necessary regardless of what transport we use, but not necessary require zmq library installed on the system if the user only intends to use proxy
implementation.
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.
Left few comments, given these changes aries_vcx_core
could be instead renamed to aries_vcx_anoncreds
to keep consistent naming with these other extracted crates.
That will be my next step. |
Signed-off-by: Ondrej Prazak <ondrej.prazak@absa.africa>
* refactor: move ledger to a separate crate Signed-off-by: Ondrej Prazak <ondrej.prazak@absa.africa>
Extracts ledger from aries_vcx_core and moves it to a separate crate.