|
3 | 3 | // file COPYING or https://www.opensource.org/licenses/mit-license.php.
|
4 | 4 |
|
5 | 5 | #include <addresstype.h>
|
6 |
| -#include <script/script.h> |
7 |
| -#include <script/solver.h> |
| 6 | + |
| 7 | +#include <crypto/sha256.h> |
8 | 8 | #include <hash.h>
|
9 | 9 | #include <pubkey.h>
|
| 10 | +#include <script/script.h> |
| 11 | +#include <script/solver.h> |
10 | 12 | #include <uint256.h>
|
11 | 13 | #include <util/hash_type.h>
|
12 | 14 |
|
| 15 | +#include <cassert> |
13 | 16 | #include <vector>
|
14 | 17 |
|
15 | 18 | typedef std::vector<unsigned char> valtype;
|
16 | 19 |
|
17 | 20 | ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
|
18 |
| -ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {} |
| 21 | +ScriptHash::ScriptHash(const CScriptID& in) : BaseHash{in} {} |
19 | 22 |
|
20 | 23 | PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
|
21 | 24 | PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
|
22 | 25 |
|
23 | 26 | WitnessV0KeyHash::WitnessV0KeyHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
|
24 |
| -WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash(static_cast<uint160>(pubkey_hash)) {} |
| 27 | +WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash{pubkey_hash} {} |
25 | 28 |
|
26 | 29 | CKeyID ToKeyID(const PKHash& key_hash)
|
27 | 30 | {
|
28 |
| - return CKeyID{static_cast<uint160>(key_hash)}; |
| 31 | + return CKeyID{uint160{key_hash}}; |
29 | 32 | }
|
30 | 33 |
|
31 | 34 | CKeyID ToKeyID(const WitnessV0KeyHash& key_hash)
|
32 | 35 | {
|
33 |
| - return CKeyID{static_cast<uint160>(key_hash)}; |
| 36 | + return CKeyID{uint160{key_hash}}; |
34 | 37 | }
|
35 | 38 |
|
36 | 39 | CScriptID ToScriptID(const ScriptHash& script_hash)
|
37 | 40 | {
|
38 |
| - return CScriptID{static_cast<uint160>(script_hash)}; |
| 41 | + return CScriptID{uint160{script_hash}}; |
39 | 42 | }
|
40 | 43 |
|
41 | 44 | WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in)
|
|
0 commit comments