diff options
Diffstat (limited to 'test/functional/mocks/signer.py')
-rwxr-xr-x | test/functional/mocks/signer.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/mocks/signer.py b/test/functional/mocks/signer.py new file mode 100755 index 0000000000..6b5c903886 --- /dev/null +++ b/test/functional/mocks/signer.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# Copyright (c) 2018 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import os +import sys +import argparse +import json + +def perform_pre_checks(): + mock_result_path = os.path.join(os.getcwd(), "mock_result") + if(os.path.isfile(mock_result_path)): + with open(mock_result_path, "r", encoding="utf8") as f: + mock_result = f.read() + if mock_result[0]: + sys.stdout.write(mock_result[2:]) + sys.exit(int(mock_result[0])) + +parser = argparse.ArgumentParser(prog='./signer.py', description='External signer mock') +subparsers = parser.add_subparsers(description='Commands', dest='command') +subparsers.required = True + +args = parser.parse_args() + +perform_pre_checks() + +args.func(args) |