Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/sdk/src/program/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct ProgramInfo {
/// measuring, and its `finalize*` methods after signing, or after measuring when that fails.
/// Measuring runs every program with its signature checks passing. Code that calls
/// `ProgramTrait::finalize` or `Signer::sign_tx` directly must call [`ProgramLogger::flush_logs`]
/// to see the output. `Signer::sign_witnesses` doesn't run any program.
/// to see the output, except in a regular `simplex` test, which flushes when its context drops.
pub struct ProgramLogger {
/// A mapping of program ids to program logs
pub logs: HashMap<usize, ProgramInfo>,
Expand Down
3 changes: 3 additions & 0 deletions crates/test/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use electrsd::bitcoind::bitcoincore_rpc::Auth;
use smplx_regtest::Regtest;
use smplx_regtest::client::RegtestClient;
use smplx_sdk::global::GlobalConfig;
use smplx_sdk::program::logger::ProgramLogger;
use smplx_sdk::provider::{
ElementsRpc, EsploraProvider, ProviderInfo, ProviderTrait, SimplexProvider, SimplicityNetwork,
};
Expand Down Expand Up @@ -296,6 +297,8 @@ impl<T: ContextMode> TestContext<T> {

impl Drop for RegularMode {
fn drop(&mut self) {
ProgramLogger::flush_logs();

if let Some(client) = &mut self._client {
let _ = client.kill();
}
Expand Down
Loading