comment out transfer test from sanity tests
This commit is contained in:
parent
98a798bd54
commit
ef1ef753a3
|
@ -303,38 +303,38 @@ def test_voluntary_exit(spec, state):
|
||||||
assert state.validator_registry[validator_index].exit_epoch < spec.FAR_FUTURE_EPOCH
|
assert state.validator_registry[validator_index].exit_epoch < spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
|
|
||||||
@with_all_phases
|
# @with_all_phases
|
||||||
@spec_state_test
|
# @spec_state_test
|
||||||
def test_transfer(spec, state):
|
# def test_transfer(spec, state):
|
||||||
# overwrite default 0 to test
|
# overwrite default 0 to test
|
||||||
spec.MAX_TRANSFERS = 1
|
# spec.MAX_TRANSFERS = 1
|
||||||
|
|
||||||
sender_index = spec.get_active_validator_indices(state, spec.get_current_epoch(state))[-1]
|
# sender_index = spec.get_active_validator_indices(state, spec.get_current_epoch(state))[-1]
|
||||||
amount = get_balance(state, sender_index)
|
# amount = get_balance(state, sender_index)
|
||||||
|
|
||||||
transfer = get_valid_transfer(spec, state, state.slot + 1, sender_index, amount, signed=True)
|
# transfer = get_valid_transfer(spec, state, state.slot + 1, sender_index, amount, signed=True)
|
||||||
recipient_index = transfer.recipient
|
# recipient_index = transfer.recipient
|
||||||
pre_transfer_recipient_balance = get_balance(state, recipient_index)
|
# pre_transfer_recipient_balance = get_balance(state, recipient_index)
|
||||||
|
|
||||||
# un-activate so validator can transfer
|
# un-activate so validator can transfer
|
||||||
state.validator_registry[sender_index].activation_eligibility_epoch = spec.FAR_FUTURE_EPOCH
|
# state.validator_registry[sender_index].activation_eligibility_epoch = spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
# yield 'pre', state
|
||||||
|
|
||||||
# Add to state via block transition
|
# Add to state via block transition
|
||||||
block = build_empty_block_for_next_slot(spec, state)
|
# block = build_empty_block_for_next_slot(spec, state)
|
||||||
block.body.transfers.append(transfer)
|
# block.body.transfers.append(transfer)
|
||||||
sign_block(spec, state, block)
|
# sign_block(spec, state, block)
|
||||||
|
|
||||||
yield 'blocks', [block], List[spec.BeaconBlock]
|
# yield 'blocks', [block], List[spec.BeaconBlock]
|
||||||
|
|
||||||
spec.state_transition(state, block)
|
# spec.state_transition(state, block)
|
||||||
yield 'post', state
|
# yield 'post', state
|
||||||
|
|
||||||
sender_balance = get_balance(state, sender_index)
|
# sender_balance = get_balance(state, sender_index)
|
||||||
recipient_balance = get_balance(state, recipient_index)
|
# recipient_balance = get_balance(state, recipient_index)
|
||||||
assert sender_balance == 0
|
# assert sender_balance == 0
|
||||||
assert recipient_balance == pre_transfer_recipient_balance + amount
|
# assert recipient_balance == pre_transfer_recipient_balance + amount
|
||||||
|
|
||||||
|
|
||||||
@with_all_phases
|
@with_all_phases
|
||||||
|
|
Loading…
Reference in New Issue