Skip to content

Commit b21356e

Browse files
committed
Merge #216: add Address::is_liquid
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
2 parents 85604b0 + 17578d7 commit b21356e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/address.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ impl Address {
223223
self.blinding_pubkey.is_some()
224224
}
225225

226+
/// Return if the address is for the Liquid network
227+
pub fn is_liquid(&self) -> bool {
228+
self.params == &AddressParams::LIQUID
229+
}
230+
226231
/// Creates a pay to (compressed) public key hash address from a public key
227232
/// This is the preferred non-witness type address
228233
#[inline]

0 commit comments

Comments
 (0)