-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexceptions.py
20 lines (20 loc) · 1.94 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
NAME_NOT_UNIQUE = Exception("Name not unique")
NO_PASSWORD_GIVEN = Exception("No password is provided to encrypt the private key")
PARAMETERS_MISSING = lambda paramNumber: Exception(f"Expecting at least {paramNumber} parameters")
INVALID_PATH = lambda path: Exception(f"Path invalid '{path}'")
INVALID_PARAMETER = lambda possition: Exception(f"Invalid parameters at possition {possition}")
FAILED_TO_DECRYPT_KEY = Exception(f"Failed to decrypt the private key")
INVALID_INPUT = lambda param: Exception(f"Invalid paramater '{param}'")
NO_UTXOS = lambda address: Exception(f"No UTXOs found for the address {address}")
NOT_ENOUGH_FUNDS = lambda amount: Exception(f"Not enough funds. Total amount is {amount}")
ALREADY_SIGNED = lambda max: Exception(f"Transaction is already signed by {max} owners. Use --unsign_transaction to reset.")
NOT_ENOUGH_SIGNATURES = lambda given,required:Exception(f"The transaction contains only {given} out of {required} signatures required")
INVALID_ADDRESS = lambda address:Exception(f"Address '{address}' is invalid")
INVALID_TRANSACTION = Exception("The given transaction is invalid")
AMOUNT_NOT_FLOAT = Exception("One of the given amounts could not be casted to a float")
NO_CONNECTION = lambda network,rpcuser,rpcpassword,host:Exception(f"Can not connect to the network, you need to specify the network type, the rpc user, the rpc password and the host (current value : {network},{rpcuser},{rpcuser},{rpcpassword},{host})")
KEY_NAME_NOT_FOUND = lambda keyName:Exception(f"Key name '{keyName}' doesn't seem to be part of the multi signature address")
FAILED_TO_LOAD_JSON = Exception("Failed to load JSON file. Maybe the provided data are not in JSON format.")
INVALID_PUBLIC_KEY = lambda publicKey:Exception(f"Public key '{publicKey}' is invalid")
NOT_CORRECT_FILE = lambda property:Exception(f"The file is not correct. It doesn't contain the property '{property}'.")
NO_UTXO_AMOUNT_SEGWIT = Exception("Can not sign segwit UTXO without providing the amount")