don't access Result.error when not error (#4376)

* don't access Result.error when not error

* correct `if` parity

* other error
This commit is contained in:
tersec 2022-11-30 12:08:48 +00:00 committed by GitHub
parent 4b9621cd77
commit d51d7de10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -755,10 +755,15 @@ proc proposeBlockMEV(
# the block failed to validate and integrate into the DAG, which for the
# purpose of this return value, is equivalent. It's used to drive Beacon
# REST API output.
let errMsg =
if unblindedBlockRef.isErr:
unblindedBlockRef.error
else:
"Unblinded block failed either to validate or integrate into validated store: " & unblindedBlockRef.get.error
warn "proposeBlockMEV: blinded block not successfully unblinded and proposed",
head = shortLog(head), slot, validator_index,
validator = shortLog(validator),
err = unblindedBlockRef.error, blindedBlck = shortLog(blindedBlock.get)
err = errMsg, blindedBlck = shortLog(blindedBlock.get)
Opt.some head
proc makeBlindedBeaconBlockForHeadAndSlot*(