forked from LBRYCommunity/lbry-sdk
update fee parameter to match lbryschema
This commit is contained in:
parent
f258df95e6
commit
61cb3e2a8d
1 changed files with 14 additions and 20 deletions
|
@ -1834,26 +1834,13 @@ class Daemon(AuthJSONRPCServer):
|
|||
# original format {'currency':{'address','amount'}}
|
||||
# add address to fee if unspecified {'version': ,'currency', 'address' , 'amount'}
|
||||
if 'fee' in metadata:
|
||||
assert len(metadata['fee']) == 1, "Too many fees"
|
||||
currency, fee_dict = metadata['fee'].items()[0]
|
||||
if 'address' not in fee_dict:
|
||||
address = yield self.session.wallet.get_new_address()
|
||||
else:
|
||||
address = fee_dict['address']
|
||||
metadata['fee'] = {
|
||||
'version': '_0_0_1',
|
||||
'currency': currency,
|
||||
'address': address,
|
||||
'amount': fee_dict['amount']
|
||||
}
|
||||
|
||||
log.info("Publish: %s", {
|
||||
'name': name,
|
||||
'file_path': file_path,
|
||||
'bid': bid,
|
||||
'metadata': metadata,
|
||||
'fee': fee,
|
||||
})
|
||||
if 'amount' in metadata['fee'] and 'currency' in metadata['fee']:
|
||||
if not metadata['fee']['amount']:
|
||||
log.warning("Stripping empty fee from published metadata")
|
||||
del metadata['fee']
|
||||
elif 'address' not in metadata['fee']:
|
||||
address = yield self.session.wallet.get_unused_address()
|
||||
metadata['fee']['address'] = address
|
||||
|
||||
claim_dict = {
|
||||
'version': '_0_0_1',
|
||||
|
@ -1867,6 +1854,13 @@ class Daemon(AuthJSONRPCServer):
|
|||
if sources is not None:
|
||||
claim_dict['stream']['source'] = sources
|
||||
|
||||
log.info("Publish: %s", {
|
||||
'name': name,
|
||||
'file_path': file_path,
|
||||
'bid': bid,
|
||||
'claim_dict': claim_dict,
|
||||
})
|
||||
|
||||
if channel_id:
|
||||
certificate_id = channel_id
|
||||
elif channel_name:
|
||||
|
|
Loading…
Reference in a new issue