From d51d7de10b55a4653c4a1ddf6879aa96e8cbc86f Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 30 Nov 2022 12:08:48 +0000 Subject: [PATCH] don't access Result.error when not error (#4376) * don't access Result.error when not error * correct `if` parity * other error --- beacon_chain/validators/validator_duties.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/beacon_chain/validators/validator_duties.nim b/beacon_chain/validators/validator_duties.nim index 24bf734d6..c50e8d403 100644 --- a/beacon_chain/validators/validator_duties.nim +++ b/beacon_chain/validators/validator_duties.nim @@ -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*(