Skip to content

Commit 4fee5bf

Browse files
authored
Merge pull request #224 from pandoracore/feat/ctx-hash
Hash derive for miniscript context types
2 parents ebed2f9 + 902c180 commit 4fee5bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/miniscript/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub trait ScriptContext:
247247
/// To be used as P2SH scripts
248248
/// For creation of Bare scriptpubkeys, construct the Miniscript
249249
/// under `Bare` ScriptContext
250-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
250+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
251251
pub enum Legacy {}
252252

253253
impl ScriptContext for Legacy {
@@ -318,7 +318,7 @@ impl ScriptContext for Legacy {
318318
}
319319

320320
/// Segwitv0 ScriptContext
321-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
321+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
322322
pub enum Segwitv0 {}
323323

324324
impl ScriptContext for Segwitv0 {
@@ -404,7 +404,7 @@ impl ScriptContext for Segwitv0 {
404404
/// To be used as raw script pubkeys
405405
/// In general, it is not recommended to use Bare descriptors
406406
/// as they as strongly limited by standardness policies.
407-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
407+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
408408
pub enum BareCtx {}
409409

410410
impl ScriptContext for BareCtx {
@@ -466,7 +466,7 @@ impl ScriptContext for BareCtx {
466466
/// Used by the "satisified constraints" iterator, which is intended to read
467467
/// scripts off of the blockchain without doing any sanity checks on them.
468468
/// This context should not be used unless you know what you are doing.
469-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
469+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
470470
pub enum NoChecks {}
471471
impl ScriptContext for NoChecks {
472472
fn check_terminal_non_malleable<Pk: MiniscriptKey, Ctx: ScriptContext>(

0 commit comments

Comments
 (0)