Completed
Pull Request — 0.0.35 (#660)
by thomas
29:47 queued 20:44
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 1
Bugs 0 Features 1
Metric Value
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 1
wmc 2
lcom 0
cbo 1

1 Method

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