Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/chainparams/generate_chainparams_constants.py
Show All 30 Lines | def process_constants(indir, file_name): | ||||
# Ensure only two lines are read from the file. | # Ensure only two lines are read from the file. | ||||
assert(len(constants) == 2) | assert(len(constants) == 2) | ||||
return [line.rstrip() for line in constants] | return [line.rstrip() for line in constants] | ||||
def main(): | def main(): | ||||
if len(sys.argv) != 2: | if len(sys.argv) != 2: | ||||
print('Usage: {} <dir_with_chainparams_txt>'.format(sys.argv[0]), file=sys.stderr) | print('Usage: {} <dir_with_chainparams_txt>'.format( | ||||
sys.argv[0]), file=sys.stderr) | |||||
sys.exit(1) | sys.exit(1) | ||||
indir = sys.argv[1] | indir = sys.argv[1] | ||||
print('''\ | print('''\ | ||||
#ifndef BITCOIN_CHAINPARAMSCONSTANTS_H | #ifndef BITCOIN_CHAINPARAMSCONSTANTS_H | ||||
#define BITCOIN_CHAINPARAMSCONSTANTS_H | #define BITCOIN_CHAINPARAMSCONSTANTS_H | ||||
/** | /** | ||||
Show All 26 Lines |