refactoring static validation in pool_req_handler
@@ -33,14 +33,13 @@ class PoolRequestHandler(LedgerRequestHandler):
return
blskey = request.operation.get(DATA).get(BLS_KEY, None)
blskey_proof = request.operation.get(DATA).get(BLS_KEY_PROOF, None)
- if blskey is None:
- if blskey_proof is None:
+ if blskey is None and blskey_proof is None:
return
- else:
+ if blskey is None and blskey_proof is not None:
raise InvalidClientRequest(request.identifier, request.reqId,
"A Proof of possession is not "
"needed without BLS key")
- elif blskey_proof is None:
+ if blskey is not None and blskey_proof is None:
raise InvalidClientRequest(request.identifier, request.reqId,
"A Proof of possession must be "
"provided with BLS key")
