File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
tests/beacon/state_machines Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ def num_attestations(self) -> int:
117
117
@classmethod
118
118
def get_block_without_signature_root (
119
119
cls ,
120
- block : 'BaseBeaconBlock' ) -> 'BaseBeaconBlock' :
120
+ block : 'BaseBeaconBlock' ) -> Hash32 :
121
121
return cls (
122
122
slot = block .slot ,
123
123
parent_root = block .parent_root ,
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+ from eth_utils import (
4
+ ValidationError ,
5
+ )
6
+
1
7
from eth .beacon .state_machines .validation import (
2
8
validate_proposer_signature ,
3
9
)
@@ -39,3 +45,34 @@ def test_validate_proposer_signature(
39
45
beacon_chain_shard_number ,
40
46
epoch_length ,
41
47
)
48
+
49
+
50
+ def test_validate_proposer_bad_signature (
51
+ beacon_chain_shard_number ,
52
+ epoch_length ,
53
+ sample_beacon_block_params ,
54
+ sample_beacon_state_params ,
55
+ sample_shard_committee_params ):
56
+ block = BaseBeaconBlock (** sample_beacon_block_params )
57
+ state = BeaconState (** sample_beacon_state_params ).copy (
58
+ validator_registry = [
59
+ mock_validator_record (
60
+ pubkey = 123 ,
61
+ max_deposit = 0 ,
62
+ )
63
+ for _ in range (10 )
64
+ ],
65
+ shard_committees_at_slots = get_sample_shard_committees_at_slots (
66
+ num_slot = 128 ,
67
+ num_shard_committee_per_slot = 10 ,
68
+ sample_shard_committee_params = sample_shard_committee_params ,
69
+ ),
70
+ )
71
+
72
+ with pytest .raises (ValidationError ):
73
+ validate_proposer_signature (
74
+ state ,
75
+ block ,
76
+ beacon_chain_shard_number ,
77
+ epoch_length ,
78
+ )
You can’t perform that action at this time.
0 commit comments