-
Notifications
You must be signed in to change notification settings - Fork 83
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
Split IndyVdrLedger and IndySdkLedger #862
Conversation
Codecov Report
@@ Coverage Diff @@
## main #862 +/- ##
==========================================
- Coverage 48.88% 48.20% -0.69%
==========================================
Files 428 428
Lines 34134 34103 -31
Branches 7517 7502 -15
==========================================
- Hits 16687 16439 -248
- Misses 12294 12549 +255
+ Partials 5153 5115 -38
Flags with carried forward coverage won't be shown. Click here to find out more.
|
763ae60
to
2804b55
Compare
1a4e623
to
d51c5f8
Compare
@@ -6,22 +6,37 @@ use crate::{indy, PoolHandle, WalletHandle}; | |||
use super::base_ledger::{AnoncredsLedgerRead, AnoncredsLedgerWrite, IndyLedgerRead, IndyLedgerWrite}; | |||
|
|||
#[derive(Debug)] | |||
pub struct IndySdkLedger { | |||
pub struct IndySdkLedgerRead { | |||
indy_wallet_handle: WalletHandle, |
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.
perhaps can be removed now?
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.
Unfortunately get_ledger_txn
still needs WalletHandle
to sign the request if submitter_did
is passed in - but perhaps we can omit this argument and not sign the request as with the other getters. However, I don't think there is much worth in optimizing IndySdkLedger
as it is soon-to-be-deleted.
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.
Maybe not worth it doing it here, but how about taking a generic implementing BaseWallet
along with the submitter_did
? Something like Option(&str, &T)
where T: BaseWallet
. Shouldn't that remove the need to store the wallet handle while also making it easier to work with that scenario since the arguments are either provided together or not at all?
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 merely have an observation. Otherwise LGTM.
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
4bee597
to
497df30
Compare
Splits
IndyVdrLedger
->IndyVdrLedgerRead
&IndyVdrLedgerWrite
, andIndySdkLedger
->IndySdkLedgerRead
&IndySdkLedgerWrite
This allows each implementation to use only what it needs (e.g.
IndyVdrLedgerRead
variant doesn't needRequestSigner
,IndyVdrLedgerWrite
doesn't needResponseCacher
andResponseParser
). Moreover, since both are initialized separately, aIndyLedgerRead
implementation can be used to initialize aIndyLedgerWrite
implementation.