Skip to content

Commit

Permalink
Merge #216: add Address::is_liquid
Browse files Browse the repository at this point in the history
17578d7 add Address::is_liquid (Riccardo Casatta)

Pull request description:

  User code can already compare against AddressParams, but it seems easier to find a method to check if the address is liquid. Even tough is less general because you can't discriminate between elements and liquid testnet, most of the time wallets are interested only in the mainnet or not discrimination.

ACKs for top commit:
  apoelstra:
    ACK 17578d7 successfully ran local tests; sure

Tree-SHA512: e2d47a1ed8880c3c54ddb9c8812f0ae0bc321f74747eb2b45c1078f1afe63a73c910849d2c75b8af6f41600163fd6b156d5ac72e9c263c2a99f3a0fcee217643
  • Loading branch information
apoelstra committed Sep 19, 2024
2 parents 85604b0 + 17578d7 commit b21356e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ impl Address {
self.blinding_pubkey.is_some()
}

/// Return if the address is for the Liquid network
pub fn is_liquid(&self) -> bool {
self.params == &AddressParams::LIQUID
}

/// Creates a pay to (compressed) public key hash address from a public key
/// This is the preferred non-witness type address
#[inline]
Expand Down

0 comments on commit b21356e

Please sign in to comment.