Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 6 | public function __construct(ScriptInterface $script) |
|
20 | { |
||
21 | 6 | $chunks = $script->getScriptParser()->decode(); |
|
22 | 6 | if (count($chunks) !== 2 || !$chunks[0]->isPush()) { |
|
23 | throw new \InvalidArgumentException('Malformed pay-to-pubkey script'); |
||
24 | } |
||
25 | 6 | $this->publicKey = PublicKeyFactory::fromHex($chunks[0]->getData()); |
|
26 | 6 | } |
|
27 | |||
61 |