| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 6 | public function __construct(ScriptInterface $script) |
|
| 21 | { |
||
| 22 | 6 | $chunks = $script->getScriptParser()->decode(); |
|
| 23 | 6 | if (count($chunks) !== 5 || !$chunks[2]->isPush()) { |
|
| 24 | throw new \RuntimeException('Malformed pay-to-pubkey-hash script'); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** @var BufferInterface $hash */ |
||
| 28 | 6 | $hash = $chunks[2]->getData(); |
|
| 29 | 6 | $this->hash = $hash; |
|
| 30 | 6 | } |
|
| 31 | |||
| 65 |