From 156b1320707290b57182f246de6327c3ba27a004 Mon Sep 17 00:00:00 2001 From: Sergey Rozhnov Date: Thu, 17 May 2018 13:49:09 +0400 Subject: [PATCH] implemented additional test cases for claims sorting; updated changelog --- CHANGELOG.md | 1 + .../unit/daemon/claims_comparator_cases.json | 147 ++++++++++++++++++ 2 files changed, 148 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7acba6ca..539595609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ at anytime. * refactored dht iterativeFind * sort dht contacts returned by `findCloseNodes` in the routing table * disabled Cryptonator price feed + * `claim_list` and `claim_list_mine` in Daemon `return` sorted results ### Added * virtual kademlia network and mock udp transport for dht integration tests diff --git a/lbrynet/tests/unit/daemon/claims_comparator_cases.json b/lbrynet/tests/unit/daemon/claims_comparator_cases.json index dbcb732b7..11592fbf1 100644 --- a/lbrynet/tests/unit/daemon/claims_comparator_cases.json +++ b/lbrynet/tests/unit/daemon/claims_comparator_cases.json @@ -48,6 +48,153 @@ "txid": "fdsafa" } ] + }, + { + "description": "sort by height", + "results": [ + { + "height": 1, + "name": "res", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 3, + "name": "res", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 2, + "name": "res", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + } + ], + "expected": [ + { + "claim_id": "ccc", + "height": 1, + "name": "res", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "claim_id": "ccc", + "height": 2, + "name": "res", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "claim_id": "ccc", + "height": 3, + "name": "res", + "nout": 0, + "txid": "aecfaewcfa" + } + ] + }, + { + "description": "sort by name", + "results": [ + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res3", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res2", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + } + ], + "expected": [ + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res2", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res3", + "claim_id": "ccc", + "nout": 0, + "txid": "aecfaewcfa" + } + ] + }, + { + "description": "sort by outpoint", + "results": [ + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 2, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 1, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 3, + "txid": "aecfaewcfa" + } + ], + "expected": [ + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 1, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 2, + "txid": "aecfaewcfa" + }, + { + "height": 1, + "name": "res1", + "claim_id": "ccc", + "nout": 3, + "txid": "aecfaewcfa" + } + ] } ] } \ No newline at end of file