-
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 property test for UTxOIndex.selectRandomWithPriority
.
#2667
Add property test for UTxOIndex.selectRandomWithPriority
.
#2667
Conversation
This test provides a basic sanity check to verify that priority order is respected when searching through a UTxO index with more than one filter.
29c6070
to
c33245a
Compare
853a030
to
fda37ca
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.
👌
-- | ||
prop_selectRandomWithPriority :: UTxOIndex -> Property | ||
prop_selectRandomWithPriority u = | ||
forAll (genAssetIdSmallRange) $ \a1 -> |
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.
Just wondering, are the two levels of forAll essential, or can one AssetId be a function parameter?
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, the first level could be replaced with a function parameter.
However, by using forAll
for both, it's easy to see (at a glance) that both asset ids come from the same generator.
bors r+ |
2665: Add basic latency benchmarks for migrations r=piotr-iohk a=piotr-iohk # Issue Number ADP-680 # Overview - 2c31861 Add basic latency benchmarks for migrations # Comments [Migration Plan](http://cardano-wallet-benchmarks.herokuapp.com/latency?latency_category=4&latency_benchmark=all&latency_measurement=postMigrationPlan) [Migration](http://cardano-wallet-benchmarks.herokuapp.com/latency?latency_category=4&latency_benchmark=all&latency_measurement=postMigration) 2667: Add property test for `UTxOIndex.selectRandomWithPriority`. r=jonathanknowles a=jonathanknowles # Issue Number ADP-890 # Overview This PR adds a property test for `UTxOIndex.selectRandomWithPriority`. The `selectRandomWithPriority` function is designed to: - select an entry at random from a UTxO index according to a specified list of filter conditions; - traverse the specified list of filter conditions in order of priority **_from left to right_**. The test added in this PR provides a basic sanity check to verify that priority order is respected. # Sample Output ```hs Cardano.Wallet.Primitive.Types.UTxOIndex Indexed UTxO set properties Index Selection prop_selectRandomWithPriority +++ OK, passed 1600 tests: 59.69% have match for neither asset 1 nor asset 2 17.12% have match for asset 1 but not for asset 2 16.31% have match for asset 2 but not for asset 1 6.88% have match for both asset 1 and asset 2 Finished in 1.0870 seconds 1 example, 0 failures ``` # QA Due Diligence I ran this test 500 times to increase confidence that it will not fail spuriously. No failures were encountered. Co-authored-by: Piotr Stachyra <[email protected]> Co-authored-by: Jonathan Knowles <[email protected]>
Build failed (retrying...): Timed out here: (https://hydra.iohk.io/build/6471029/nixlog/6/tail)
|
2663: Improve shared wallets 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-934 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Adding "incomplete" to status for pending shared wallets - [x] comprehensive validation of script templates when posting them - [x] integration testing of validation of script templates - [x] add GET /shared-wallets/wid/keys and whole infrastructure - [x] add GET /wallets/wid/keys - [x] unite ApiVerificationKeyShelley and ApiVerificationKeyShared and hence enable with/without hashing capability for shelley style - [x] better reuse of code in Api.Link - [x] test new endpoints # Comments Prerequisite : IntersectMBO/cardano-addresses#131 <!-- 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. --> 2667: Add property test for `UTxOIndex.selectRandomWithPriority`. r=jonathanknowles a=jonathanknowles # Issue Number ADP-890 # Overview This PR adds a property test for `UTxOIndex.selectRandomWithPriority`. The `selectRandomWithPriority` function is designed to: - select an entry at random from a UTxO index according to a specified list of filter conditions; - traverse the specified list of filter conditions in order of priority **_from left to right_**. The test added in this PR provides a basic sanity check to verify that priority order is respected. # Sample Output ```hs Cardano.Wallet.Primitive.Types.UTxOIndex Indexed UTxO set properties Index Selection prop_selectRandomWithPriority +++ OK, passed 1600 tests: 59.69% have match for neither asset 1 nor asset 2 17.12% have match for asset 1 but not for asset 2 16.31% have match for asset 2 but not for asset 1 6.88% have match for both asset 1 and asset 2 Finished in 1.0870 seconds 1 example, 0 failures ``` # QA Due Diligence I ran this test 500 times to increase confidence that it will not fail spuriously. No failures were encountered. Co-authored-by: Pawel Jakubas <[email protected]> Co-authored-by: IOHK <[email protected]> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: Jonathan Knowles <[email protected]>
Build failed (retrying...): Failures:
|
2667: Add property test for `UTxOIndex.selectRandomWithPriority`. r=jonathanknowles a=jonathanknowles # Issue Number ADP-890 # Overview This PR adds a property test for `UTxOIndex.selectRandomWithPriority`. The `selectRandomWithPriority` function is designed to: - select an entry at random from a UTxO index according to a specified list of filter conditions; - traverse the specified list of filter conditions in order of priority **_from left to right_**. The test added in this PR provides a basic sanity check to verify that priority order is respected. # Sample Output ```hs Cardano.Wallet.Primitive.Types.UTxOIndex Indexed UTxO set properties Index Selection prop_selectRandomWithPriority +++ OK, passed 1600 tests: 59.69% have match for neither asset 1 nor asset 2 17.12% have match for asset 1 but not for asset 2 16.31% have match for asset 2 but not for asset 1 6.88% have match for both asset 1 and asset 2 Finished in 1.0870 seconds 1 example, 0 failures ``` # QA Due Diligence I ran this test 500 times to increase confidence that it will not fail spuriously. No failures were encountered. Co-authored-by: Jonathan Knowles <[email protected]>
Build failed: Timed out here: (https://hydra.iohk.io/build/6480715/nixlog/1/tail)
|
bors r+ |
Build succeeded: |
Issue Number
ADP-890
Overview
This PR adds a property test for
UTxOIndex.selectRandomWithPriority
.The
selectRandomWithPriority
function is designed to:The test added in this PR provides a basic sanity check to verify that priority order is respected.
Sample Output
QA Due Diligence
I ran this test 500 times to increase confidence that it will not fail spuriously. No failures were encountered.