From 4a74ef9cbaf917cb745342489b8ee4d1c3100e4c Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 28 Feb 2024 12:54:29 +0100 Subject: [PATCH] add `{.raises.}` annotations to `test_fixture_operations` (#5984) Some more progress in making exception flow explicit. --- tests/consensus_spec/altair/test_fixture_operations.nim | 1 + tests/consensus_spec/bellatrix/test_fixture_operations.nim | 3 ++- tests/consensus_spec/capella/test_fixture_operations.nim | 3 ++- tests/consensus_spec/deneb/test_fixture_operations.nim | 3 ++- tests/consensus_spec/phase0/test_fixture_operations.nim | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/consensus_spec/altair/test_fixture_operations.nim b/tests/consensus_spec/altair/test_fixture_operations.nim index 77ec09ebd..c1322d59d 100644 --- a/tests/consensus_spec/altair/test_fixture_operations.nim +++ b/tests/consensus_spec/altair/test_fixture_operations.nim @@ -5,6 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} {.used.} import diff --git a/tests/consensus_spec/bellatrix/test_fixture_operations.nim b/tests/consensus_spec/bellatrix/test_fixture_operations.nim index 6d09d2253..acaefb9c3 100644 --- a/tests/consensus_spec/bellatrix/test_fixture_operations.nim +++ b/tests/consensus_spec/bellatrix/test_fixture_operations.nim @@ -5,6 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} {.used.} import @@ -129,7 +130,7 @@ suite baseDescription & "Execution Payload " & preset(): proc makeApplyExecutionPayloadCb(path: string): auto = return proc( preState: var bellatrix.BeaconState, body: bellatrix.BeaconBlockBody): - Result[void, cstring] = + Result[void, cstring] {.raises: [IOError].} = let payloadValid = os_ops.readFile( OpExecutionPayloadDir/"pyspec_tests"/path/"execution.yaml" ).contains("execution_valid: true") diff --git a/tests/consensus_spec/capella/test_fixture_operations.nim b/tests/consensus_spec/capella/test_fixture_operations.nim index 2079e8a38..9428c4f05 100644 --- a/tests/consensus_spec/capella/test_fixture_operations.nim +++ b/tests/consensus_spec/capella/test_fixture_operations.nim @@ -5,6 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} {.used.} import @@ -146,7 +147,7 @@ suite baseDescription & "Execution Payload " & preset(): proc makeApplyExecutionPayloadCb(path: string): auto = return proc( preState: var capella.BeaconState, body: capella.BeaconBlockBody): - Result[void, cstring] = + Result[void, cstring] {.raises: [IOError].} = let payloadValid = os_ops.readFile( OpExecutionPayloadDir/"pyspec_tests"/path/"execution.yaml" ).contains("execution_valid: true") diff --git a/tests/consensus_spec/deneb/test_fixture_operations.nim b/tests/consensus_spec/deneb/test_fixture_operations.nim index 17071842f..3bcaa41c7 100644 --- a/tests/consensus_spec/deneb/test_fixture_operations.nim +++ b/tests/consensus_spec/deneb/test_fixture_operations.nim @@ -5,6 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} {.used.} import @@ -149,7 +150,7 @@ suite baseDescription & "Execution Payload " & preset(): proc makeApplyExecutionPayloadCb(path: string): auto = return proc( preState: var deneb.BeaconState, body: deneb.BeaconBlockBody): - Result[void, cstring] = + Result[void, cstring] {.raises: [IOError].} = let payloadValid = os_ops.readFile( OpExecutionPayloadDir/"pyspec_tests"/path/"execution.yaml" ).contains("execution_valid: true") diff --git a/tests/consensus_spec/phase0/test_fixture_operations.nim b/tests/consensus_spec/phase0/test_fixture_operations.nim index 60855e8ce..d6fe1dc38 100644 --- a/tests/consensus_spec/phase0/test_fixture_operations.nim +++ b/tests/consensus_spec/phase0/test_fixture_operations.nim @@ -5,6 +5,7 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} {.used.} import