1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00

defs: fix segwit related fields

This commit is contained in:
Pavol Rusnak 2019-03-26 12:22:57 +01:00
parent 893aedf392
commit 792a4eddb5
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
19 changed files with 79 additions and 86 deletions

View File

@ -1,38 +1,38 @@
{
"coin_name": "Actinium",
"coin_shortcut": "ACM",
"coin_label": "Actinium",
"website": "https://actinium.org",
"github": "https://github.com/Actinium-project/Actinium",
"maintainer": "Harris Brakmic <brakmic@actinium.org>",
"curve_name": "secp256k1",
"address_type": 53,
"address_type_p2sh": 55,
"maxfee_kb": 40000000,
"minfee_kb": 100000,
"signed_message_header": "Actinium Signed Message:\n",
"hash_genesis_block": "28d77872e23714562f49a1be792c276623c1bbe3fdcf21b6035cfde78b00b824",
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"bech32_prefix": "acm",
"cashaddr_prefix": null,
"slip44": 228,
"segwit": true,
"decred": false,
"fork_id": null,
"force_bip143": false,
"bip115": false,
"default_fee_b": {
"coin_name": "Actinium",
"coin_shortcut": "ACM",
"coin_label": "Actinium",
"website": "https://actinium.org",
"github": "https://github.com/Actinium-project/Actinium",
"maintainer": "Harris Brakmic <brakmic@actinium.org>",
"curve_name": "secp256k1",
"address_type": 53,
"address_type_p2sh": 55,
"maxfee_kb": 40000000,
"minfee_kb": 100000,
"signed_message_header": "Actinium Signed Message:\n",
"hash_genesis_block": "28d77872e23714562f49a1be792c276623c1bbe3fdcf21b6035cfde78b00b824",
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "acm",
"cashaddr_prefix": null,
"slip44": 228,
"segwit": true,
"decred": false,
"fork_id": null,
"force_bip143": false,
"bip115": false,
"default_fee_b": {
"Normal": 1000
},
"dust_limit": 546,
"blocktime_seconds": 150,
"uri_prefix": "actinium",
"min_address_length": 27,
"max_address_length": 34,
"bitcore": [],
"blockbook": [],
"cooldown": 100
},
"dust_limit": 546,
"blocktime_seconds": 150,
"uri_prefix": "actinium",
"min_address_length": 27,
"max_address_length": 34,
"bitcore": [],
"blockbook": [],
"cooldown": 100
}

View File

@ -15,7 +15,7 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "btg",
"cashaddr_prefix": null,
"slip44": 156,

View File

@ -15,7 +15,7 @@
"xprv_magic": 70615956,
"xpub_magic": 70617039,
"xpub_magic_segwit_p2sh": 71979618,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 73342198,
"bech32_prefix": "tbtg",
"cashaddr_prefix": null,
"slip44": 156,

View File

@ -16,7 +16,7 @@
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": null,
"bech32_prefix": "bsd",
"cashaddr_prefix": null,
"slip44": 91,
"segwit": true,

View File

@ -15,7 +15,7 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "dgb",
"cashaddr_prefix": null,
"slip44": 20,

View File

@ -15,7 +15,7 @@
"xprv_magic": 76077806,
"xpub_magic": 76069926,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "fc",
"cashaddr_prefix": null,
"slip44": 8,

View File

@ -15,8 +15,8 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"bech32_prefix": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "flash",
"cashaddr_prefix": null,
"slip44": 120,
"segwit": true,

View File

@ -15,7 +15,7 @@
"xprv_magic": 15264107,
"xpub_magic": 1526049,
"xpub_magic_segwit_p2sh": 28471030,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "flo",
"cashaddr_prefix": null,
"slip44": 216,

View File

@ -15,7 +15,7 @@
"xpub_magic": 27106558,
"xprv_magic": 27108450,
"xpub_magic_segwit_p2sh": 28471030,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "game",
"cashaddr_prefix": null,
"slip44": 101,

View File

