This commit is contained in:
Justin Drake 2019-06-30 20:56:55 +01:00
parent e4a225ba68
commit f1931c030f
1 changed files with 1 additions and 4 deletions

View File

@ -1734,10 +1734,7 @@ def process_transfer(state: BeaconState, transfer: Transfer) -> None:
state.balances[transfer.sender] >= transfer.amount + transfer.fee + MAX_EFFECTIVE_BALANCE state.balances[transfer.sender] >= transfer.amount + transfer.fee + MAX_EFFECTIVE_BALANCE
) )
# Verify that the pubkey is valid # Verify that the pubkey is valid
assert ( assert state.validators[transfer.sender].withdrawal_credentials == BLS_WITHDRAWAL_PREFIX + hash(transfer.pubkey)[1:]
state.validators[transfer.sender].withdrawal_credentials ==
int_to_bytes(BLS_WITHDRAWAL_PREFIX, length=1) + hash(transfer.pubkey)[1:]
)
# Verify that the signature is valid # Verify that the signature is valid
assert bls_verify(transfer.pubkey, signing_root(transfer), transfer.signature, get_domain(state, DOMAIN_TRANSFER)) assert bls_verify(transfer.pubkey, signing_root(transfer), transfer.signature, get_domain(state, DOMAIN_TRANSFER))
# Process the transfer # Process the transfer