-
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
List addresses and wallets for shared wallet #2650
List addresses and wallets for shared wallet #2650
Conversation
d3ab23a
to
59d9cdf
Compare
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.
👍 modulo some changes regarding safety and wild runtime errors 😬
lib/core/src/Cardano/Wallet.hs
Outdated
let (ixM, _) = isShared addr s | ||
case dTM of | ||
Just dT -> | ||
pure $ Shared.liftDelegationAddress @n (fromJust ixM) dT fingerprint |
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.
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.
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.
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" |
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.
What about only defining the instance on AddressPool 'UtxoExternal SharedKey
then to force the caller to provide the right item?
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.
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 |
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.
TO_DO -> TODO (the TODO and FIXME tags are actually picked up by the CI!)
59d9cdf
to
55b2ccf
Compare
bors r+ |
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]>
Timed out. |
55b2ccf
to
07c5773
Compare
bors r+ |
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]>
Build failed (retrying...): |
Build succeeded: |
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
Issue Number
adp-686
Overview
normalizeSharedAddress
KnownAddresses
instance forSharedState
CompareDiscovery
instance forSharedState
AddressDiscovery.SharedState
toAddressDiscovery.Shared
Comments