From 3d0f74c8ce1469ad527c83cff564c6f76805a62c 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 b94d5fd44..b95a4f1eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ at anytime. * download blockchain headers from s3 before starting the wallet when the local height is more than `s3_headers_depth` (a config setting) blocks behind * track successful reflector uploads in sqlite to minimize how many streams are attempted by auto re-reflect * increase the default `auto_re_reflect_interval` to a day + * `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