1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace BitWasp\Bitcoin\Transaction\Factory\Checker; |
4
|
|
|
|
5
|
|
|
use BitWasp\Bitcoin\Crypto\EcAdapter\Adapter\EcAdapterInterface; |
6
|
|
|
use BitWasp\Bitcoin\Crypto\EcAdapter\Serializer\Key\PublicKeySerializerInterface; |
7
|
|
|
use BitWasp\Bitcoin\Script\Interpreter\CheckerBase; |
8
|
|
|
use BitWasp\Bitcoin\Serializer\Signature\TransactionSignatureSerializer; |
9
|
|
|
use BitWasp\Bitcoin\Transaction\TransactionInterface; |
10
|
|
|
use BitWasp\Bitcoin\Transaction\TransactionOutputInterface; |
11
|
|
|
|
12
|
|
|
abstract class CheckerCreatorBase |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var EcAdapterInterface |
16
|
|
|
*/ |
17
|
|
|
protected $ecAdapter; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var TransactionSignatureSerializer |
21
|
|
|
*/ |
22
|
|
|
protected $txSigSerializer; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var PublicKeySerializerInterface |
26
|
|
|
*/ |
27
|
|
|
protected $pubKeySerializer; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* CheckerCreator constructor. |
31
|
|
|
* @param EcAdapterInterface $ecAdapter |
32
|
|
|
* @param TransactionSignatureSerializer $txSigSerializer |
33
|
|
|
* @param PublicKeySerializerInterface $pubKeySerializer |
34
|
|
|
*/ |
35
|
61 |
|
public function __construct( |
36
|
|
|
EcAdapterInterface $ecAdapter, |
37
|
|
|
TransactionSignatureSerializer $txSigSerializer, |
38
|
|
|
PublicKeySerializerInterface $pubKeySerializer |
39
|
|
|
) { |
40
|
61 |
|
$this->ecAdapter = $ecAdapter; |
41
|
61 |
|
$this->txSigSerializer = $txSigSerializer; |
42
|
61 |
|
$this->pubKeySerializer = $pubKeySerializer; |
43
|
61 |
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @param TransactionInterface $tx |
47
|
|
|
* @param int $nInput |
48
|
|
|
* @param TransactionOutputInterface $txOut |
49
|
|
|
* @return CheckerBase |
50
|
|
|
*/ |
51
|
|
|
abstract public function create(TransactionInterface $tx, $nInput, TransactionOutputInterface $txOut); |
52
|
|
|
} |
53
|
|
|
|