Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Sep 24, 2024
1 parent 93cdcf5 commit a4ddec2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ class Address
const BECH32_ADDRESS_LENGTH = 62;
const PUBKEY_LENGTH = 32;

public readonly string $hrp;

private function __construct(
private string $valueHex,
string $hrp = self::DEFAULT_HRP
public readonly string $hrp = self::DEFAULT_HRP
) {
$this->hrp = $hrp;
}

public static function newFromHex(string $value, string $hrp = self::DEFAULT_HRP): Address
{
if (! self::isValidHex($value)) {
throw new InvalidArgumentException('Invalid hex value');
throw new InvalidArgumentException('invalid hex value');
}

return new Address(
Expand Down

0 comments on commit a4ddec2

Please sign in to comment.