Completed
Branch master (e62670)
by
unknown
02:05
created

AbstractBitcoinCash::getCashAddressPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Blocktrail\SDK\Network;
4
5
use BitWasp\Bitcoin\Network\Network;
6
use BitWasp\Bitcoin\Network\NetworkInterface;
7
8
abstract class AbstractBitcoinCash extends Network implements BitcoinCashNetworkInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $cashAddressPrefix;
14
15
    /**
16
     * BitcoinCash constructor.
17
     * @param NetworkInterface $base
18
     * @param string $cashAddressPrefix
19
     * @throws \Exception
20
     */
21 14
    public function __construct(NetworkInterface $base, $cashAddressPrefix) {
22 14
        parent::__construct(
23 14
            $base->getAddressByte(),
24 14
            $base->getP2shByte(),
25 14
            $base->getPrivByte(),
26 14
            $base->isTestnet()
27
        );
28
29 14
        $this->setHDPrivByte($base->getHDPrivByte());
30 14
        $this->setHDPubByte($base->getHDPubByte());
31 14
        $this->setNetMagicBytes($base->getNetMagicBytes());
32 14
        $this->cashAddressPrefix = $cashAddressPrefix;
33 14
    }
34
35
    /**
36
     * @return string
37
     */
38 10
    public function getCashAddressPrefix() {
39 10
        return $this->cashAddressPrefix;
40
    }
41
}
42