Skip to content
Open
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
5 changes: 4 additions & 1 deletion solana/rust/switchboard-on-demand-client/src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct FetchSignaturesConsensusParams {
pub feed_configs: Vec<FeedConfig>, // Your existing FeedConfig struct
pub use_timestamp: Option<bool>,
pub num_signatures: Option<u32>,
pub debug: Option<bool>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -306,7 +307,9 @@ impl Gateway {
"{}/gateway/api/v1/fetch_signatures_consensus",
self.gateway_url
);
println!("Fetching signatures from: {}", url);
if params.debug.unwrap_or(false) {
println!("Fetching signatures from: {}", url);
}
// Build feed_requests array from feed_configs
let feed_requests: Vec<serde_json::Value> = params
.feed_configs
Expand Down
1 change: 1 addition & 0 deletions solana/rust/switchboard-on-demand-client/src/pull_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ impl PullFeed {
num_signatures: Some(num_signatures),
feed_configs,
use_timestamp: Some(false),
debug: params.debug,
})
.await
.context("PullFeed.fetchUpdateIx: fetch signatures consensus failure")?;
Expand Down
5 changes: 4 additions & 1 deletion solana/rust/switchboard-on-demand/src/client/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct FetchSignaturesConsensusParams {
pub feed_configs: Vec<FeedConfig>, // Your existing FeedConfig struct
pub use_timestamp: Option<bool>,
pub num_signatures: Option<u32>,
pub debug: Option<bool>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -306,7 +307,9 @@ impl Gateway {
"{}/gateway/api/v1/fetch_signatures_consensus",
self.gateway_url
);
println!("Fetching signatures from: {}", url);
if params.debug.unwrap_or(false) {
println!("Fetching signatures from: {}", url);
}
// Build feed_requests array from feed_configs
let feed_requests: Vec<serde_json::Value> = params
.feed_configs
Expand Down
1 change: 1 addition & 0 deletions solana/rust/switchboard-on-demand/src/client/pull_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ impl PullFeed {
num_signatures: Some(num_signatures),
feed_configs,
use_timestamp: Some(false),
debug: params.debug,
})
.await
.context("PullFeed.fetchUpdateIx: fetch signatures consensus failure")?;
Expand Down