diff --git a/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py index 4a2c7d61d..940bc47fb 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py +++ b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_attester_slashing.py @@ -1,4 +1,4 @@ -import random +from random import Random from eth2spec.test.context import ( spec_state_test, expect_assertion_error, always_bls, with_all_phases, @@ -152,9 +152,10 @@ def test_success_misc_balances(spec, state): @single_phase def test_success_with_effective_balance_disparity(spec, state): # Jitter balances to be different from effective balances + rng = Random(12345) for i in range(len(state.balances)): pre = int(state.balances[i]) - state.balances[i] += random.randrange(max(pre - 5000, 0), pre + 5000) + state.balances[i] += rng.randrange(max(pre - 5000, 0), pre + 5000) attester_slashing = get_valid_attester_slashing(spec, state, signed_1=True, signed_2=True)