Skip to content

Commit

Permalink
fix: fixed compilation problems
Browse files Browse the repository at this point in the history
done fixes according to this pull to chainhook-sdk(hirosystems/chainhook#608)
  • Loading branch information
VanjaRo committed Nov 3, 2024
1 parent 179e68f commit 7c83d32
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 47 deletions.
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 7 additions & 11 deletions src/scan/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use crate::db::index::{index_block, roll_back_block};
use crate::{try_error, try_info};
use chainhook_sdk::chainhooks::bitcoin::{
evaluate_bitcoin_chainhooks_on_chain_event, handle_bitcoin_hook_action,
BitcoinChainhookOccurrence, BitcoinTriggerChainhook,
BitcoinChainhookSpecification, BitcoinPredicateType
BitcoinChainhookInstance, BitcoinChainhookOccurrence, BitcoinPredicateType,
BitcoinTriggerChainhook,
};
use chainhook_sdk::indexer::bitcoin::{
build_http_client, download_and_parse_block_with_retry, retrieve_block_hash_with_retry,
standardize_bitcoin_block,
};
use chainhook_sdk::observer::{gather_proofs, DataHandlerEvent, EventObserverConfig};
use chainhook_sdk::observer::{gather_proofs, EventObserverConfig};
use chainhook_sdk::types::{
BitcoinBlockData, BitcoinChainEvent, BitcoinChainUpdatedWithBlocksData,
};
Expand All @@ -33,7 +33,7 @@ pub async fn scan_blocks(
index_cache: &mut IndexCache,
ctx: &Context,
) -> Result<(), String> {
let predicate = BitcoinChainhookSpecification {
let predicate = BitcoinChainhookInstance {
uuid: format!("runehook-internal-trigger"),
owner_uuid: None,
name: format!("runehook-internal-trigger"),
Expand Down Expand Up @@ -65,7 +65,7 @@ pub async fn scan_blocks(
}

pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
predicate_spec: &BitcoinChainhookSpecification,
predicate_spec: &BitcoinChainhookInstance,
config: &Config,
event_observer_config_override: Option<&EventObserverConfig>,
pg_client: &mut Client,
Expand Down Expand Up @@ -171,7 +171,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(

async fn process_block_with_predicates(
block: BitcoinBlockData,
predicates: &Vec<&BitcoinChainhookSpecification>,
predicates: &Vec<&BitcoinChainhookInstance>,
event_observer_config: &EventObserverConfig,
ctx: &Context,
) -> Result<u32, String> {
Expand Down Expand Up @@ -211,11 +211,7 @@ async fn execute_predicates_action<'a>(
BitcoinChainhookOccurrence::File(path, bytes) => {
file_append(path, bytes, &ctx)?
}
BitcoinChainhookOccurrence::Data(payload) => {
if let Some(ref tx) = config.data_handler_tx {
let _ = tx.send(DataHandlerEvent::Process(payload));
}
}
BitcoinChainhookOccurrence::Data(_payload) => {}
};
}
}
Expand Down

0 comments on commit 7c83d32

Please sign in to comment.