fix function signature calls on deposit helpers

This commit is contained in:
Danny Ryan 2020-09-28 19:32:42 -06:00
parent 76d69263fc
commit 0e2e494d7e
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 29 additions and 14 deletions

View File

@ -80,12 +80,12 @@ def prepare_full_genesis_deposits(spec,
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(pubkey)[1:] withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(pubkey)[1:]
deposit, root, deposit_data_list = build_deposit( deposit, root, deposit_data_list = build_deposit(
spec, spec,
deposit_data_list, deposit_data_list=deposit_data_list,
pubkey, pubkey=pubkey,
privkey, privkey=privkey,
amount, amount=amount,
withdrawal_credentials, withdrawal_credentials=withdrawal_credentials,
signed, signed=signed,
) )
genesis_deposits.append(deposit) genesis_deposits.append(deposit)
@ -116,11 +116,11 @@ def prepare_random_genesis_deposits(spec,
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(random_byte)[1:] withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(random_byte)[1:]
deposit, root, deposit_data_list = build_deposit( deposit, root, deposit_data_list = build_deposit(
spec, spec,
deposit_data_list, deposit_data_list=deposit_data_list,
pubkey, pubkey=pubkey,
privkey, privkey=privkey,
amount, amount=amount,
withdrawal_credentials, withdrawal_credentials=withdrawal_credentials,
signed=True, signed=True,
) )
deposits.append(deposit) deposits.append(deposit)

View File

@ -6,7 +6,12 @@ from eth2spec.test.helpers.deposits import (
def create_valid_beacon_state(spec): def create_valid_beacon_state(spec):
deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT
deposits, _, _ = prepare_full_genesis_deposits(spec, deposit_count, spec.MAX_EFFECTIVE_BALANCE, signed=True) deposits, _, _ = prepare_full_genesis_deposits(
spec,
amount=spec.MAX_EFFECTIVE_BALANCE,
pubkey_max_range=deposit_count,
signed=True,
)
eth1_block_hash = b'\x12' * 32 eth1_block_hash = b'\x12' * 32
eth1_timestamp = spec.MIN_GENESIS_TIME eth1_timestamp = spec.MIN_GENESIS_TIME
@ -69,7 +74,12 @@ def test_is_valid_genesis_state_true_more_balance(spec):
@single_phase @single_phase
def test_is_valid_genesis_state_true_one_more_validator(spec): def test_is_valid_genesis_state_true_one_more_validator(spec):
deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT + 1 deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT + 1
deposits, _, _ = prepare_full_genesis_deposits(spec, deposit_count, spec.MAX_EFFECTIVE_BALANCE, signed=True) deposits, _, _ = prepare_full_genesis_deposits(
spec,
amount=spec.MAX_EFFECTIVE_BALANCE,
pubkey_max_range=deposit_count,
signed=True,
)
eth1_block_hash = b'\x12' * 32 eth1_block_hash = b'\x12' * 32
eth1_timestamp = spec.MIN_GENESIS_TIME eth1_timestamp = spec.MIN_GENESIS_TIME
@ -83,7 +93,12 @@ def test_is_valid_genesis_state_true_one_more_validator(spec):
@single_phase @single_phase
def test_is_valid_genesis_state_false_not_enough_validator(spec): def test_is_valid_genesis_state_false_not_enough_validator(spec):
deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT - 1 deposit_count = spec.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT - 1
deposits, _, _ = prepare_full_genesis_deposits(spec, deposit_count, spec.MAX_EFFECTIVE_BALANCE, signed=True) deposits, _, _ = prepare_full_genesis_deposits(
spec,
amount=spec.MAX_EFFECTIVE_BALANCE,
pubkey_max_range=deposit_count,
signed=True,
)
eth1_block_hash = b'\x12' * 32 eth1_block_hash = b'\x12' * 32
eth1_timestamp = spec.MIN_GENESIS_TIME eth1_timestamp = spec.MIN_GENESIS_TIME