Skip to content
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

APIV2 refactoring #23

Merged
merged 19 commits into from
Mar 17, 2019
Merged

APIV2 refactoring #23

merged 19 commits into from
Mar 17, 2019

Conversation

yeastplume
Copy link
Member

Introducing the v2 api is demonstrating some places where the separation of concerns between crates could be much better, so taking the opportunity to do a refactoring. Will update this with a description of the new crate structure and the reasoning behind it before merging.

@yeastplume yeastplume changed the title [WIP] APIV2 refactoring APIV2 refactoring Mar 17, 2019
@yeastplume
Copy link
Member Author

Okay, so what's happened here is:

  • Split up the previous refwallet into 2 crates, currently called impls and controller. impls mostly contains concrete implementations of the traits found in libwallet. controller just contains logic to handle command line args and control the listener APIs. It was necessary to split these up to avoid circular dependencies in the api crate, which will need to use the types in impls to create self-testing rpc api doc tests.
  • Move the implementations of the owner and foreign APIs into libwallet. All the api layers do now is unlock/open the wallet before calling the implementations. This was needed to allow internal code to call api functions directly, again without creating circular dependencies.

@yeastplume yeastplume merged commit db01596 into mimblewimble:master Mar 17, 2019
@yeastplume yeastplume deleted the test_refactor branch May 20, 2019 08:22
garyyu added a commit to garyyu/grin-wallet that referenced this pull request Jun 25, 2019
… repair (mimblewimble#23)

* fix: 'delete_unconfirmed' only make sense at the last call of this batch repair

* optimization: add 'is_update_outputs' parameter for check_repair_batch API

* rustfmt
yyangli referenced this pull request in mwcproject/mwc-wallet May 13, 2020
* continue refactor

* rustfmt

* further refactoring

* impl crate compiling

* main crate compilation

* rustfmt

* test fix

* rustfmt

* test compilation

* rustfmt

* refwallet tests passing

* rustfmt

* all tests passing

* move http listener startup out of adapter

* rustfmt

* rename refwallet->controller

* rustfmt

* travis tests and api doctests

* rustfmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant