-
Notifications
You must be signed in to change notification settings - Fork 719
test: load the frame transaction fixtures by mapping their fork name #12854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: eip8141-frame-txs-devnet7
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||||||||||||||||||||||||
| // SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited | ||||||||||||||||||||||||||||
| // SPDX-License-Identifier: LGPL-3.0-only | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| using System; | ||||||||||||||||||||||||||||
| using Nethermind.Core.Specs; | ||||||||||||||||||||||||||||
| using NUnit.Framework; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| namespace Nethermind.Specs.Test; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public class SpecNameParserTests | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| [Test] | ||||||||||||||||||||||||||||
| public void Parse_maps_Bogota_to_the_frame_transactions_fork() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| IReleaseSpec spec = SpecNameParser.Parse("Bogota"); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Assert.That(spec.IsEip8141Enabled, Is.True); | ||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Medium — this assertion doesn't pin the mapping the test name claims.
Assert identity instead;
Suggested change
(needs Low, same file, line 23: Low, structural: the recurring failure here isn't "Bogota specifically was missing", it's " |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| [Test] | ||||||||||||||||||||||||||||
| public void Parse_names_the_offending_fork_when_unmapped() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| NotSupportedException e = Assert.Throws<NotSupportedException>(() => SpecNameParser.Parse("NotAFork")); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Assert.That(e.Message, Does.Contain("NotAFork")); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -62,7 +62,8 @@ private static IReleaseSpec ParseUncached(string specName) | |||||
| "BPO4" => BPO4.Instance, | ||||||
| "BPO5" => BPO5.Instance, | ||||||
| "Amsterdam" => Amsterdam.Instance, | ||||||
| _ => throw new NotSupportedException() | ||||||
| "Bogota" => Bogota.Instance, | ||||||
| _ => throw new NotSupportedException($"Unknown fork name '{specName}'") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low — the message names the wrong string. The switch matches on
So it only misleads for the
Suggested change
|
||||||
| }; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low — the other half of the same masking problem is still there.
The narrowing is correct and is the right fix — but
catch (Exception)still discards the standard-shape exception entirely. When a fixture is neither shape (malformed JSON, a genuinely new field, a type change on the standard side), the only error that reachesFileTestsSource'sFailed to load: {e}is the trimmed-shape error, which is exactly the "reported as an unrelated error against the trimmed shape" confusion this PR set out to remove. It just moved from conversion errors to deserialization errors.Chaining the original preserves both:
Also relevant:
robustness.md— "Never swallow exceptions … at minimum log the exception."catch (Exception)here doesn't even bind the exception. Pre-existing, but these are the lines the diff touches.Two secondary notes on the same hunk:
<remarks>, not a leading in-line comment. As written it also sits above thestringoverload only, while describing both.<remarks>Scoped to deserialization so that conversion errors — e.g. an unmapped fork name — are reported as themselves rather than as a shape mismatch against the trimmed type.</remarks>survives better on the base branch.Fix this →