Skip to content

JMcK sample tests for review #4147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
35380dc
Adding 2 tests to existing repo:
jamesmckenna77 Feb 27, 2025
e1ca8f1
Adding 2 tests to existing repo:
jamesmckenna77 Feb 27, 2025
b84cfc8
This commit includes:
jamesmckenna77 Feb 28, 2025
bb26606
This commmit is just to remove the yield from the attestation.
jamesmckenna77 Feb 28, 2025
e209c35
For the most part, rename whisk to eip7441
jtraglia Feb 14, 2025
02af1b1
Rename test_whisk to test_eip7441
jtraglia Feb 14, 2025
a3ce0bc
Fix lint
jtraglia Feb 14, 2025
47b598a
Remove WHISK_ prefixes
jtraglia Feb 18, 2025
9d8c876
eip7732 adapt rpc methods
tbenr Feb 4, 2025
a6c70d9
move to separate method
tbenr Feb 5, 2025
eaf057f
fix toc
tbenr Feb 5, 2025
05f921c
feedback
tbenr Feb 12, 2025
5553849
as per feedback
tbenr Feb 18, 2025
d38be4a
Remove python version from circleci cache key (#4134)
jtraglia Feb 19, 2025
1781459
Add light client sync test for forced update before update timeout (#…
bshastry Feb 19, 2025
a6fcc3c
Move deprecated specs to new directory
jtraglia Feb 26, 2025
87ee8fe
Fix typos
jtraglia Feb 26, 2025
c468088
Fix broken link polynomial-commitments-sampling.md (#4140)
rebustron Feb 26, 2025
20f40b6
Adding 2 tests to existing repo:
jamesmckenna77 Feb 27, 2025
9bcae21
Adding 2 tests to existing repo:
jamesmckenna77 Feb 27, 2025
c9cca56
This commit includes:
jamesmckenna77 Feb 28, 2025
9225047
This commmit is just to remove the yield from the attestation.
jamesmckenna77 Feb 28, 2025
d95f784
Merge remote-tracking branch 'origin/jmck_dev' into jmck_dev
jamesmckenna77 Mar 1, 2025
34fe888
1. Moving test_validator_appears_only_once_in_attestation from capell…
jamesmckenna77 Mar 3, 2025
6c413dd
Linting update
jamesmckenna77 Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,36 @@ def test_compute_subscribed_subnets_random_2(spec):
def test_compute_subscribed_subnets_random_3(spec):
rng = random.Random(3333)
run_compute_subscribed_subnets_arguments(spec, rng)


@with_all_phases
@spec_state_test
def test_validator_appears_only_once_in_attestation(spec, state):
"""
A test to confirm that the validator_index of the validators in an attestation committee are unique and there
are no duplicate validators
"""
slot = state.slot
epoch = slot // spec.SLOTS_PER_EPOCH

# Get the number of committees assigned per slot in the current epoch
slot_committee_count = spec.get_committee_count_per_slot(state, epoch)

# Get the list of validators for each committee in the slot
validators = []
for committee in range(slot_committee_count):
validator_index = spec.get_committee_assignment(state, epoch, committee)

# There are tuples and individual validators in the list, so they need to be extracted
if isinstance(validator_index, tuple):
validators.extend(validator_index[0])
elif isinstance(validator_index, list):
validators.extend(validator_index)
else:
validators.append(validator_index)

# Check that the list of validators is not empty
assert len(validators) > 0

# Confirm that the same amount of unique validators appear in the list
assert len(validators) == len(set(validators))