Skip to content

Conversation

@franciszekjob
Copy link
Contributor

@franciszekjob franciszekjob commented Oct 24, 2025

Closes #3811

Introduced changes

  • Add basic validation for snfoundry.toml

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@franciszekjob franciszekjob changed the base branch from master to fix-native-meta-tx-v0-tests October 24, 2025 15:22
@franciszekjob franciszekjob marked this pull request as ready for review October 24, 2025 16:13
@franciszekjob franciszekjob requested a review from a team as a code owner October 24, 2025 16:13
@franciszekjob franciszekjob requested review from MKowalski8 and cptartur and removed request for a team October 24, 2025 16:13
Base automatically changed from fix-native-meta-tx-v0-tests to master October 24, 2025 16:34
@franciszekjob franciszekjob requested a review from ksew1 November 5, 2025 16:25
Comment on lines -53 to -55
core::load_config(
raw_config_json,
profile.map_or_else(|| Profile::Default, |p| Profile::Some(p.to_string())),
Copy link
Member

Choose a reason for hiding this comment

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

This code was specifically refactored so that load_config can actually be shared between this top level function and forge which uses it directly.

If we cannot share logic between cast and forge at all, let's get rid of core::load_config entirely and use the primitives from core directly in forge logic.

profile: Option<&str>,
) -> Result<T> {
let config_path = path
pub fn load_config<T>(path: Option<&Utf8PathBuf>, profile: Option<&str>) -> Result<T>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename this something it suggests more it's loading form snfoundry_toml?

use std::env;

fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> {
pub fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> {
pub(crate) fn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> {

If you need this in other modules pub is okay, but if it remains just for uses in this crate, let's not publish it.

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.

Error handling for snfoundry.toml parsing

3 participants