Skip to main content

Module wallet_session

Module wallet_session 

Source
Expand description

forge script --session CLI wrapper support.

This module translates forge-specific --session-* flags into the outer cast wallet session --for invocation and keeps those wrapper details out of the main script execution flow.

Re-exportsยง

use crate::ScriptArgs; ๐Ÿ”’
use alloy_primitives::Address; ๐Ÿ”’
use clap::Args; ๐Ÿ”’
use eyre::Result; ๐Ÿ”’
use eyre::WrapErr; ๐Ÿ”’
use foundry_cli::opts::TEMPO_SESSION_ID_ENV; ๐Ÿ”’
use foundry_cli::utils::LoadConfig; ๐Ÿ”’
use foundry_config::Config; ๐Ÿ”’
use std::ffi::OsStr; ๐Ÿ”’
use std::ffi::OsString; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::process::Command; ๐Ÿ”’

Structsยง

ScriptWalletSessionArgs
Arguments that make forge script a thin wrapper around cast wallet session --for.
WalletSessionCommand ๐Ÿ”’

Constantsยง

SESSION_WRAPPER_ENV_REMOVE ๐Ÿ”’

Functionsยง

push_arg ๐Ÿ”’
push_opt_arg ๐Ÿ”’
push_repeated_args ๐Ÿ”’
quote_arg ๐Ÿ”’
Quotes one argv item for --for while preserving the exact value after shell-style splitting.
quote_command ๐Ÿ”’
Converts the reconstructed inner argv into the single command string accepted by cast wallet session --for.
sibling_binary ๐Ÿ”’
Resolves a sibling Foundry binary first, falling back to PATH for source-tree test binaries.
strip_wallet_session_args ๐Ÿ”’
Removes forge script --session wrapper flags from the command passed to --for.