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

API smart constructors #136

Merged
merged 6 commits into from
Apr 1, 2019
Merged

Conversation

jonathanknowles
Copy link
Member

Issue Number

Issue #96

Overview

This PR defines decoders (smart constructors) and encoders for the following types defined within Cardano.Wallet.Api.Types:

  • ApiT Address
  • ApiT (Passphrase "encryption")
  • ApiMnemonicT sizes purpose
  • ApiT WalletName

We export the decoders so that they may eventually be used by the CLI when constructing values with which to call the API.

We also modify the relevant FromJSON and ToJSON instances to reuse the extracted-out decoders and encoders.

Use this function to simplify the `FromJSON` instance for `ApiMnemonic`.
* Use these functions to simplify the `FromJSON` and `ToJSON` instances for
  `ApiT Address`.
* Export these functions, allowing them to be used elsewhere.
* Use these functions to simplify the `ApiT (Passphrase "encryption")`
  FromJSON and ToJSON instances.
* Export them from the module.
Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll fix the tests and get it merged.

@KtorZ KtorZ merged commit 5d42207 into master Apr 1, 2019
@KtorZ KtorZ deleted the jonathanknowles/api-smart-constructors branch April 1, 2019 09:56
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.

None yet

2 participants