| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 4 | public function addNonWitnessTx(TransactionInterface $tx) |
|
| 34 | { |
||
| 35 | 4 | $outPoint = $this->psbt->getTransaction()->getInputs()[$this->nIn]->getOutPoint(); |
|
| 36 | 4 | if (!$outPoint->getTxId()->equals($tx->getTxId())) { |
|
| 37 | 1 | throw new \RuntimeException("Non-witness txid differs from unsigned tx input {$this->nIn}"); |
|
| 38 | } |
||
| 39 | 3 | if ($outPoint->getVout() > count($tx->getOutputs()) - 1) { |
|
| 40 | 1 | throw new \RuntimeException("unsigned tx outpoint does not exist in this transaction"); |
|
| 41 | } |
||
| 42 | 2 | $this->input = $this->input->withNonWitnessTx($tx); |
|
| 43 | 2 | } |
|
| 65 |