| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 13 | public function __construct($testnet = false) { |
|
| 21 | 13 | if ($testnet) { |
|
| 22 | 8 | $base = NetworkFactory::bitcoinTestnet(); |
|
| 23 | 8 | $cashAddressPrefix = "bchtest"; |
|
| 24 | } else { |
||
| 25 | 5 | $base = NetworkFactory::bitcoin(); |
|
| 26 | 5 | $cashAddressPrefix = "bitcoincash"; |
|
| 27 | } |
||
| 28 | |||
| 29 | 13 | parent::__construct( |
|
| 30 | 13 | $base->getAddressByte(), |
|
| 31 | 13 | $base->getP2shByte(), |
|
| 32 | 13 | $base->getPrivByte(), |
|
| 33 | 13 | $base->isTestnet() |
|
| 34 | ); |
||
| 35 | |||
| 36 | 13 | $this->setHDPrivByte($base->getHDPrivByte()); |
|
| 37 | 13 | $this->setHDPubByte($base->getHDPubByte()); |
|
| 38 | 13 | $this->setNetMagicBytes($base->getNetMagicBytes()); |
|
| 39 | 13 | $this->cashAddressPrefix = $cashAddressPrefix; |
|
| 40 | 13 | } |
|
| 41 | |||
| 49 |