Completed
Pull Request — master (#662)
by thomas
38:24
created

BitcoinTestnetRegistry::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 13
nc 2
nop 0
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
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
    public function __construct()
11
    {
12
        $map = [];
13
        foreach ([
14
                     // private, public
15
                     [["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
            list ($prefixList, $scriptType) = $row;
22
            $type = implode("|", $scriptType);
23
            $map[$type] = $prefixList;
24
        }
25
26
        parent::__construct($map);
27
    }
28
}
29