Using the sha256 utils to generate a hash preimage for the htlc
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::bitcoin::{self, driver};
|
||||
use crate::utils;
|
||||
use bdk::wallet::AddressIndex::New;
|
||||
use bdk::SignOptions;
|
||||
|
||||
@@ -14,12 +15,13 @@ pub(crate) async fn run() -> anyhow::Result<()> {
|
||||
let mut commitment_builder = dave.wallet.build_tx();
|
||||
let amount = 500;
|
||||
let recipient = sammy.wallet.get_address(New)?.script_pubkey();
|
||||
let hash_preimage = utils::sha256("blah".to_string());
|
||||
|
||||
// Feed it 500 sats, a redeem identity, a hashlock, a refund timelock, and a refund identity
|
||||
//
|
||||
let htlc = bitcoin::htlc::Htlc::new(
|
||||
dave.external_public_key,
|
||||
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff".to_string(),
|
||||
hash_preimage,
|
||||
100,
|
||||
sammy.external_public_key,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user