Skip to content

fix(config): correct GetDefault return type#10687

Merged
LukaszRozmej merged 4 commits intoNethermindEth:masterfrom
aso20455:fix/config-getdefault-return-type
Mar 3, 2026
Merged

fix(config): correct GetDefault return type#10687
LukaszRozmej merged 4 commits intoNethermindEth:masterfrom
aso20455:fix/config-getdefault-return-type

Conversation

@aso20455
Copy link
Contributor

@aso20455 aso20455 commented Mar 2, 2026

GetDefault was returning a tuple (false, value) instead of just the value. This caused nested tuples when used in places like EnvConfigSource and ArgsConfigSource, where the result was already wrapped in (isSet, value).

@LukaszRozmej
Copy link
Member

please add some test

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes ConfigSourceHelper.GetDefault(Type) to return only the default value (as object) rather than a (false, value) tuple, preventing accidental nested tuples in config sources that already return (IsSet, Value).

Changes:

  • Update ConfigSourceHelper.GetDefault(Type) to return default(T) for value types and null for reference types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aso20455
Copy link
Contributor Author

aso20455 commented Mar 2, 2026

@LukaszRozmej fixed old test - it expected the buggy nested tuple

@LukaszRozmej LukaszRozmej requested a review from asdacap March 3, 2026 11:57
@LukaszRozmej LukaszRozmej merged commit 0a2eb89 into NethermindEth:master Mar 3, 2026
111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants