| Conditions | 4 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.074 |
| 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) !== 2 || !$chunks[0]->isPush() || $chunks[1]->getOp() !== Opcodes::OP_CHECKSIG) { |
|
| 24 | throw new \InvalidArgumentException('Malformed pay-to-pubkey script'); |
||
| 25 | } |
||
| 26 | 6 | $this->publicKey = PublicKeyFactory::fromHex($chunks[0]->getData()); |
|
| 27 | 6 | } |
|
| 28 | |||
| 62 |