-
Notifications
You must be signed in to change notification settings - Fork 217
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
Conversation
-- | ||
-- 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. |
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.
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 |
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.
why don't we also generate mnemonics
here?
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.
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 |
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 wonder what is distribution to pick two isOurs
wallets (hopefully precondition won't take too long - depending on the generator)
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.
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
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.
Ho damn :o ! The coverage is too tight maybe here ^^"
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.
lgtm
eb0601a
to
d736dd4
Compare
d736dd4
to
df4fb03
Compare
bors r+ |
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]>
Timed out (retrying...) |
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]>
Timed out |
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.
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 |
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.
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
Issue Number
#220
Overview
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.