@ -15,7 +15,7 @@
"xprv_magic": 27106558,
"xpub_magic": 27108450,
"xpub_magic_segwit_p2sh": 28471030,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "ltc",
"cashaddr_prefix": null,
"slip44": 2,

View File

@ -14,8 +14,8 @@
"hash_genesis_block": "4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0",
"xprv_magic": 70615956,
"xpub_magic": 70617039,
"xpub_magic_segwit_p2sh": null,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_p2sh": 71979618,
"xpub_magic_segwit_native": 73342198,
"bech32_prefix": "tltc",
"cashaddr_prefix": null,
"slip44": 1,

View File

@ -16,7 +16,7 @@
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": null,
"bech32_prefix": "mec",
"cashaddr_prefix": null,
"slip44": 217,
"segwit": true,

View File

@ -12,10 +12,10 @@
"minfee_kb": 100000,
"signed_message_header": "Monacoin Signed Message:\n",
"hash_genesis_block": "ff9f1c0116d19de7c9963845e129f9ed1bfc0b376eb54fd7afa42e0d418c8bb6",
"xpub_magic": 76067358,
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "mona",
"cashaddr_prefix": null,
"slip44": 22,

View File

@ -14,9 +14,9 @@
"hash_genesis_block": "00000ffde4c020b5938441a0ea3d314bf619eff0b38f32f78f7583cffa1ea485",
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": null,
"xpub_magic_segwit_native": null,
"bech32_prefix": null,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "xmy",
"cashaddr_prefix": null,
"slip44": 90,
"segwit": true,

View File

@ -15,7 +15,7 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "nix",
"cashaddr_prefix": null,
"slip44": 400,

View File

@ -12,11 +12,11 @@
"minfee_kb": 1000,
"signed_message_header": "Pesetacoin Signed Message:\n",
"hash_genesis_block": "edfe5830b53251bfff733600b1cd5c192e761c011b055f07924634818c906438",
"xpub_magic": 76071982,
"xprv_magic": 76079604,
"xpub_magic": 76071982,
"xpub_magic_segwit_p2sh": null,
"xpub_magic_segwit_native": null,
"bech32_prefix": "null",
"bech32_prefix": null,
"cashaddr_prefix": null,
"slip44": 109,
"segwit": false,

View File

@ -15,7 +15,7 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "vtc",
"cashaddr_prefix": null,
"slip44": 28,

View File

@ -15,7 +15,7 @@
"xprv_magic": 76066276,
"xpub_magic": 76067358,
"xpub_magic_segwit_p2sh": 77429938,
"xpub_magic_segwit_native": null,
"xpub_magic_segwit_native": 78792518,
"bech32_prefix": "via",
"cashaddr_prefix": null,
"slip44": 14,

View File

@ -414,36 +414,29 @@ def check_key_uniformity(coins):
def check_segwit(coins):
for coin in coins:
segwit = coin["segwit"]
segwit_fields = [
"bech32_prefix",
"xpub_magic_segwit_native",
"xpub_magic_segwit_p2sh",
]
if segwit:
if coin["xpub_magic_segwit_native"] is None:
print_log(
logging.WARNING,
coin["name"],
"segwit is True => xpub_magic_segwit_native should be set",
)
# return False
if coin["xpub_magic_segwit_p2sh"] is None:
print_log(
logging.WARNING,
coin["name"],
"segwit is True => xpub_magic_segwit_p2sh should be set",
)
# return False
for field in segwit_fields:
if coin[field] is None:
print_log(
logging.ERROR,
coin["name"],
"segwit is True => %s should be set" % field,
)
return False
else:
if coin["xpub_magic_segwit_native"] is not None:
print_log(
logging.ERROR,
coin["name"],
"segwit is False => xpub_magic_segwit_native should NOT be set",
)
return False
if coin["xpub_magic_segwit_p2sh"] is not None:
print_log(
logging.ERROR,
coin["name"],
"segwit is False => xpub_magic_segwit_p2sh should NOT be set",
)
return False
for field in segwit_fields:
if coin[field] is not None:
print_log(
logging.ERROR,
coin["name"],
"segwit is True => %s should NOT be set" % field,
)
return False
return True