Update credential validation

This commit is contained in:
Hsiao-Wei Wang 2021-03-25 23:34:10 +08:00
parent d0898207c5
commit b152172fc4
No known key found for this signature in database
GPG Key ID: 1111A8A81778319E

View File

@ -60,10 +60,10 @@ def validate_deposit(deposit_data_dict: Dict[str, Any], credential: Credential)
# Verify withdrawal credential
if len(withdrawal_credentials) != 32:
return False
if withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX:
if withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX == credential.withdrawal_prefix:
if withdrawal_credentials[1:] != SHA256(credential.withdrawal_pk)[1:]:
return False
elif withdrawal_credentials[:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX:
elif withdrawal_credentials[:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX == credential.withdrawal_prefix:
if withdrawal_credentials[1:12] != b'\x00' * 11:
return False
if credential.eth1_withdrawal_address is None: