Improves the simulator and adds some tests

The simulator now return the proper error messages when incorrect data is pased on RPC calls. Functionality for forks is missing.
This commit is contained in:
Sergi Delgado Segura
2019-08-16 17:01:16 +01:00
parent 3ac2d446a3
commit 51bafa323a
3 changed files with 182 additions and 29 deletions

View File

@@ -1,3 +1,4 @@
import re
from pisa.utils.authproxy import JSONRPCException
from pisa.rpc_errors import RPC_INVALID_ADDRESS_OR_KEY
from http.client import HTTPException
@@ -55,3 +56,7 @@ def in_correct_network(bitcoin_cli, network):
return correct_network
def check_txid_format(txid):
# TODO: #12-check-txid-regexp
return isinstance(txid, str) and re.search(r'^[0-9A-Fa-f]{64}$', txid) is not None