Skip to content

Fix/validate test network#36

Closed
panditdhamdhere wants to merge 2 commits intoBlockstreamResearch:masterfrom
panditdhamdhere:fix/validate-test-network-34
Closed

Fix/validate test network#36
panditdhamdhere wants to merge 2 commits intoBlockstreamResearch:masterfrom
panditdhamdhere:fix/validate-test-network-34

Conversation

@panditdhamdhere
Copy link
Copy Markdown

  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

Summary

This PR implements validation for test.esplora.network when loading TestConfig in smplx-test.

  • Replaces the existing TODO in crates/test/src/config.rs with fail-fast validation logic.
  • Accepts only Liquid, LiquidTestnet, or ElementsRegtest as valid values.
  • Returns a clear BadNetworkName(String) error (added in crates/test/src/error.rs) for invalid/misspelled values.
  • Includes changelog update in CHANGELOG.md under 0.0.2.

Test Plan

  • cargo test -p smplx-test
  • Verified edited files have no linter errors

Fail early when `test.esplora.network` is invalid so mistyped values are caught with a clear error instead of surfacing later in runtime setup.

Made-with: Cursor
Add a changelog entry for fail-fast validation of `test.esplora.network` values during test config loading.

Made-with: Cursor
@panditdhamdhere panditdhamdhere changed the title Fix/validate test network #34 Fix/validate test network Mar 24, 2026
@Arvolear
Copy link
Copy Markdown
Collaborator

Actually, I may have already done this and forgot to remove the "TODO". Please take a look at this:

https://github.com/BlockstreamResearch/smplx/blob/master/crates/cli/src/config/core.rs#L49

@Arvolear
Copy link
Copy Markdown
Collaborator

The reason the test config has a "from file" function is that we copy that test part from the "big" config into the tmp dir so that the test runner can find and read it.

The config itself doesn't change during the copy, so I assume doing this check once is sufficient.

@panditdhamdhere
Copy link
Copy Markdown
Author

alright! Should we close ?

@Arvolear
Copy link
Copy Markdown
Collaborator

Yep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants