Completed
Push — master ( abcf31...a8a46d )
by thomas
28:08 queued 25:46
created

BitcoinTestnetRegistry   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Network\Slip132;
6
7
use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry;
8
use BitWasp\Bitcoin\Script\ScriptType;
9
10
class BitcoinTestnetRegistry extends PrefixRegistry
11
{
12 6
    public function __construct()
13
    {
14 6
        $map = [];
15
        foreach ([
16
                     // private, public
17 6
                     [["04358394", "043587cf"], /* xpub */ [ScriptType::P2PKH]],
18
                     [["04358394", "043587cf"], /* xpub */ [ScriptType::P2SH, ScriptType::P2PKH]],
19
                     [["044a4e28", "044a5262"], /* ypub */ [ScriptType::P2SH, ScriptType::P2WKH]],
20
                     [["045f18bc", "045f1cf6"], /* zpub */ [ScriptType::P2WKH]],
21
                     [["02575048", "02575483"], /* Zpub */ [ScriptType::P2WSH, ScriptType::P2PKH]],
22
                 ] as $row) {
23 6
            list ($prefixList, $scriptType) = $row;
24 6
            $type = implode("|", $scriptType);
25 6
            $map[$type] = $prefixList;
26
        }
27
28 6
        parent::__construct($map);
29 6
    }
30
}
31