From b152172fc47e64fcf1164111513be7fb394858d9 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 25 Mar 2021 23:34:10 +0800 Subject: [PATCH] Update credential validation --- eth2deposit/utils/validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth2deposit/utils/validation.py b/eth2deposit/utils/validation.py index 5d1416e..23a513d 100644 --- a/eth2deposit/utils/validation.py +++ b/eth2deposit/utils/validation.py @@ -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: