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

AbstractBitcoinCash   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getCashAddressPrefix() 0 3 1
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