Skip to content

Commit

Permalink
fix: build errors + warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Apr 12, 2023
1 parent 8852fda commit 938c6df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions components/chainhook-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::block::DigestingCommand;
use crate::config::generator::generate_config;
use crate::config::Config;
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate;
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate_via_http;
use crate::scan::stacks::scan_stacks_chain_with_predicate;
use crate::service::Service;

Expand Down Expand Up @@ -535,7 +535,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
}
};

scan_bitcoin_chain_with_predicate(predicate_spec, &config, &ctx).await?;
scan_bitcoin_chain_with_predicate_via_http(predicate_spec, &config, &ctx).await?;
}
ChainhookFullSpecification::Stacks(predicate) => {
scan_stacks_chain_with_predicate(predicate, &mut config, &ctx).await?;
Expand Down
4 changes: 2 additions & 2 deletions components/chainhook-cli/src/scan/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use chainhook_event_observer::chainhooks::bitcoin::{
BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
};
use chainhook_event_observer::chainhooks::types::{
BitcoinChainhookFullSpecification, BitcoinChainhookSpecification, BitcoinPredicateType,
BitcoinChainhookSpecification, BitcoinPredicateType,
Protocols,
};
use chainhook_event_observer::hord::db::{
Expand All @@ -27,7 +27,7 @@ use chainhook_event_observer::utils::{file_append, send_request, Context};
use chainhook_types::{BitcoinChainEvent, BitcoinChainUpdatedWithBlocksData};
use std::collections::{BTreeMap, HashMap};

pub async fn scan_bitcoin_chain_with_predicate(
pub async fn scan_bitcoin_chain_with_predicate_via_http(
predicate_spec: BitcoinChainhookSpecification,
config: &Config,
ctx: &Context,
Expand Down
28 changes: 12 additions & 16 deletions components/chainhook-cli/src/service/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
use crate::config::Config;
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate;
use chainhook_event_observer::bitcoincore_rpc::jsonrpc;
use chainhook_event_observer::chainhooks::bitcoin::{
handle_bitcoin_hook_action, BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
};
use crate::scan::bitcoin::scan_bitcoin_chain_with_predicate_via_http;


use chainhook_event_observer::chainhooks::types::{
BitcoinPredicateType, ChainhookConfig, ChainhookFullSpecification, OrdinalOperations, Protocols,
};
use chainhook_event_observer::hord::db::{
find_all_inscriptions, find_all_inscriptions_block_heights,
ChainhookConfig, ChainhookFullSpecification,
};
use chainhook_event_observer::indexer;


use chainhook_event_observer::observer::{start_event_observer, ApiKey, ObserverEvent};
use chainhook_event_observer::utils::{file_append, send_request, Context};
use chainhook_event_observer::utils::{Context};
use chainhook_event_observer::{
chainhooks::stacks::{
evaluate_stacks_predicate_on_transaction, handle_stacks_hook_action,
Expand All @@ -25,10 +21,10 @@ use chainhook_types::{
StacksTransactionData,
};
use redis::{Commands, Connection};
use reqwest::Client as HttpClient;
use std::collections::{BTreeMap, HashMap, HashSet};

use std::collections::{HashMap};
use std::sync::mpsc::channel;
use std::time::Duration;


pub const DEFAULT_INGESTION_PORT: u16 = 20455;
pub const DEFAULT_CONTROL_PORT: u16 = 20456;
Expand Down Expand Up @@ -317,7 +313,7 @@ impl Service {
info!(self.ctx.expect_logger(), "Stacks chainhook {} scan completed: action triggered by {} transactions", stacks_hook.uuid, total_hits);
}
ChainhookSpecification::Bitcoin(predicate_spec) => {
match scan_bitcoin_chain_with_predicate(
match scan_bitcoin_chain_with_predicate_via_http(
predicate_spec,
&self.config,
&self.ctx,
Expand All @@ -328,7 +324,7 @@ impl Service {
Err(e) => {
info!(
self.ctx.expect_logger(),
"Unable to evaluate predicate on the bitcoin chainstate: {e}",
"Unable to evaluate predicate on Bitcoin chainstate: {e}",
);
}
};
Expand Down

0 comments on commit 938c6df

Please sign in to comment.