patch protonlabs/bitcoin to be 8.4-clean

This commit is contained in:
Spine
2025-02-27 11:34:19 +00:00
parent f5ad4016a9
commit 2cff1ec854
2 changed files with 34 additions and 3 deletions

View File

@@ -1,6 +1,9 @@
#!/bin/sh
#! /bin/sh
for patch in $(find "$(dirname $0)"/../misc/patch/ -name "*.patch" -print)
set -eu
for patch in $(find "$(dirname "$0")"/../misc/patch/ -name "*.patch" -print)
do
patch -p1 < $patch || exit 1
# idempotent: ignore if a patch has been already applied
patch -p1 -f -r - -s < "$patch" 2> /dev/null || true
done

View File

@@ -0,0 +1,28 @@
diff --git a/vendor/protonlabs/bitcoin/src/Address/Bech32AddressInterface.php b/vendor/protonlabs/bitcoin/src/Address/Bech32AddressInterface.php
index 63a06991..d6cc41a3 100644
--- a/vendor/protonlabs/bitcoin/src/Address/Bech32AddressInterface.php
+++ b/vendor/protonlabs/bitcoin/src/Address/Bech32AddressInterface.php
@@ -9,8 +9,8 @@ use BitWasp\Bitcoin\Network\NetworkInterface;
interface Bech32AddressInterface extends AddressInterface
{
/**
- * @param NetworkInterface $network
+ * @param NetworkInterface|null $network
* @return string
*/
- public function getHRP(NetworkInterface $network = null): string;
+ public function getHRP(NetworkInterface|null $network = null): string;
}
diff --git a/vendor/protonlabs/bitcoin/src/Address/SegwitAddress.php b/vendor/protonlabs/bitcoin/src/Address/SegwitAddress.php
index 89aba2ed..6405c0b7 100644
--- a/vendor/protonlabs/bitcoin/src/Address/SegwitAddress.php
+++ b/vendor/protonlabs/bitcoin/src/Address/SegwitAddress.php
@@ -31,7 +31,7 @@ class SegwitAddress extends Address implements Bech32AddressInterface
* @param NetworkInterface|null $network
* @return string
*/
- public function getHRP(NetworkInterface $network = null): string
+ public function getHRP(NetworkInterface|null $network = null): string
{
$network = $network ?: Bitcoin::getNetwork();
return $network->getSegwitBech32Prefix();