-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet): add IndexedScript and SpkIterator types, and wallet::sp…
…ks_of_all_keychains()"
- Loading branch information
1 parent
7463fa7
commit a2fa233
Showing
6 changed files
with
204 additions
and
64 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
use bdk::bitcoin::blockdata::script::ScriptBuf as BdkScriptBuf; | ||
|
||
/// A Bitcoin script. | ||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub struct Script(pub(crate) BdkScriptBuf); | ||
|
||
impl Script { | ||
pub fn new(raw_output_script: Vec<u8>) -> Self { | ||
let script: BdkScriptBuf = BdkScriptBuf::from(raw_output_script); | ||
Script(script) | ||
} | ||
|
||
pub fn to_bytes(&self) -> Vec<u8> { | ||
self.0.to_bytes() | ||
} | ||
} | ||
|
||
impl From<BdkScriptBuf> for Script { | ||
fn from(script: BdkScriptBuf) -> Self { | ||
Script(script) | ||
} | ||
} |
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.