1 | <?php |
||
16 | class TransactionOutputSerializer |
||
17 | { |
||
18 | /** |
||
19 | * @var \BitWasp\Buffertools\Types\Uint64 |
||
20 | */ |
||
21 | private $uint64le; |
||
22 | |||
23 | /** |
||
24 | * @var \BitWasp\Buffertools\Types\VarString |
||
25 | */ |
||
26 | private $varstring; |
||
27 | |||
28 | /** |
||
29 | * @var Opcodes |
||
30 | */ |
||
31 | private $opcodes; |
||
32 | |||
33 | /** |
||
34 | * TransactionOutputSerializer constructor. |
||
35 | * @param Opcodes|null $opcodes |
||
36 | */ |
||
37 | 5243 | public function __construct(Opcodes $opcodes = null) |
|
38 | { |
||
39 | 5243 | $this->uint64le = Types::uint64le(); |
|
40 | 5243 | $this->varstring = Types::varstring(); |
|
41 | 5243 | $this->opcodes = $opcodes ?: new Opcodes(); |
|
42 | 5243 | } |
|
43 | |||
44 | /** |
||
45 | * @param TransactionOutputInterface $output |
||
46 | * @return BufferInterface |
||
47 | */ |
||
48 | 5228 | public function serialize(TransactionOutputInterface $output): BufferInterface |
|
55 | |||
56 | /** |
||
57 | * @param Parser $parser |
||
58 | * @return TransactionOutputInterface |
||
59 | * @throws \BitWasp\Buffertools\Exceptions\ParserOutOfRange |
||
60 | */ |
||
61 | 68 | public function fromParser(Parser $parser): TransactionOutputInterface |
|
68 | |||
69 | /** |
||
70 | * @param BufferInterface $string |
||
71 | * @return TransactionOutputInterface |
||
72 | * @throws \BitWasp\Buffertools\Exceptions\ParserOutOfRange |
||
73 | */ |
||
74 | 1 | public function parse(BufferInterface $string): TransactionOutputInterface |
|
78 | } |
||
79 |