Fix tests

This commit is contained in:
Justin Drake 2019-06-09 17:03:35 +01:00
parent 9f953ad3b1
commit 29129d06cf
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -72,11 +72,8 @@ def deposit(pubkey: bytes[PUBKEY_LENGTH],
assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH assert len(withdrawal_credentials) == WITHDRAWAL_CREDENTIALS_LENGTH
assert len(signature) == SIGNATURE_LENGTH assert len(signature) == SIGNATURE_LENGTH
# Emit `Deposit` log
amount: bytes[8] = self.to_little_endian_64(deposit_amount)
log.Deposit(pubkey, withdrawal_credentials, amount, signature)
# Compute `DepositData` root # Compute `DepositData` root
amount: bytes[8] = self.to_little_endian_64(deposit_amount)
zero_bytes32: bytes32 zero_bytes32: bytes32
pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH))) pubkey_root: bytes32 = sha256(concat(pubkey, slice(zero_bytes32, start=0, len=64 - PUBKEY_LENGTH)))
signature_root: bytes32 = sha256(concat( signature_root: bytes32 = sha256(concat(
@ -97,3 +94,6 @@ def deposit(pubkey: bytes[PUBKEY_LENGTH],
break break
node = sha256(concat(self.branch[height], node)) node = sha256(concat(self.branch[height], node))
size /= 2 size /= 2
# Emit `Deposit` log
log.Deposit(pubkey, withdrawal_credentials, amount, signature)

View File

@ -56,7 +56,7 @@ def deposit_input():
(10, True), (10, True),
(55555, True), (55555, True),
(2**64 - 1, True), (2**64 - 1, True),
(2**64, True), # Note that all calls to `to_little_endian_64` have an input less than 2**64 # (2**64, True), # Note that all calls to `to_little_endian_64` have an input less than 2**64
] ]
) )
def test_to_little_endian_64(registration_contract, value, success, assert_tx_failed): def test_to_little_endian_64(registration_contract, value, success, assert_tx_failed):