-
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
Add sendAll for Byron endpoints #1664
Conversation
2ae5a58
to
3fbbf5c
Compare
ba3fabb
to
eeeabfc
Compare
eeeabfc
to
71433ba
Compare
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Transactions.hs
Outdated
Show resolved
Hide resolved
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.
Hi Pawel
This is looking good so far!
I've left a few comments already.
I do have one request: to write some property tests for the changeCoinSelectionForMigration
function.
Some properties to consider:
- Selection count should be preserved:
The number of created transactions should be the same as the number of selections. - Coin values should be preserved:
For each transaction t created from a selection s, the coin values within t should be identical to the change coin values within s. (The counts and values of coins should both be identical.) - Addresses should be recycled fairly:
For any given pair of addresses a1 and a2 in the given address list, if a1 is used n times, then a2 should be used either n or n − 1 times. (Assuming a1 and a2 appear in order.)
Let me know if I can provide any assistance with this! :)
bors try |
tryBuild succeeded |
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.
Looks good.
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.
Hi Pawel
Thanks for addressing the previous review feedback!
Your property tests for assignMigrationAddresses
look really nice. 👍
I have one suggestion:
- In the
prop_fairAddressesRecycled
property, it might be helpful to add a counterexample string, to help us debug if the test fails (since the expected result is just aBoolean
).
I also have one request:
-
Is it possible to adjust your changes to
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
so that they comply with the line length limit?I've added code suggestions in comments: applying these should fix these issues. 👍
Thanks!
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Wallets.hs
Outdated
Show resolved
Hide resolved
lib/core/test/unit/Cardano/Wallet/Primitive/CoinSelectionSpec.hs
Outdated
Show resolved
Hide resolved
lib/core/test/unit/Cardano/Wallet/Primitive/CoinSelectionSpec.hs
Outdated
Show resolved
Hide resolved
lib/core/test/unit/Cardano/Wallet/Primitive/CoinSelectionSpec.hs
Outdated
Show resolved
Hide resolved
9004230
to
cb4f1a7
Compare
1669: Prepare room for Shelley addresses r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #1672 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - f98b904 📍 **cleanup redundant constraints from the wallet engine** - 9524ccc 📍 **remove some hard-coded 'ShelleyKey' in favor of more flexible constraints** - c8bada8 📍 **rename AddressDerivation.Shelley & ShelleyKey to Jormungandr** Better reflect what this module really is and what it really targets. Makes room for the iminent shelley address support. - 5bd26c6 📍 **Regenerate nix** - 2c27166 📍 **add partial implementation for Shelley keys, for type-checking** - a767ac2 📍 **replace occurences of 'ShelleyKey' with 'JormungandrKey' in relevant integration tests** - 9d5c3fd 📍 **implement bits about fingerprints for ShelleyKey** # Comments <!-- Additional comments or screenshots to attach if any --> Based on #1664 <!-- 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 ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]> Co-authored-by: IOHK <[email protected]>
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.
Looks good to me!
cb4f1a7
to
337778a
Compare
bors r+ |
1664: Add sendAll for Byron endpoints r=paweljakubas a=paweljakubas # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #1658 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added refactored endpoints in ByronMigration family - [x] I have changed swagger - [x] I have changed impl of migrateWallet - [x] I have updated unit tests - [x] I have updated integration tests - [x] I have added properties for `assignMigrationAddresses` # Comments <!-- Additional comments or screenshots to attach if any --> How to run tests : ``` stack test cardano-wallet-jormungandr:jormungandr-integration --ta '-m "BYRON_MIGRATE_01 - migrate a big"' ``` <!-- 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 ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Pawel Jakubas <[email protected]>
Build failed |
add more add corresponding entry to swagger.yaml add migration cost to swagger and prepare for reuse of ApiByronWalletMigrationInfo - with name changed add corresponding byron wallets endpoints update swagger to new byron migrations deal with byron migration only
…instances correct swagger
337778a
to
767dc63
Compare
bors r+ |
Build succeeded |
Issue Number
#1658
Overview
assignMigrationAddresses
Comments
How to run tests :