Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jul 21, 2023
1 parent 50de33e commit 5c3bcf4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/hord-cli/src/cli/mod.rs
Expand Up @@ -523,7 +523,7 @@ async fn handle_command(opts: Opts, ctx: &Context) -> Result<(), String> {
Command::Scan(ScanCommand::Inscription(cmd)) => {
let config: Config =
Config::default(cmd.regtest, cmd.testnet, cmd.mainnet, &cmd.config_path)?;

let _ = download_ordinals_dataset_if_required(&config, ctx).await;

let inscriptions_db_conn =
Expand Down
2 changes: 1 addition & 1 deletion components/hord-cli/src/db/mod.rs
Expand Up @@ -1727,7 +1727,7 @@ impl LazyBlock {
for input in tx.vin.iter() {
// txin - 8 first bytes
let txin = {
let txid = hex::decode(input.txid.unwrap().to_string()).unwrap();
let txid = hex::decode(input.txid.as_ref().unwrap().to_string()).unwrap();
[
txid[0], txid[1], txid[2], txid[3], txid[4], txid[5], txid[6], txid[7],
]
Expand Down
12 changes: 8 additions & 4 deletions components/hord-cli/src/hord/mod.rs
Expand Up @@ -3,7 +3,7 @@ pub mod ordinals;

use chainhook_sdk::bitcoincore_rpc::bitcoin::hashes::hex::FromHex;
use chainhook_sdk::bitcoincore_rpc::bitcoin::{Address, Network, Script};
use chainhook_sdk::bitcoincore_rpc_json::bitcoin::Witness;
use chainhook_sdk::bitcoincore_rpc_json::bitcoin::{Txid, Witness};
use chainhook_sdk::types::{
BitcoinBlockData, BitcoinNetwork, OrdinalInscriptionCurseType, OrdinalInscriptionRevealData,
OrdinalInscriptionTransferData, OrdinalOperation, TransactionIdentifier,
Expand Down Expand Up @@ -102,12 +102,16 @@ pub fn parse_ordinal_operations(
let mut operations = vec![];
for (input_index, input) in tx.vin.iter().enumerate() {
if let Some(ref witness_data) = input.txinwitness {
let witness = Witness::from_vec(witness_data.clone());
let witness_data_hex: Vec<Vec<u8>> = witness_data
.iter()
.map(|w| hex::decode(w).unwrap())
.collect();
let witness = Witness::from_vec(witness_data_hex.clone());
let mut inscription = match InscriptionParser::parse(&witness) {
Ok(inscription) => inscription,
Err(_e) => {
let mut cursed_inscription = None;
for bytes in witness_data.iter() {
for bytes in witness_data_hex.iter() {
let script = Script::from(bytes.to_vec());
let parser = InscriptionParser {
instructions: script.instructions().peekable(),
Expand All @@ -129,7 +133,7 @@ pub fn parse_ordinal_operations(
};

let inscription_id = InscriptionId {
txid: tx.txid.clone(),
txid: Txid::from_hex(&tx.txid).unwrap(),
index: input_index as u32,
};

Expand Down

0 comments on commit 5c3bcf4

Please sign in to comment.