-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi: implement create_deposit_transaction
- Loading branch information
1 parent
a69646e
commit dc7fa85
Showing
9 changed files
with
294 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pub fn bdk_block_hash_to_bitcoin_block_hash(hash: bdk::bitcoin::BlockHash) -> bitcoin::BlockHash { | ||
use bdk::bitcoin::hashes::Hash as _; | ||
let bytes = hash.as_byte_array().to_vec(); | ||
|
||
use bitcoin::hashes::sha256d::Hash; | ||
use bitcoin::hashes::Hash as Hm; | ||
let hash: bitcoin::hashes::sha256d::Hash = Hash::from_slice(&bytes).unwrap(); | ||
|
||
bitcoin::BlockHash::from_raw_hash(hash) | ||
} | ||
|
||
pub fn bdk_txid_to_bitcoin_txid(hash: bdk::bitcoin::Txid) -> bitcoin::Txid { | ||
use bdk::bitcoin::hashes::Hash as _; | ||
let bytes = hash.as_byte_array().to_vec(); | ||
|
||
use bitcoin::hashes::sha256d::Hash; | ||
use bitcoin::hashes::Hash as _; | ||
let hash: bitcoin::hashes::sha256d::Hash = Hash::from_slice(&bytes).unwrap(); | ||
|
||
bitcoin::Txid::from_raw_hash(hash) | ||
} | ||
|
||
pub fn bitcoin_txid_to_bdk_txid(hash: bitcoin::Txid) -> bdk::bitcoin::Txid { | ||
use bitcoin::hashes::Hash as _; | ||
let bytes = hash.as_byte_array().to_vec(); | ||
|
||
use bdk::bitcoin::hashes::sha256d::Hash; | ||
use bdk::bitcoin::hashes::Hash as _; | ||
let hash: bdk::bitcoin::hashes::sha256d::Hash = Hash::from_slice(&bytes).unwrap(); | ||
|
||
bdk::bitcoin::Txid::from_raw_hash(hash) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.