From c5045f066729dd3e650c3a61ec2dcfe01bccc8fa Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 16 Jul 2018 14:20:02 +0200 Subject: [PATCH] defs: rename address_prefix to uri_prefix, drop ':', add more regexes --- defs/coins/bcash.json | 2 +- defs/coins/bcash_testnet.json | 2 +- defs/coins/bgold.json | 2 +- defs/coins/bgold_testnet.json | 2 +- defs/coins/bitcoin.json | 2 +- defs/coins/bitcoin_testnet.json | 2 +- defs/coins/bitcore.json | 2 +- defs/coins/bprivate.json | 2 +- defs/coins/crown.json | 2 +- defs/coins/dash.json | 2 +- defs/coins/dash_testnet.json | 2 +- defs/coins/decred.json | 2 +- defs/coins/decred_testnet.json | 2 +- defs/coins/denarius.json | 2 +- defs/coins/digibyte.json | 2 +- defs/coins/dogecoin.json | 2 +- defs/coins/feathercoin.json | 2 +- defs/coins/flashcoin.json | 2 +- defs/coins/fujicoin.json | 2 +- defs/coins/groestlcoin.json | 2 +- defs/coins/groestlcoin_testnet.json | 2 +- defs/coins/koto.json | 2 +- defs/coins/litecoin.json | 2 +- defs/coins/litecoin_testnet.json | 2 +- defs/coins/monacoin.json | 2 +- defs/coins/monetaryunit.json | 2 +- defs/coins/myriad.json | 2 +- defs/coins/namecoin.json | 2 +- defs/coins/pesetacoin.json | 2 +- defs/coins/terracoin.json | 2 +- defs/coins/vertcoin.json | 2 +- defs/coins/viacoin.json | 2 +- defs/coins/zcash.json | 2 +- defs/coins/zcash_testnet.json | 2 +- defs/coins/zcoin.json | 2 +- defs/coins/zcoin_testnet.json | 2 +- defs/coins/zencash.json | 2 +- tools/build_coins.py | 6 +++--- 38 files changed, 40 insertions(+), 40 deletions(-) diff --git a/defs/coins/bcash.json b/defs/coins/bcash.json index 5577863fb..ffed37d0d 100644 --- a/defs/coins/bcash.json +++ b/defs/coins/bcash.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoincash:", + "uri_prefix": "bitcoincash", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bcash_testnet.json b/defs/coins/bcash_testnet.json index c3946b6b5..7527265a0 100644 --- a/defs/coins/bcash_testnet.json +++ b/defs/coins/bcash_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoincash:", + "uri_prefix": "bitcoincash", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bgold.json b/defs/coins/bgold.json index c275002c5..2076806d7 100644 --- a/defs/coins/bgold.json +++ b/defs/coins/bgold.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoingold:", + "uri_prefix": "bitcoingold", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bgold_testnet.json b/defs/coins/bgold_testnet.json index f31bd18bb..7a18807e9 100644 --- a/defs/coins/bgold_testnet.json +++ b/defs/coins/bgold_testnet.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoingold:", + "uri_prefix": "bitcoingold", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bitcoin.json b/defs/coins/bitcoin.json index a847f70e3..b4850c5b3 100644 --- a/defs/coins/bitcoin.json +++ b/defs/coins/bitcoin.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoin:", + "uri_prefix": "bitcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bitcoin_testnet.json b/defs/coins/bitcoin_testnet.json index 69425f930..a51172e8b 100644 --- a/defs/coins/bitcoin_testnet.json +++ b/defs/coins/bitcoin_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoin:", + "uri_prefix": "bitcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/bitcore.json b/defs/coins/bitcore.json index 55ad1bd5f..9cdb0b6e2 100644 --- a/defs/coins/bitcore.json +++ b/defs/coins/bitcore.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 150, - "address_prefix": "bitcore:", + "uri_prefix": "bitcore", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/bprivate.json b/defs/coins/bprivate.json index ac577afa5..7a1b5a6a7 100644 --- a/defs/coins/bprivate.json +++ b/defs/coins/bprivate.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 150, - "address_prefix": "bitcoinprivate:", + "uri_prefix": "bitcoinprivate", "min_address_length": 35, "max_address_length": 95, "bitcore": [ diff --git a/defs/coins/crown.json b/defs/coins/crown.json index 03ae5dfa7..fe1dcbf5c 100644 --- a/defs/coins/crown.json +++ b/defs/coins/crown.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "crown:", + "uri_prefix": "crown", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/dash.json b/defs/coins/dash.json index da9ecf0ea..f216a03df 100644 --- a/defs/coins/dash.json +++ b/defs/coins/dash.json @@ -30,7 +30,7 @@ }, "dust_limit": 5460, "blocktime_seconds": 150, - "address_prefix": "dash:", + "uri_prefix": "dash", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/dash_testnet.json b/defs/coins/dash_testnet.json index 12185287d..f4dad1050 100644 --- a/defs/coins/dash_testnet.json +++ b/defs/coins/dash_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 5460, "blocktime_seconds": 150, - "address_prefix": "dash:", + "uri_prefix": "dash", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/decred.json b/defs/coins/decred.json index 48690e10c..a644c537b 100644 --- a/defs/coins/decred.json +++ b/defs/coins/decred.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoin:", + "uri_prefix": "bitcoin", "min_address_length": 35, "max_address_length": 35, "bitcore": [ diff --git a/defs/coins/decred_testnet.json b/defs/coins/decred_testnet.json index cff5edf0a..ba8cac9c5 100644 --- a/defs/coins/decred_testnet.json +++ b/defs/coins/decred_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "bitcoin:", + "uri_prefix": "bitcoin", "min_address_length": 35, "max_address_length": 35, "bitcore": [ diff --git a/defs/coins/denarius.json b/defs/coins/denarius.json index 0b73d069a..7edddd892 100644 --- a/defs/coins/denarius.json +++ b/defs/coins/denarius.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 30, - "address_prefix": "denarius:", + "uri_prefix": "denarius", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/digibyte.json b/defs/coins/digibyte.json index e2f98a968..0d246e5b6 100644 --- a/defs/coins/digibyte.json +++ b/defs/coins/digibyte.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 15, - "address_prefix": "digibyte:", + "uri_prefix": "digibyte", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/dogecoin.json b/defs/coins/dogecoin.json index b7646dda3..fd9630dfa 100644 --- a/defs/coins/dogecoin.json +++ b/defs/coins/dogecoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 10000000, "blocktime_seconds": 60, - "address_prefix": "dogecoin:", + "uri_prefix": "dogecoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/feathercoin.json b/defs/coins/feathercoin.json index a7088e5c7..7eba94e47 100644 --- a/defs/coins/feathercoin.json +++ b/defs/coins/feathercoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 60, - "address_prefix": "feathercoin:", + "uri_prefix": "feathercoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/flashcoin.json b/defs/coins/flashcoin.json index 76c65911c..7b1471386 100644 --- a/defs/coins/flashcoin.json +++ b/defs/coins/flashcoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 10000, "blocktime_seconds": 60, - "address_prefix": "flashcoin:", + "uri_prefix": "flashcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/fujicoin.json b/defs/coins/fujicoin.json index b8725a2e5..91ff79a39 100644 --- a/defs/coins/fujicoin.json +++ b/defs/coins/fujicoin.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "fujicoin:", + "uri_prefix": "fujicoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/groestlcoin.json b/defs/coins/groestlcoin.json index 4cc925414..cacc73022 100644 --- a/defs/coins/groestlcoin.json +++ b/defs/coins/groestlcoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "groestlcoin:", + "uri_prefix": "groestlcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/groestlcoin_testnet.json b/defs/coins/groestlcoin_testnet.json index da572ffa3..6e8f6a338 100644 --- a/defs/coins/groestlcoin_testnet.json +++ b/defs/coins/groestlcoin_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "groestlcoin:", + "uri_prefix": "groestlcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/koto.json b/defs/coins/koto.json index 913719f38..aa67aa500 100644 --- a/defs/coins/koto.json +++ b/defs/coins/koto.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "koto:", + "uri_prefix": "koto", "min_address_length": 35, "max_address_length": 95, "bitcore": [ diff --git a/defs/coins/litecoin.json b/defs/coins/litecoin.json index fa1683f70..9b6b6c254 100644 --- a/defs/coins/litecoin.json +++ b/defs/coins/litecoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 150, - "address_prefix": "litecoin:", + "uri_prefix": "litecoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/litecoin_testnet.json b/defs/coins/litecoin_testnet.json index 15d252c58..1c15e6ecf 100644 --- a/defs/coins/litecoin_testnet.json +++ b/defs/coins/litecoin_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 150, - "address_prefix": "litecoin:", + "uri_prefix": "litecoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/monacoin.json b/defs/coins/monacoin.json index a5ebdadcb..5315cf8ba 100644 --- a/defs/coins/monacoin.json +++ b/defs/coins/monacoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 90, - "address_prefix": "monacoin:", + "uri_prefix": "monacoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/monetaryunit.json b/defs/coins/monetaryunit.json index e374c79e0..634a8fc85 100644 --- a/defs/coins/monetaryunit.json +++ b/defs/coins/monetaryunit.json @@ -30,7 +30,7 @@ }, "dust_limit": 5460, "blocktime_seconds": 40, - "address_prefix": "monetaryunit:", + "uri_prefix": "monetaryunit", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/myriad.json b/defs/coins/myriad.json index f800dc36f..eaae7a15a 100644 --- a/defs/coins/myriad.json +++ b/defs/coins/myriad.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 60, - "address_prefix": "myriadcoin:", + "uri_prefix": "myriadcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/namecoin.json b/defs/coins/namecoin.json index e794648e1..cd3628278 100644 --- a/defs/coins/namecoin.json +++ b/defs/coins/namecoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 2940, "blocktime_seconds": 600, - "address_prefix": "namecoin:", + "uri_prefix": "namecoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/pesetacoin.json b/defs/coins/pesetacoin.json index 2ab79f22f..51a56859e 100644 --- a/defs/coins/pesetacoin.json +++ b/defs/coins/pesetacoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 10000000, "blocktime_seconds": 60, - "address_prefix": "pesetacoin:", + "uri_prefix": "pesetacoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/terracoin.json b/defs/coins/terracoin.json index 824ef927e..4b1f20cde 100644 --- a/defs/coins/terracoin.json +++ b/defs/coins/terracoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 5460, "blocktime_seconds": 120, - "address_prefix": "terracoin:", + "uri_prefix": "terracoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/vertcoin.json b/defs/coins/vertcoin.json index bc23403aa..096d2e090 100644 --- a/defs/coins/vertcoin.json +++ b/defs/coins/vertcoin.json @@ -30,7 +30,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 150, - "address_prefix": "vertcoin:", + "uri_prefix": "vertcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [], diff --git a/defs/coins/viacoin.json b/defs/coins/viacoin.json index 73744e9bf..7e442cc12 100644 --- a/defs/coins/viacoin.json +++ b/defs/coins/viacoin.json @@ -33,7 +33,7 @@ }, "dust_limit": 54600, "blocktime_seconds": 24, - "address_prefix": "viacoin:", + "uri_prefix": "viacoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/zcash.json b/defs/coins/zcash.json index ae7b08e3f..34c7bec72 100644 --- a/defs/coins/zcash.json +++ b/defs/coins/zcash.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 150, - "address_prefix": "zcash:", + "uri_prefix": "zcash", "min_address_length": 35, "max_address_length": 95, "bitcore": [], diff --git a/defs/coins/zcash_testnet.json b/defs/coins/zcash_testnet.json index ca07cfe66..fffc3d85c 100644 --- a/defs/coins/zcash_testnet.json +++ b/defs/coins/zcash_testnet.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 150, - "address_prefix": "zcash:", + "uri_prefix": "zcash", "min_address_length": 35, "max_address_length": 95, "bitcore": [ diff --git a/defs/coins/zcoin.json b/defs/coins/zcoin.json index ac3347a15..707abec64 100644 --- a/defs/coins/zcoin.json +++ b/defs/coins/zcoin.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "zcoin:", + "uri_prefix": "zcoin", "min_address_length": 27, "max_address_length": 34, "bitcore": [ diff --git a/defs/coins/zcoin_testnet.json b/defs/coins/zcoin_testnet.json index c6b7e7312..76e47002a 100644 --- a/defs/coins/zcoin_testnet.json +++ b/defs/coins/zcoin_testnet.json @@ -33,7 +33,7 @@ }, "dust_limit": 546, "blocktime_seconds": 600, - "address_prefix": "testzcoin:", + "uri_prefix": "testzcoin", "min_address_length": 27, "max_address_length": 35, "bitcore": [], diff --git a/defs/coins/zencash.json b/defs/coins/zencash.json index 1fc5baf30..d50f2409e 100644 --- a/defs/coins/zencash.json +++ b/defs/coins/zencash.json @@ -30,7 +30,7 @@ }, "dust_limit": 546, "blocktime_seconds": 150, - "address_prefix": "zencash:", + "uri_prefix": "zencash", "min_address_length": 35, "max_address_length": 95, "bitcore": [ diff --git a/tools/build_coins.py b/tools/build_coins.py index 858a058f0..b730aa4b5 100755 --- a/tools/build_coins.py +++ b/tools/build_coins.py @@ -102,12 +102,12 @@ def validate_coin(coin): assert check_type(coin['dust_limit'], int) assert check_type(coin['blocktime_seconds'], int) assert check_type(coin['signed_message_header'], str) - assert check_type(coin['address_prefix'], str, regex=r'^.*:$') + assert check_type(coin['uri_prefix'], str, regex=r'^[a-z]+$') assert check_type(coin['min_address_length'], int) assert check_type(coin['max_address_length'], int) assert coin['max_address_length'] >= coin['min_address_length'] - assert check_type(coin['bech32_prefix'], str, nullable=True) - assert check_type(coin['cashaddr_prefix'], str, nullable=True) + assert check_type(coin['bech32_prefix'], str, regex=r'^[a-z]+$', nullable=True) + assert check_type(coin['cashaddr_prefix'], str, regex=r'^[a-z]+$', nullable=True) assert check_type(coin['bitcore'], list, empty=True) for bc in coin['bitcore']: assert not bc.endswith('/')