Bitcoin functional errors tests: “Jsonrpcexceptte: the method was not found”
Bitcoin functional tests are necessary to guarantee the correctness of blockchain and wallet. However, sometimes these tests fail with a mysterious error message, “Jsonrpcexepte: The method is not found (-32601). In this article we will undergo three joint functional tests that have failed in the Test_runner.py
file and solutions were provided to solve the problem.
Test 1: Test_Coins
The Test_Coins' test checks that the coins are created correctly. It expects a specific method of calling blockchain with normal input parameters.
Decision
Make sure that the "creatcoin" method is implemented in the "blockchain.py" file and pass the necessary arguments (Name Coinname
, ‘Sum’, ‘Pubkey’) to the expected method of the method:
`Python
Blockchain.py
Defreatecoin (Coinname, Sum, Pubkey):
...
Check if this implementation meets test expectations.
Test 2: Test_Coinsgettranstion
Test_Coinsgettranstion 'checks that the coin transaction is obtained correctly. It expects a specific method of calling blockchain with normal input parameters.
Decision
Check if the "Gettranstion" method in the file "Blockchain.py" is the same with the expected signature of this function:
Python
Blockchain.py
Def Gettranstion (ID):
...
Check if this performance meets test expectations. If the solution does not solve the problem, make sure that the connection is correct and sends the necessary arguments.
Test 3: Test_bytes
The test_bytes test checks if bytes are correctly sent via JSON-RPC. It expects a specific method of calling blockchain with normal input parameters.
Decision
Check if the “Sendbytes” method in the “blockchain.py” file corresponds to the expected signature of the function:
`Python
Blockchain.py
Deftbytes (ID, data):
...
Make sure this performance meets test expectations. If the solution does not solve the problem, check that the connection is correct and sends the necessary arguments.
additional tips
- Make sure that all tests are performed before trying to eliminate the
Test_Runner.py
file error.
- Use a debuger or printed operators to check the variables and functional calls when performing the test.
- Consider adding more errors and introducing tests to help diagnose problems.
According to these steps, you must be able to identify and solve the problem, causing “jsonrpcexception: a method not found” in your functional bitcoin tests.
Leave a Reply