From 9491cd4b9eb5a63dbf1440230c6faf1e1dc3d65c Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 26 Jun 2018 21:22:24 +0200 Subject: [PATCH] defs: add blockbook field to build_coins script --- defs/coins/zencash.json | 5 +++-- protob/types.proto | 8 ++++---- tools/build_coins.py | 5 ++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/defs/coins/zencash.json b/defs/coins/zencash.json index ff0109a60..5971b88d2 100644 --- a/defs/coins/zencash.json +++ b/defs/coins/zencash.json @@ -34,5 +34,6 @@ "max_address_length": 95, "bitcore": [ "https://explorer.zen-solutions.io" - ] -} \ No newline at end of file + ], + "blockbook": [] +} diff --git a/protob/types.proto b/protob/types.proto index 6e58dcabf..b04bd82f5 100644 --- a/protob/types.proto +++ b/protob/types.proto @@ -187,8 +187,8 @@ message TxInputType { optional uint64 amount = 8; // amount of previous transaction output (for segwit only) optional uint32 decred_tree = 9; optional uint32 decred_script_version = 10; - optional bytes prev_block_hash_bip115 = 11; //block hash of previous transaction output (for bip115 implementation) - optional bytes prev_block_height_bip115 = 12; //block height of previous transaction output (for bip115 implementation) + optional bytes prev_block_hash_bip115 = 11; // block hash of previous transaction output (for bip115 implementation) + optional bytes prev_block_height_bip115 = 12; // block height of previous transaction output (for bip115 implementation) } /** @@ -204,8 +204,8 @@ message TxOutputType { optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be PAYTOMULTISIG optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN, amount must be 0 optional uint32 decred_script_version = 7; - optional bytes block_hash_bip115 = 8; //block hash of existing block (recommended current_block - 300) (for bip115 implementation) - optional bytes block_height_bip115 = 9; //block height of existing block (recommended current_block - 300) (for bip115 implementation) + optional bytes block_hash_bip115 = 8; // block hash of existing block (recommended current_block - 300) (for bip115 implementation) + optional bytes block_height_bip115 = 9; // block height of existing block (recommended current_block - 300) (for bip115 implementation) } /** diff --git a/tools/build_coins.py b/tools/build_coins.py index abac8b6d0..2403e22bb 100755 --- a/tools/build_coins.py +++ b/tools/build_coins.py @@ -100,6 +100,9 @@ def validate_coin(coin): assert check_type(coin['bitcore'], list, empty=True) for bc in coin['bitcore']: assert not bc.endswith('/') + assert check_type(coin['blockbook'], list, empty=True) + for bb in coin['blockbook']: + assert not bb.endswith('/') def validate_icon(icon): @@ -160,9 +163,9 @@ def convert_icon(icon): def process_json(fn): print(os.path.basename(fn), end=' ... ') j = json.load(open(fn)) + validate_coin(j) if BUILD_DEFS: i = Image.open(fn.replace('.json', '.png')) - validate_coin(j) validate_icon(i) ser = serialize(j, convert_icon(i)) sig = sign(ser)