Completed
Pull Request — master (#118)
by thomas
07:20
created

AbstractBitcoinCash   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 0
cts 15
cp 0
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
    public function __construct(NetworkInterface $base, $cashAddressPrefix) {
22
        parent::__construct(
23
            $base->getAddressByte(),
24
            $base->getP2shByte(),
25
            $base->getPrivByte(),
26
            $base->isTestnet()
27
        );
28
29
        $this->setHDPrivByte($base->getHDPrivByte());
30
        $this->setHDPubByte($base->getHDPubByte());
31
        $this->setNetMagicBytes($base->getNetMagicBytes());
32
        $this->cashAddressPrefix = $cashAddressPrefix;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getCashAddressPrefix() {
39
        return $this->cashAddressPrefix;
40
    }
41
}
42