Skip to content

Commit 902c180

Browse files
committed
Hash derive for miniscript context types
1 parent 95811b2 commit 902c180

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
@@ -239,7 +239,7 @@ pub trait ScriptContext:
239239
/// To be used as P2SH scripts
240240
/// For creation of Bare scriptpubkeys, construct the Miniscript
241241
/// under `Bare` ScriptContext
242-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
242+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
243243
pub enum Legacy {}
244244

245245
impl ScriptContext for Legacy {
@@ -310,7 +310,7 @@ impl ScriptContext for Legacy {
310310
}
311311

312312
/// Segwitv0 ScriptContext
313-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
313+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
314314
pub enum Segwitv0 {}
315315

316316
impl ScriptContext for Segwitv0 {
@@ -395,7 +395,7 @@ impl ScriptContext for Segwitv0 {
395395
/// To be used as raw script pubkeys
396396
/// In general, it is not recommended to use Bare descriptors
397397
/// as they as strongly limited by standardness policies.
398-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
398+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
399399
pub enum BareCtx {}
400400

401401
impl ScriptContext for BareCtx {
@@ -457,7 +457,7 @@ impl ScriptContext for BareCtx {
457457
/// Used by the "satisified constraints" iterator, which is intended to read
458458
/// scripts off of the blockchain without doing any sanity checks on them.
459459
/// This context should not be used unless you know what you are doing.
460-
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)]
460+
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
461461
pub enum NoChecks {}
462462
impl ScriptContext for NoChecks {
463463
fn check_terminal_non_malleable<Pk: MiniscriptKey, Ctx: ScriptContext>(

0 commit comments

Comments
 (0)