Commit 8601bf9
authored
Unit tests for models.rs and lib.rs; integration tests for clients (#65)
* docs(README): improve `Testing` section
* feat(models): derive `PartialEq` for some types in src/models.rs
`PartialEq` was derived for the following types:
- BlockTemplate
- Transaction
- SubaddressBalanceData
- BalanceData
- TransferPriority
- SubaddressData
- SubaddressIndex
- Payment
- AddressData
- IncomingTransfers
- GotAccount
- GetAccountsData
- GotTransfer
- SignedKeyImage
- KeyImageImportResponse
* feat(models): add GenerateBlocksResponseR struct
* feat(models): add GenerateBlocksResponse struct
* feat(models): add `From<GenerateBlocksResponseR>` for `GenerateBlocksResponse`
* fix(models): fix type of TransferData's `tx_key` field
* doc(models): add comment about possible optional field
Comment is about the possibility of GenerateFromKeysArgs's `password`
field being optional, even though Monero docs do not mention it.
* test(models): test conversion from GenerateBlocksResponseR to GenerateBlocksResponse
* docs(lib): fix small typos and improve wording a little
* fix(lib): fix parameter name passed to `get_balance` RPC call
* refactor(lib): remove unncessary full type path from `json_params` in `daemon_rpc_call` method
* feat(lib): add `all` parameter for `export_key_images` RPC call
* docs(lib): add comment about get_bulk_payments's parameter min_block_height possibly being optional
* feat(lib): `generate_blocks` method now returns `GenerateBlocksResponse`
* fix(lib): fix `submit_block` method and return type
* fix(lib): handle `on_get_block_hash` inconsistency on invalid height
* fix(lib): fix `get_payments` to make it return a vector of payments
* fix(lib): fix type of `check_tx_key` RPC call parameters and return type
* test(lib): add unit tests for RpcParams
* test(lib): add serialization test for TransferType
* test(lib): add serialization and deserialization test for TransferPriority
* test(rpc): remove old tests in tests/rpc.rs
* test(rpc): add helpers functions to test DaemonRpcClient
* test(rpc): add helpers functions to test RegtestDaemonJsonRpcClient
* test(rpc): add helpers functions to test WalletClient
* test(rpc): add `common::helpers` module
* test(rpc): add `basic_wallet` test
* test(rpc): add `empty_blockchain` test
* test(rpc): add `non_empty_blockchain` test
* test(rpc): add `basic_daemon_rpc` test
* test(rpc): add tests of interaction between all clients
* test(rpc): add `common::main_tests` module
* test(rpc): add `common` crate
* test(rpc): add code to run all tests in `common::main_tests`
* test(rpc): fix the tests
* test(rpc): bump to Monero v0.18.0.0
* docs(CHANGELOG): update CHANGELOG to reflect recent changes
* refactor(tests): remove `common` folder
* refactor(tests): allow a lint on `empty_blockchain`.rs and add explanation
* refactor(tests): remove `async` declaration from function that don't need it
* fix(lib): fix Rust 1.56.1 format error in on_get_block_hash
* docs(rpc): improve test documentation
* test(rpc): rename main_tests to clients_tests, and `fn test` to `fn run`
* refactor(tests/wallet): fix expected_ naming inconsistency
* refactor(rpc): make tests functions more explicit
* docs(rpc): fix typo in a comment on rpc.rs1 parent e9683fe commit 8601bf9
16 files changed
Lines changed: 3032 additions & 308 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
| |||
29 | 48 | | |
30 | 49 | | |
31 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
32 | 58 | | |
33 | 59 | | |
34 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
290 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
291 | 302 | | |
292 | 303 | | |
293 | 304 | | |
| |||
314 | 325 | | |
315 | 326 | | |
316 | 327 | | |
317 | | - | |
| 328 | + | |
318 | 329 | | |
319 | | - | |
| 330 | + | |
320 | 331 | | |
321 | 332 | | |
322 | 333 | | |
323 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
324 | 337 | | |
325 | 338 | | |
326 | 339 | | |
| |||
436 | 449 | | |
437 | 450 | | |
438 | 451 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 452 | + | |
445 | 453 | | |
446 | 454 | | |
447 | 455 | | |
| |||
454 | 462 | | |
455 | 463 | | |
456 | 464 | | |
457 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
458 | 469 | | |
459 | 470 | | |
460 | | - | |
| 471 | + | |
461 | 472 | | |
462 | 473 | | |
463 | 474 | | |
| |||
599 | 610 | | |
600 | 611 | | |
601 | 612 | | |
602 | | - | |
| 613 | + | |
603 | 614 | | |
604 | 615 | | |
605 | 616 | | |
| |||
709 | 720 | | |
710 | 721 | | |
711 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
712 | 729 | | |
713 | 730 | | |
714 | 731 | | |
715 | 732 | | |
716 | 733 | | |
717 | 734 | | |
718 | | - | |
| 735 | + | |
719 | 736 | | |
| 737 | + | |
720 | 738 | | |
721 | 739 | | |
722 | 740 | | |
| |||
726 | 744 | | |
727 | 745 | | |
728 | 746 | | |
| 747 | + | |
729 | 748 | | |
730 | 749 | | |
731 | 750 | | |
| |||
989 | 1008 | | |
990 | 1009 | | |
991 | 1010 | | |
992 | | - | |
| 1011 | + | |
993 | 1012 | | |
994 | 1013 | | |
995 | 1014 | | |
| |||
1025 | 1044 | | |
1026 | 1045 | | |
1027 | 1046 | | |
1028 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
1029 | 1051 | | |
1030 | 1052 | | |
1031 | 1053 | | |
| |||
1055 | 1077 | | |
1056 | 1078 | | |
1057 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
1058 | 1082 | | |
1059 | | - | |
| 1083 | + | |
1060 | 1084 | | |
1061 | 1085 | | |
1062 | 1086 | | |
| |||
1094 | 1118 | | |
1095 | 1119 | | |
1096 | 1120 | | |
1097 | | - | |
| 1121 | + | |
1098 | 1122 | | |
1099 | | - | |
| 1123 | + | |
1100 | 1124 | | |
1101 | 1125 | | |
1102 | | - | |
| 1126 | + | |
1103 | 1127 | | |
1104 | | - | |
| 1128 | + | |
| 1129 | + | |
1105 | 1130 | | |
1106 | 1131 | | |
1107 | 1132 | | |
| |||
1136 | 1161 | | |
1137 | 1162 | | |
1138 | 1163 | | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
0 commit comments