improve readability of metadata and fee requirements

This commit is contained in:
Jack 2016-07-28 15:24:20 -04:00
parent 5dd68a7ed4
commit de4ddd578f

View file

@ -12,19 +12,27 @@ log = logging.getLogger(__name__)
BITTREX_FEE = 0.0025 BITTREX_FEE = 0.0025
# Metadata version
SOURCE_TYPES = ['lbry_sd_hash', 'url', 'btih'] SOURCE_TYPES = ['lbry_sd_hash', 'url', 'btih']
BASE_METADATA_FIELDS = ['title', 'description', 'author', 'language', 'license', 'content-type', 'sources'] BASE_METADATA_FIELDS = ['title', 'description', 'author', 'language', 'license', 'content-type', 'sources']
OPTIONAL_METADATA_FIELDS = ['thumbnail', 'preview', 'fee', 'contact', 'pubkey'] OPTIONAL_METADATA_FIELDS = ['thumbnail', 'preview', 'fee', 'contact', 'pubkey']
# v0.0.1 metadata MV001 = "0.0.1"
METADATA_REVISIONS = {'0.0.1': {'required': BASE_METADATA_FIELDS, 'optional': OPTIONAL_METADATA_FIELDS}} MV002 = "0.0.2"
# v0.0.2 metadata additions CURRENT_METADATA_VERSION = MV002
METADATA_REVISIONS['0.0.2'] = {'required': ['nsfw', 'ver'], 'optional': ['license_url']}
CURRENT_METADATA_VERSION = '0.0.2'
# v0.0.1 fee METADATA_REVISIONS = {}
FEE_REVISIONS = {'0.0.1': {'required': ['amount', 'address'], 'optional': []}} METADATA_REVISIONS[MV001] = {'required': BASE_METADATA_FIELDS, 'optional': OPTIONAL_METADATA_FIELDS}
CURRENT_FEE_REVISION = '0.0.1' METADATA_REVISIONS[MV002] = {'required': ['nsfw', 'ver'], 'optional': ['license_url']}
# Fee version
BASE_FEE_FIELDS = ['amount', 'address']
FV001 = "0.0.1"
CURRENT_FEE_REVISION = FV001
FEE_REVISIONS = {}
FEE_REVISIONS[FV001] = {'required': BASE_FEE_FIELDS, 'optional': []}
class LBRYFeeValidator(dict): class LBRYFeeValidator(dict):