File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2194,18 +2194,20 @@ decl_module! {
2194
2194
size: ElectionSize ,
2195
2195
) -> DispatchResultWithPostInfo {
2196
2196
ensure_none( origin) ?;
2197
- Self :: check_and_replace_solution(
2197
+ let adjustments = Self :: check_and_replace_solution(
2198
2198
winners,
2199
2199
compact,
2200
2200
ElectionCompute :: Unsigned ,
2201
2201
score,
2202
2202
era,
2203
2203
size,
2204
- )
2205
- // TODO: instead of returning an error, panic. This makes the entire produced block
2206
- // invalid.
2207
- // This ensures that block authors will not ever try and submit a solution which is not
2208
- // an improvement, since they will lose their authoring points/rewards.
2204
+ ) . expect(
2205
+ "An unsigned solution can only be submitted by validators; A validator should \
2206
+ always produce correct solutions, else this block should not be imported, thus \
2207
+ effectively depriving the validators from their authoring reward. Hence, this panic
2208
+ is expected."
2209
+ ) ;
2210
+ Ok ( adjustments)
2209
2211
}
2210
2212
}
2211
2213
}
You can’t perform that action at this time.
0 commit comments