Skip to content

Commit

Permalink
From<WitnessVersion> for bech32::Variant
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Sep 17, 2021
1 parent b5555e0 commit ad60698
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/util/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ impl From<WitnessVersion> for ::bech32::u5 {
}
}

impl From<WitnessVersion> for ::bech32::Variant {
#[inline]
fn from(version: WitnessVersion) -> Self {
version.bech32_variant()
}
}

impl From<WitnessVersion> for opcodes::All {
/// Converts [`WitnessVersion`] instance into corresponding Bitcoin scriptopcode (`OP_0`..`OP_16`)
fn from(version: WitnessVersion) -> opcodes::All {
Expand Down

0 comments on commit ad60698

Please sign in to comment.