reinscription = true;
if self.reinscribe {
continue;
} else {
return Err(anyhow!("sat at {} already inscribed", satpoint));
}
}
if inscribed_satpoint.outpoint == satpoint.outpoint {
return Err(anyhow!(
"utxo {} already inscribed with inscription {inscription_id} on sat {inscribed_satpoint}",
satpoint.outpoint,
));
}
}
if self.reinscribe && !reinscription {
return Err(anyhow!(
"reinscribe flag set but this would not be a reinscription"
));
}
let secp256k1 = Secp256k1::new();
let key_pair = UntweakedKeyPair::new(&secp256k1, &mut rand::thread_rng());
let (public_key, _parity) = XOnlyPublicKey::from_keypair(&key_pair);
let reveal_script = Inscription::append_batch_reveal_script(
&self.inscriptions,
ScriptBuf::builder()
.push_slice(public_key.serialize())
.push_opcode(opcodes::all::OP_CHECKSIG),
);
let taproot_spend_info = TaprootBuilder::new()