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

List addresses and wallets for shared wallet #2650

Conversation

paweljakubas
Copy link
Contributor

@paweljakubas paweljakubas commented May 13, 2021

Issue Number

adp-686

Overview

  • Extension to WalletStyle and Discrimination in Api.Link
  • Adding listSharedWallets with integration tests
  • Resign from getSharedWallet in Api.Link in favour of getWallet
  • Resign from deleteSharedWallet in Api.Link in favour of deleteWallet
  • Resign from postSharedWallet in Api.Link in favour of postWallet
  • add normalizeSharedAddress
  • add KnownAddresses instance for SharedState
  • add CompareDiscovery instance for SharedState
  • add listAddresses to shared wallet
  • add integration testing for listSharedAddresses
  • change AddressDiscovery.SharedState to AddressDiscovery.Shared
  • enable UtxOInternal for ApiVerificationKeyShared

Comments

@paweljakubas paweljakubas added the ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG label May 13, 2021
@paweljakubas paweljakubas self-assigned this May 13, 2021
@paweljakubas paweljakubas force-pushed the paweljakubas/adp-686/list-addresses-and-wallets-for-shared-wallet branch 2 times, most recently from d3ab23a to 59d9cdf Compare May 17, 2021 14:30
@paweljakubas paweljakubas marked this pull request as ready for review May 17, 2021 14:31
@paweljakubas paweljakubas requested review from KtorZ and rvl May 17, 2021 14:31
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.

👍 modulo some changes regarding safety and wild runtime errors 😬

let (ixM, _) = isShared addr s
case dTM of
Just dT ->
pure $ Shared.liftDelegationAddress @n (fromJust ixM) dT fingerprint
Copy link
Member

Choose a reason for hiding this comment

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

fromJust 😬 ? Can we do something a bit better here? There's no guarantee from the type signature that the given address belongs to the wallet and that isShared would resolve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed, corrected

, Typeable n
) => CompareDiscovery (SharedState n k) where
compareDiscovery (SharedState _ state) a1 a2 = case state of
PendingFields _ -> error "comparing addresses in pending shared state does not make sense"
Copy link
Member

Choose a reason for hiding this comment

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

What about only defining the instance on AddressPool 'UtxoExternal SharedKey then to force the caller to provide the right item?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

experimented with it a little bit and IMHO it adds to code complexity in the end. But, I added integration test for listing addresses in pending state to show it is not crashing. it just returns [] which is reasonable in my opinion

) => KnownAddresses (SharedState n k) where
knownAddresses (SharedState _ s) = nonChangeAddresses
where
-- TO_DO - After enabling txs for shared wallets we will need to expand this
Copy link
Member

Choose a reason for hiding this comment

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

TO_DO -> TODO (the TODO and FIXME tags are actually picked up by the CI!)

@paweljakubas paweljakubas force-pushed the paweljakubas/adp-686/list-addresses-and-wallets-for-shared-wallet branch from 59d9cdf to 55b2ccf Compare May 18, 2021 11:58
@paweljakubas
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request May 18, 2021
2650: List addresses and wallets for shared wallet r=paweljakubas a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->

adp-686

# Overview

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

- [x] Extension to WalletStyle and Discrimination in Api.Link
- [x] Adding listSharedWallets with integration tests
- [x] Resign from getSharedWallet in Api.Link in favour of getWallet
- [x] Resign from deleteSharedWallet in Api.Link in favour of deleteWallet
- [x] Resign from postSharedWallet in Api.Link in favour of postWallet
- [x] add `normalizeSharedAddress`
- [x] add `KnownAddresses`  instance for `SharedState`
- [x] add `CompareDiscovery`  instance for `SharedState`
- [x] add listAddresses to shared wallet
- [x] add integration testing for listSharedAddresses
- [x] change `AddressDiscovery.SharedState` to `AddressDiscovery.Shared` 
- [x] enable UtxOInternal for ApiVerificationKeyShared


# Comments

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

<!--
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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


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

iohk-bors bot commented May 18, 2021

Timed out.

@paweljakubas paweljakubas force-pushed the paweljakubas/adp-686/list-addresses-and-wallets-for-shared-wallet branch from 55b2ccf to 07c5773 Compare May 18, 2021 18:54
@paweljakubas
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request May 18, 2021
2650: List addresses and wallets for shared wallet r=paweljakubas a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->

adp-686

# Overview

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

- [x] Extension to WalletStyle and Discrimination in Api.Link
- [x] Adding listSharedWallets with integration tests
- [x] Resign from getSharedWallet in Api.Link in favour of getWallet
- [x] Resign from deleteSharedWallet in Api.Link in favour of deleteWallet
- [x] Resign from postSharedWallet in Api.Link in favour of postWallet
- [x] add `normalizeSharedAddress`
- [x] add `KnownAddresses`  instance for `SharedState`
- [x] add `CompareDiscovery`  instance for `SharedState`
- [x] add listAddresses to shared wallet
- [x] add integration testing for listSharedAddresses
- [x] change `AddressDiscovery.SharedState` to `AddressDiscovery.Shared` 
- [x] enable UtxOInternal for ApiVerificationKeyShared


# Comments

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

<!--
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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


2656: E2e tests updates r=piotr-iohk a=piotr-iohk

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->


# Overview

- 3345a88
  add decimals to HappyCoin
  
- 6fb310b
  update migration tests
  
- 097173b
  update construct key tests

# Comments

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

<!--
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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 18, 2021

Build failed (retrying...):

@iohk-bors
Copy link
Contributor

iohk-bors bot commented May 18, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit 18dfd45 into master May 18, 2021
@iohk-bors iohk-bors bot deleted the paweljakubas/adp-686/list-addresses-and-wallets-for-shared-wallet branch May 18, 2021 23:48
WilliamKingNoel-Bot pushed a commit that referenced this pull request May 18, 2021
2650: List addresses and wallets for shared wallet r=paweljakubas a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->

adp-686

# Overview

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

- [x] Extension to WalletStyle and Discrimination in Api.Link
- [x] Adding listSharedWallets with integration tests
- [x] Resign from getSharedWallet in Api.Link in favour of getWallet
- [x] Resign from deleteSharedWallet in Api.Link in favour of deleteWallet
- [x] Resign from postSharedWallet in Api.Link in favour of postWallet
- [x] add `normalizeSharedAddress`
- [x] add `KnownAddresses`  instance for `SharedState`
- [x] add `CompareDiscovery`  instance for `SharedState`
- [x] add listAddresses to shared wallet
- [x] add integration testing for listSharedAddresses
- [x] change `AddressDiscovery.SharedState` to `AddressDiscovery.Shared`
- [x] enable UtxOInternal for ApiVerificationKeyShared

# Comments

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

<!--
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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->

Co-authored-by: Pawel Jakubas <[email protected]> 18dfd45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants