Bugs in wallet_bridge_api.
_I found bugs and other problems in wallet_bridge_api. _
Merge request with solves: !395 (merged)
1. I found a problem with run command wallet_bridge_api.find_proposals() with additional argument. Program raise exception and send difficult to understand error message for normal user.
Sent: b'{"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.find_proposals", "params": [[0, "additional_string_argument"]]}\r\n'.
Parse Error:Couldn't parse uint64_t
2. I found a problem with running wallet_bridge_api.list_proposal_votes with incorrect value of start. Running sort by id with a negative starting id did not make an error. This is the wrong reaction.
3. I found problems with calling wallet_bridge_api 'proposals' commands with the wrong data types in the arguments. I tested for bool, string, numeric types. The problem is there is no throw exception.
`([""], True, 29, 0, 0), # BUG1
`([""], 100, 29, True, 0), # BUG1
`([""], 100, 29, 0, True), # BUG1
list_proposal_votes: https://gitlab.syncad.com/hive/hive/-/blob/e20cd8a4967a09f41b61ebab79da07395fcc0d43/tests/functional/python_tests/wallet_bridge_api_tests/proposals_tests/test_list_proposal_votes.py#L141
`([""], True, 33, 0, 0), # BUG1
`([""], 100, 33, True, 0), # BUG1
`([""], 100, 33, 0, True), # BUG1
`True, # BUG1
4. I found a problem with running wallet_bridge_api.find_proposals with incorrect number of id
-negative id number cause empty response https://gitlab.syncad.com/hive/hive/-/blob/9e74b7c4ad8b1aea37cd7bea6076c12b1f2a6777/tests/functional/python_tests/wallet_bridge_api_tests/test_proposals.py#L205
-to big number of id (proposal with this id does not exist) cause receive all proposals in response https://gitlab.syncad.com/hive/hive/-/blob/9e74b7c4ad8b1aea37cd7bea6076c12b1f2a6777/tests/functional/python_tests/wallet_bridge_api_tests/test_proposals.py#L206
The desired action is to return Communication Error with correct message.
5. I found a problem with running wallet_bridge_api.list_proposal_votes with correct type of order: this is "by_proposal_voter". In this case, it is required that the value of the "start" parameter is of the "id" type. Throwing an empty string causes an error. I think this is a mistake because in other types of sorting, e.g. by dates, there is an empty string support added. I believe that running a null start should be consistent across all sort types.
I get parse error:
Parse Error:Couldn't parse uint64_t
There is a problem: https://gitlab.syncad.com/hive/hive/-/blob/92fd8200c7be2934357cee63448a7d38a96dafd0/tests/functional/python_tests/wallet_bridge_api_tests/test_proposals.py#L139
6. I found a problem with running wallet_bridge_api.list_proposals with incorrect values of sort order. This exception message is false.
Running command: node.api.wallet_bridge.list_proposals([""], 100, 32, order_direction['ascending'], status['all'])
Response: Parse Error:Couldn't parse uint64_t
The desired message is: Assert Exception:false: Unknown or unsupported sort order
7. I found problems with calling wallet_bridge_api.list_proposal_votes with the wrong data types in the start argument. I tested for bool, string, numeric types and for all of these types there was no exception throw.
START
(10, 100, 33, 0, 0), # BUG2
('invalid-argument', 100, 33, 0, 0), # BUG2
(True, 100, 33, 0, 0), # BUG2
8. I found problem with calling wallet_bridge_api.find_proposals with argument "['True']". I think this case shouldn't throw an exception.
Sent: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.find_proposals", "params": [["True"]]}'
Received: 'message': "Parse Error:Couldn't parse int64_t"
9. I found problem with calling some methods from wallet_bridge_api with additional argument. I think this cases shouldn't throw an exception.
1.find_rc_accounts: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.find_rc_accounts", "params": [[[""], "additional_string_argument"]]}
2.get_accounts: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_accounts", "params": [[["non-exist-acc"], "additional_string_argument"]]}
3.get_account: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_account", "params": [["get_account", "additional_string_argument"]]}
4.get_block: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_block", "params": [[0, "additional_string_argument"]]}
5.get_owner_history: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_owner_history", "params": [["non-exist-acc", "additional_string_argument"]]}
6.is_known_transaction: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.is_known_transaction", "params": [["0000000000000000000000000000000000000000", "additional_string_argument"]]}
7.get_reward_fund: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_reward_fund", "params": [["post", "additional_string_argument"]]}
8.broadcast_transaction: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.broadcast_transaction", "params": [[{"ref_block_num": 1, "ref_block_prefix": 3115438498, "expiration": "2022-04-08T08:58:30", "operations": [["account_create", {"fee": "0.000 TESTS", "creator": "initminer", "new_account_name": "alice", "owner": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST8Yw7JQimKLmgc1m3LTPiZVxkct1LxnGeXxeRpsevJ2dJrQGh1v", 1]]}, "active": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST86cZmypnuJY4TPcgg45LWopHuj69fGBnCNPYXuMXZgxQSLCz8j", 1]]}, "posting": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST6hpe7qwrkNgh3rEm1dJ2FgmNMbcZAARtKLiBfGgq7KwQvUwDDz", 1]]}, "memo_key": "TST4yPJjb6o6b5jU2eXkCFaDFz1WDk4noohACGTsF2rnhAqrbCy1s", "json_metadata": "{}"}]], "extensions": [], "signatures": ["201684bdd1517eedd931046cfa15d1f21d2518a2a7bf55d67aa2497d3d71b9adef737fab86b1523a4335b04c8e2365ac28ff4adfad4abfd63dff8a7eb1780005a2"], "transaction_id": "d950776209a8d8f6a85b250998a0c69da57cac07", "block_num": 0, "transaction_num": 0}, "additional_argument"]]}
9. find_recurent_transfers: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.find_recurrent_transfers", "params": [["alice", "additional_argument"]]}
10.get_collateralized_conversion_requests: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.find_recurrent_transfers", "params": [["alice", "additional_argument"]]}
11. get_conversion_requests: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_conversion_requests", "params": [["alice", "additional_argument"]]}
12. get_transaction: {"jsonrpc": "2.0", "id": 1, "method": "wallet_bridge_api.get_transaction", "params": [["50c9bfc46236eade6a55e3d5d35e0f7c1f6b6b6a", "additional_argument"]]}