Skip to content

Commit

Permalink
Merge pull request #2277 from blockstack/feat/v1-patch-btc-namespace
Browse files Browse the repository at this point in the history
feat: patch `btc` namespace price parameters
  • Loading branch information
zone117x authored Jan 7, 2021
2 parents 9045844 + 76e8360 commit a2cbb7e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion blockstack/blockstackd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3725,22 +3725,35 @@ class Program {
chainstate_txt_hash_output_path = chainstate_txt_output_path + '.sha256'
chainstate_f = open(chainstate_txt_output_path, 'w')

# namespace patches
namespace_patches = {
'btc': {
'buckets': '1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1', # originally: 3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3
'base': '1000', # originally: 100
'coeff': '200', # originally: 2
'nonalpha_discount': '1',
'no_vowel_discount': '1',
}
}
print_status("Querying namespace IDs...")
namespaces_entries = db.get_all_namespace_ids()
namespaces_entries.sort()
chainstate_f.write('-----BEGIN NAMESPACES-----\n')
chainstate_f.write('namespace_id,address,buckets,base,coeff,nonalpha_discount,no_vowel_discount,lifetime\n')
for namespace_str in namespaces_entries:
namespace_info = db.get_namespace(namespace_str)
namespace_id = namespace_info['namespace_id']
namespace = {}
namespace['namespace_id'] = namespace_info['namespace_id']
namespace['namespace_id'] = namespace_id
namespace['address'] = b58ToC32(str(namespace_info['address']))
namespace['buckets'] = ';'.join(str(x) for x in namespace_info['buckets'])
namespace['base'] = namespace_info['base']
namespace['coeff'] = namespace_info['coeff']
namespace['nonalpha_discount'] = namespace_info['nonalpha_discount']
namespace['no_vowel_discount'] = namespace_info['no_vowel_discount']
namespace['lifetime'] = 0 if namespace_info['lifetime'] == NAMESPACE_LIFE_INFINITE else namespace_info['lifetime']
if namespace_id in namespace_patches:
namespace.update(namespace_patches[namespace_id])
chainstate_f.write('{},{},{},{},{},{},{},{}\n'.format(
namespace['namespace_id'], namespace['address'],
namespace['buckets'], namespace['base'], namespace['coeff'], namespace['nonalpha_discount'],
Expand Down

0 comments on commit a2cbb7e

Please sign in to comment.