-
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
Typed interfaces/traits for BaseWallet #814
Comments
Unable to assign an assignee, but i believe @tech-bash is covering this ticket! |
Yes, I will try to cover it in the upcoming days. Thanks @gmulhearn |
I guess @Patrik-Stas can solve the assignee's issue! |
Hi @tech-bash, you are assigned. Apparently being member of organization is not requirement, but a person have to interact with the repo in certain way (star the repo / submit PR / etc.) @tech-bash before you dive in, please wait for this #815 (comment) to be clarified. |
Alright. |
@tech-bash this issue is not blocked by the other issue. For this issue you should go ahead with implementing your own types as structs where required (nothing has changed from the issue description above) |
OK |
@gmulhearn in example 1 that you gave I guess there is nothing new in the updated expression ;), also just to make sure if we would write |
Whoops. I have fixed the example 1, thanks for mentioning |
Alright, got you! |
Reopening, as #843 does not completely solve this issue. Still remaining is the typed struct for a |
Context
In
aries_vcx_core/src/wallet/base_wallet.rs
a traitBaseWallet
is defined. WhenBaseWallet
was originally defined, it kept the implementation 'simple' by taking and returning structures in the form of JSON Strings rather than typed ruststruct
s. Now thatBaseWallet
is well integrated, we should go back and properly add types to theBaseWallet
interface.Requirements
BaseWallet
should be replaced with rust structs.BaseWallet
(currently mostly justIndySdkWallet
) should be updated to use the new types and translate them appropriatelyBaseWallet
in the code base should be updated to use the new types rather than the JSON stringsExamples:
Example 1:
take this method;
tags_json
is an optional JSON string that represents aHashMap<String, String>
.so the method should be updated as:
Example 2
This method takes a JSON string via
options_json
and returns a JSON string that represents a "wallet record"they should both be replaced with struct types.
If we drill into the
libvdrtools
implementation ofget_record
(drilled into via the IndySdkWallet::get_wallet_record implementation), we get a clue for what these structures would look like:Tips
Since
IndySdkWallet
is the primary implementation ofBaseWallet
currently, it's easiest to drill into the libvdrtools implementations for information about what the underlying JSON type should be.The text was updated successfully, but these errors were encountered: