Skip to content

Commit 938c6df

Browse files
author
Ludo Galabru
committed
fix: build errors + warnings
1 parent 8852fda commit 938c6df

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

components/chainhook-cli/src/cli/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::block::DigestingCommand;
22
use crate::config::generator::generate_config;
33
use crate::config::Config;
4-
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate;
4+
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate_via_http;
55
use crate::scan::stacks::scan_stacks_chain_with_predicate;
66
use crate::service::Service;
77

@@ -535,7 +535,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
535535
}
536536
};
537537

538-
scan_bitcoin_chain_with_predicate(predicate_spec, &config, &ctx).await?;
538+
scan_bitcoin_chain_with_predicate_via_http(predicate_spec, &config, &ctx).await?;
539539
}
540540
ChainhookFullSpecification::Stacks(predicate) => {
541541
scan_stacks_chain_with_predicate(predicate, &mut config, &ctx).await?;

components/chainhook-cli/src/scan/bitcoin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use chainhook_event_observer::chainhooks::bitcoin::{
66
BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
77
};
88
use chainhook_event_observer::chainhooks::types::{
9-
BitcoinChainhookFullSpecification, BitcoinChainhookSpecification, BitcoinPredicateType,
9+
BitcoinChainhookSpecification, BitcoinPredicateType,
1010
Protocols,
1111
};
1212
use chainhook_event_observer::hord::db::{
@@ -27,7 +27,7 @@ use chainhook_event_observer::utils::{file_append, send_request, Context};
2727
use chainhook_types::{BitcoinChainEvent, BitcoinChainUpdatedWithBlocksData};
2828
use std::collections::{BTreeMap, HashMap};
2929

30-
pub async fn scan_bitcoin_chain_with_predicate(
30+
pub async fn scan_bitcoin_chain_with_predicate_via_http(
3131
predicate_spec: BitcoinChainhookSpecification,
3232
config: &Config,
3333
ctx: &Context,

components/chainhook-cli/src/service/mod.rs

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
use crate::config::Config;
2-
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate;
3-
use chainhook_event_observer::bitcoincore_rpc::jsonrpc;
4-
use chainhook_event_observer::chainhooks::bitcoin::{
5-
handle_bitcoin_hook_action, BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
6-
};
2+
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate_via_http;
3+
4+
75
use chainhook_event_observer::chainhooks::types::{
8-
BitcoinPredicateType, ChainhookConfig, ChainhookFullSpecification, OrdinalOperations, Protocols,
9-
};
10-
use chainhook_event_observer::hord::db::{
11-
find_all_inscriptions, find_all_inscriptions_block_heights,
6+
ChainhookConfig, ChainhookFullSpecification,
127
};
13-
use chainhook_event_observer::indexer;
8+
9+
1410
use chainhook_event_observer::observer::{start_event_observer, ApiKey, ObserverEvent};
15-
use chainhook_event_observer::utils::{file_append, send_request, Context};
11+
use chainhook_event_observer::utils::{Context};
1612
use chainhook_event_observer::{
1713
chainhooks::stacks::{
1814
evaluate_stacks_predicate_on_transaction, handle_stacks_hook_action,
@@ -25,10 +21,10 @@ use chainhook_types::{
2521
StacksTransactionData,
2622
};
2723
use redis::{Commands, Connection};
28-
use reqwest::Client as HttpClient;
29-
use std::collections::{BTreeMap, HashMap, HashSet};
24+
25+
use std::collections::{HashMap};
3026
use std::sync::mpsc::channel;
31-
use std::time::Duration;
27+
3228

3329
pub const DEFAULT_INGESTION_PORT: u16 = 20455;
3430
pub const DEFAULT_CONTROL_PORT: u16 = 20456;
@@ -317,7 +313,7 @@ impl Service {
317313
info!(self.ctx.expect_logger(), "Stacks chainhook {} scan completed: action triggered by {} transactions", stacks_hook.uuid, total_hits);
318314
}
319315
ChainhookSpecification::Bitcoin(predicate_spec) => {
320-
match scan_bitcoin_chain_with_predicate(
316+
match scan_bitcoin_chain_with_predicate_via_http(
321317
predicate_spec,
322318
&self.config,
323319
&self.ctx,
@@ -328,7 +324,7 @@ impl Service {
328324
Err(e) => {
329325
info!(
330326
self.ctx.expect_logger(),
331-
"Unable to evaluate predicate on the bitcoin chainstate: {e}",
327+
"Unable to evaluate predicate on Bitcoin chainstate: {e}",
332328
);
333329
}
334330
};

0 commit comments

Comments
 (0)