Add Blacklist::checkAddress() method
This commit is contained in:
@@ -17,6 +17,14 @@ final class Blacklist
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The official list of blacklisted addresses
|
||||||
|
*/
|
||||||
|
public const ADDRESSES = [
|
||||||
|
// phpcs:disable Generic.Files.LineLength
|
||||||
|
// phpcs:enable
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a public key is blacklisted
|
* Check if a public key is blacklisted
|
||||||
*
|
*
|
||||||
@@ -27,4 +35,15 @@ final class Blacklist
|
|||||||
{
|
{
|
||||||
return key_exists($publicKey, static::PUBLIC_KEYS);
|
return key_exists($publicKey, static::PUBLIC_KEYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if an address is blacklisted
|
||||||
|
*
|
||||||
|
* @param string $address
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function checkAddress(string $address): bool
|
||||||
|
{
|
||||||
|
return key_exists($address, static::ADDRESSES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user