Skip to content

Add support for config file and refactor run config parsing#248

Open
BowTiedRadone wants to merge 8 commits intomasterfrom
feat/config-file
Open

Add support for config file and refactor run config parsing#248
BowTiedRadone wants to merge 8 commits intomasterfrom
feat/config-file

Conversation

@BowTiedRadone
Copy link
Copy Markdown
Contributor

This PR:

  • decouples run configuration parsing from main to keep the entry point clean
  • adds a --config flag for file-based configuration
  • adds support for pre-specifying custom accounts (allowing mainnet addresses to be used without providing their private keys by leveraging simnet remote data) using the config file

Fixes #183.

@BowTiedRadone BowTiedRadone requested a review from a team as a code owner April 14, 2026 15:14
Copy link
Copy Markdown
Collaborator

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Very nice refactoring 👍 A few comments below (and inline):


I think, a user typing:

rv ./project counter test --config=rv.config.json --seed=999

would have no indication that --seed=999 was discarded. Perhaps worth considering emitting a warning via the radio when both sources are present?


I also think that a typo like { "sedd": 42 } would be silently accepted as an empty config(?) If that's the case, consider warning on unrecognized keys.

Comment thread cli.ts Outdated
manifestDir,
sutContractName,
type: normalizedType as "test" | "invariant",
seed: options.seed ? parseInt(options.seed, 10) : undefined,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If a user passes --seed=abc, parseInt("abc", 10) produces NaN, which will silently propagate into fast-check as the seed. The config-file path validates this properly ("seed" must be an integer), so there's an asymmetry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread config.ts
}

// All addresses includes simnet addresses plus any new config addresses.
const allAddresses = [...merged.values()];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This now excluded faucet, right? If this is intentional, a comment would help(?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread app.ts Outdated

Learn more: https://stacks-network.github.io/rendezvous/
`;
const parseCliOrExit = (argv: string[], radio: EventEmitter) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The catch branch always calls process.exit(1) (which returns never). An explicit annotation would make the contract clearer for readers

Suggested change
const parseCliOrExit = (argv: string[], radio: EventEmitter) => {
const parseCliOrExit = (argv: string[], radio: EventEmitter): RunConfig | undefined => {

(Might have to be formatted to fit the 79-char width.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BowTiedRadone
Copy link
Copy Markdown
Contributor Author

@moodmosaic Thanks for the review. All should be addressed now

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.

Allow tests with specific wallet

2 participants