Skip to content

Commit 08c1029

Browse files
committed
fix(proposer_slashing): verify_signature as bool instead of ?bool
1 parent cd284e6 commit 08c1029

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/state_transition/block/process_proposer_slashing.zig

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ const getProposerSlashingSignatureSets = @import("../signature_sets/proposer_sla
77
const verifySignature = @import("../utils/signature_sets.zig").verifySingleSignatureSet;
88
const slashValidator = @import("./slash_validator.zig").slashValidator;
99

10-
pub fn processProposerSlashing(cached_state: *const CachedBeaconStateAllForks, proposer_slashing: *const ProposerSlashing, verify_signatures: ?bool) !void {
10+
pub fn processProposerSlashing(
11+
cached_state: *const CachedBeaconStateAllForks,
12+
proposer_slashing: *const ProposerSlashing,
13+
verify_signatures: bool,
14+
) !void {
1115
try assertValidProposerSlashing(cached_state, proposer_slashing, verify_signatures);
1216
const proposer_index = proposer_slashing.signed_header_1.message.proposer_index;
1317
try slashValidator(cached_state, proposer_index, null);
1418
}
1519

16-
pub fn assertValidProposerSlashing(cached_state: *const CachedBeaconStateAllForks, proposer_slashing: *const ProposerSlashing, verify_signature: ?bool) !void {
20+
pub fn assertValidProposerSlashing(
21+
cached_state: *const CachedBeaconStateAllForks,
22+
proposer_slashing: *const ProposerSlashing,
23+
verify_signature: bool,
24+
) !void {
1725
const state = cached_state.state;
1826
const epoch_cache = cached_state.getEpochCache();
1927
const header_1 = proposer_slashing.signed_header_1.message;
@@ -41,7 +49,7 @@ pub fn assertValidProposerSlashing(cached_state: *const CachedBeaconStateAllFork
4149
}
4250

4351
// verify signatures
44-
if (verify_signature orelse false) {
52+
if (verify_signature) {
4553
const signature_sets = try getProposerSlashingSignatureSets(cached_state, proposer_slashing);
4654
if (!try verifySignature(&signature_sets[0]) or !try verifySignature(&signature_sets[1])) {
4755
return error.InvalidProposerSlashingSignature;

0 commit comments

Comments
 (0)