1 | <?php |
||
25 | class Checker |
||
26 | { |
||
27 | /** |
||
28 | * @var EcAdapterInterface |
||
29 | */ |
||
30 | private $adapter; |
||
31 | |||
32 | /** |
||
33 | * @var TransactionInterface |
||
34 | */ |
||
35 | private $transaction; |
||
36 | |||
37 | /** |
||
38 | * @var int |
||
39 | */ |
||
40 | private $nInput; |
||
41 | |||
42 | /** |
||
43 | * @var int|string |
||
44 | */ |
||
45 | private $amount; |
||
46 | |||
47 | /** |
||
48 | * @var Hasher |
||
49 | */ |
||
50 | 1328 | private $hasherV0; |
|
51 | |||
52 | 1328 | /** |
|
53 | 1328 | * @var array |
|
54 | 1328 | */ |
|
55 | 1328 | private $sigHashCache = []; |
|
56 | 1328 | ||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private $sigCache = []; |
||
61 | |||
62 | 127 | /** |
|
63 | * @var TransactionSignatureSerializer |
||
64 | */ |
||
65 | 127 | private $sigSerializer; |
|
66 | 81 | ||
67 | 50 | /** |
|
68 | * @var PublicKeySerializerInterface |
||
69 | */ |
||
70 | private $pubKeySerializer; |
||
71 | 50 | ||
72 | /** |
||
73 | * Checker constructor. |
||
74 | * @param EcAdapterInterface $ecAdapter |
||
75 | * @param TransactionInterface $transaction |
||
76 | * @param int $nInput |
||
77 | * @param int $amount |
||
78 | * @param TransactionSignatureSerializer|null $sigSerializer |
||
79 | * @param PublicKeySerializerInterface|null $pubKeySerializer |
||
80 | 7 | */ |
|
81 | public function __construct(EcAdapterInterface $ecAdapter, TransactionInterface $transaction, $nInput, $amount, TransactionSignatureSerializer $sigSerializer = null, PublicKeySerializerInterface $pubKeySerializer = null) |
||
90 | |||
91 | 5 | /** |
|
92 | * @param BufferInterface $signature |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function isValidSignatureEncoding(BufferInterface $signature) |
||
106 | |||
107 | /** |
||
108 | * @param BufferInterface $signature |
||
109 | * @return bool |
||
110 | * @throws ScriptRuntimeException |
||
111 | * @throws \Exception |
||
112 | 18 | */ |
|
113 | public function isLowDerSignature(BufferInterface $signature) |
||
126 | |||
127 | /** |
||
128 | 225 | * @param int $hashType |
|
129 | * @return bool |
||
130 | 225 | */ |
|
131 | 44 | public function isDefinedHashtype($hashType) |
|
137 | 3 | ||
138 | 146 | /** |
|
139 | 4 | * Determine whether the sighash byte appended to the signature encodes |
|
140 | * a valid sighash type. |
||
141 | * |
||
142 | 142 | * @param BufferInterface $signature |
|
143 | * @return bool |
||
144 | */ |
||
145 | public function isDefinedHashtypeSignature(BufferInterface $signature) |
||
154 | 7 | ||
155 | /** |
||
156 | * @param BufferInterface $signature |
||
157 | 163 | * @param int $flags |
|
158 | * @return $this |
||
159 | * @throws \BitWasp\Bitcoin\Exceptions\ScriptRuntimeException |
||
160 | */ |
||
161 | public function checkSignatureEncoding(BufferInterface $signature, $flags) |
||
177 | 124 | ||
178 | /** |
||
179 | 116 | * @param BufferInterface $publicKey |
|
180 | 34 | * @param int $flags |
|
181 | * @return $this |
||
182 | 84 | * @throws \Exception |
|
183 | */ |
||
184 | public function checkPublicKeyEncoding(BufferInterface $publicKey, $flags) |
||
192 | |||
193 | /** |
||
194 | * @param ScriptInterface $script |
||
195 | * @param int $sigHashType |
||
196 | * @param int $sigVersion |
||
197 | * @return BufferInterface |
||
198 | */ |
||
199 | public function getSigHash(ScriptInterface $script, $sigHashType, $sigVersion) |
||
221 | |||
222 | /** |
||
223 | * @param ScriptInterface $script |
||
224 | * @param BufferInterface $sigBuf |
||
225 | * @param BufferInterface $keyBuf |
||
226 | * @param int $sigVersion |
||
227 | * @param int $flags |
||
228 | * @return bool |
||
229 | 2 | * @throws ScriptRuntimeException |
|
230 | */ |
||
231 | 2 | public function checkSig(ScriptInterface $script, BufferInterface $sigBuf, BufferInterface $keyBuf, $sigVersion, $flags) |
|
254 | |||
255 | /** |
||
256 | * @param int $txLockTime |
||
257 | * @param int $nThreshold |
||
258 | * @param \BitWasp\Bitcoin\Script\Interpreter\Number $lockTime |
||
259 | * @return bool |
||
260 | */ |
||
261 | private function verifyLockTime($txLockTime, $nThreshold, \BitWasp\Bitcoin\Script\Interpreter\Number $lockTime) |
||
272 | |||
273 | /** |
||
274 | * @param \BitWasp\Bitcoin\Script\Interpreter\Number $lockTime |
||
275 | * @return bool |
||
276 | */ |
||
277 | public function checkLockTime(\BitWasp\Bitcoin\Script\Interpreter\Number $lockTime) |
||
285 | |||
286 | |||
287 | /** |
||
288 | * @param \BitWasp\Bitcoin\Script\Interpreter\Number $sequence |
||
289 | * @return bool |
||
290 | */ |
||
291 | public function checkSequence(\BitWasp\Bitcoin\Script\Interpreter\Number $sequence) |
||
309 | } |
||
310 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: