Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
1 | <?php |
||
25 | public function __construct(ScriptInterface $script) |
||
26 | { |
||
27 | $this->script = $script; |
||
28 | $chunks = $script->getScriptParser()->decode(); |
||
29 | if (count($chunks) < 1 || !$chunks[0]->isPush()) { |
||
30 | throw new \InvalidArgumentException('Malformed pay-to-pubkey script'); |
||
31 | } |
||
32 | $this->publicKey = PublicKeyFactory::fromHex($chunks[0]->getData()); |
||
33 | } |
||
34 | |||
76 |