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

Implement ability to list addresses in the wallet layer, API and CLI #274

Merged
merged 6 commits into from
May 17, 2019

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented May 16, 2019

Issue Number

#220

Overview

  • I have implemented the ability to list addresses in the wallet layer, API and CLI

Comments

This would make it easier for @piotr-iohk and us to write some integration tests for the transaction API. We could have derived addresses by hand, but this achieves to complete the high-priority endpoints of the API.

NOTE: It's a "partial" implementation which for now, ignores the filtering based on the address state (?state=used or ?state=unused). This can be implemented later.

⚠️ I recommend looking at the change commit by commit ;)

@KtorZ KtorZ requested a review from paweljakubas May 16, 2019 15:51
@KtorZ KtorZ self-assigned this May 16, 2019
--
-- NOTE: Change addresses aren't considered "known" until they've been used. The
-- rationale is that, we don't want users or consumers of the wallet to be using
-- change addresses primaturely.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/primaturely/prematurely

@@ -119,6 +119,14 @@ specWithCluster = do
err `shouldBe` "Ok.\n"
out `shouldNotContain` "CLI Wallet"
c `shouldBe` ExitSuccess

it "CLI - Can list addresses" $ \ctx -> do
walId <- createWallet ctx "CLI Wallet" mnemonics15
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we also generate mnemonics here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm. Good question. No particular reasons that I can think of.

:: (SeqState DummyTarget, ShowFmt Address, ShowFmt Address)
-> Property
prop_compareAntiSymmetric (s, ShowFmt a1, ShowFmt a2) =
fst (isOurs a1 s) && fst (isOurs a2 s) ==> cover 90 (a1 /= a2) "a1 /= a2" prop
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder what is distribution to pick two isOurs wallets (hopefully precondition won't take too long - depending on the generator)

Copy link
Contributor

Choose a reason for hiding this comment

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

      1) Cardano.Wallet.Primitive.AddressDiscovery.CompareDiscovery compareDiscovery is anti-symmetric
           *** Gave up! Passed only 199 tests; 232 discarded tests (98.5% a1 /= a2).

almost :P

Copy link
Member Author

Choose a reason for hiding this comment

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

Ho damn :o ! The coverage is too tight maybe here ^^"

Copy link
Contributor

@akegalj akegalj left a comment

Choose a reason for hiding this comment

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

lgtm

@KtorZ KtorZ force-pushed the KtorZ/220/list-addresses branch from eb0601a to d736dd4 Compare May 17, 2019 07:03
@KtorZ KtorZ force-pushed the KtorZ/220/list-addresses branch from d736dd4 to df4fb03 Compare May 17, 2019 07:46
@KtorZ
Copy link
Member Author

KtorZ commented May 17, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request May 17, 2019
274: Implement ability to list addresses in the wallet layer, API and CLI r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#220 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] I have implemented the ability to list addresses in the wallet layer, API and CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

This would make it easier for @piotr-iohk and us to write some integration tests for the transaction API. We could have derived addresses by hand, but this achieves to complete the high-priority endpoints of the API.

NOTE: It's a "partial" implementation which for now, ignores the filtering based on the address state (`?state=used` or `?state=unused`). This can be implemented later.

:warning: I recommend looking at the change commit by commit ;) 

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


275: Docs, polish and config param 16 r=KtorZ a=Anviking

# Issue Number

#218 


# Overview

- [x] Appropriated some doc comments from the [list of config params](https://github.com/input-output-hk/rust-cardano/blob/master/chain-impl-mockchain/doc/format.md)
- [x] Added missing `KesUpdateSpeed ` parameter
- [x] Added `ConsensusVersion` data-type
- [x] Some other super-minor polish


# Comments

<!-- Additional comments or screenshots to attach if any -->

⚠️  the base is temporarily not `master` ⚠️ 

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->

Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 17, 2019

Timed out (retrying...)

iohk-bors bot added a commit that referenced this pull request May 17, 2019
274: Implement ability to list addresses in the wallet layer, API and CLI r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#220 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] I have implemented the ability to list addresses in the wallet layer, API and CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

This would make it easier for @piotr-iohk and us to write some integration tests for the transaction API. We could have derived addresses by hand, but this achieves to complete the high-priority endpoints of the API.

NOTE: It's a "partial" implementation which for now, ignores the filtering based on the address state (`?state=used` or `?state=unused`). This can be implemented later.

:warning: I recommend looking at the change commit by commit ;) 

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 17, 2019

Timed out

Copy link
Contributor

@paweljakubas paweljakubas left a comment

Choose a reason for hiding this comment

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

LGTM!

-> Property
prop_compareKnownUnknown (s, ShowFmt known, ShowFmt addr) =
case (fst $ isOurs known s, fst $ isOurs addr s) of
(True, False) -> cover 10 True "known-unknown" $ prop LT
Copy link
Contributor

Choose a reason for hiding this comment

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

this one along with prop_compareAntiSymmetric will check known-unknow and unknow-know. know-know will be covered by the aforementioned property. The missing one is unknow-unknow although very obvious one

@KtorZ KtorZ merged commit db319f2 into master May 17, 2019
@iohk-bors iohk-bors bot deleted the KtorZ/220/list-addresses branch May 17, 2019 10:32
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.

3 participants