@@ -74,21 +74,22 @@ def _get_block_root(
74
74
Return the block root at a recent ``slot``.
75
75
"""
76
76
if state_slot > slot + latest_block_roots_length :
77
- raise ValueError (
78
- "state.slot (%s) should be less than or equal to "
79
- "(slot + latest_block_roots_length) (%s), "
80
- "where slot=%s, latest_block_roots_length=%s" %
81
- (
77
+ raise ValidationError (
78
+ "state.slot ({}) should be less than or equal to "
79
+ "(slot + latest_block_roots_length) ({}), "
80
+ "where slot={}, latest_block_roots_length={}" .format (
82
81
state_slot ,
83
82
slot + latest_block_roots_length ,
84
83
slot ,
85
84
latest_block_roots_length ,
86
85
)
87
86
)
88
87
if slot >= state_slot :
89
- raise ValueError (
90
- "slot (%s) should be less than state.slot (%s)" %
91
- (slot , state_slot )
88
+ raise ValidationError (
89
+ "slot ({}) should be less than state.slot ({})" .format (
90
+ slot ,
91
+ state_slot ,
92
+ )
92
93
)
93
94
return latest_block_roots [slot % latest_block_roots_length ]
94
95
@@ -121,16 +122,17 @@ def _get_shard_committees_at_slot(
121
122
earliest_slot_in_array = state_slot - (state_slot % epoch_length ) - epoch_length
122
123
123
124
if earliest_slot_in_array > slot :
124
- raise ValueError (
125
- "earliest_slot_in_array (%s) should be less than or equal to slot (%s)" %
126
- (earliest_slot_in_array , slot )
125
+ raise ValidationError (
126
+ "earliest_slot_in_array ({}) should be less than or equal to slot ({})" .format (
127
+ earliest_slot_in_array ,
128
+ slot ,
129
+ )
127
130
)
128
131
if slot >= earliest_slot_in_array + epoch_length * 2 :
129
- raise ValueError (
130
- "slot (%s) should be less than "
131
- "(earliest_slot_in_array + epoch_length * 2) (%s), "
132
- "where earliest_slot_in_array=%s, epoch_length=%s" %
133
- (
132
+ raise ValidationError (
133
+ "slot ({}) should be less than "
134
+ "(earliest_slot_in_array + epoch_length * 2) ({}), "
135
+ "where earliest_slot_in_array={}, epoch_length={}" .format (
134
136
slot ,
135
137
earliest_slot_in_array + epoch_length * 2 ,
136
138
earliest_slot_in_array ,
0 commit comments