mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-23 17:27:25 +00:00
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'}}
|
# original format {'currency':{'address','amount'}}
|
||||||
# add address to fee if unspecified {'version': ,'currency', 'address' , 'amount'}
|
# add address to fee if unspecified {'version': ,'currency', 'address' , 'amount'}
|
||||||
if 'fee' in metadata:
|
if 'fee' in metadata:
|
||||||
assert len(metadata['fee']) == 1, "Too many fees"
|
if 'amount' in metadata['fee'] and 'currency' in metadata['fee']:
|
||||||
currency, fee_dict = metadata['fee'].items()[0]
|
if not metadata['fee']['amount']:
|
||||||
if 'address' not in fee_dict:
|
log.warning("Stripping empty fee from published metadata")
|
||||||
address = yield self.session.wallet.get_new_address()
|
del metadata['fee']
|
||||||
else:
|
elif 'address' not in metadata['fee']:
|
||||||
address = fee_dict['address']
|
address = yield self.session.wallet.get_unused_address()
|
||||||
metadata['fee'] = {
|
metadata['fee']['address'] = address
|
||||||
'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,
|
|
||||||
})
|
|
||||||
|
|
||||||
claim_dict = {
|
claim_dict = {
|
||||||
'version': '_0_0_1',
|
'version': '_0_0_1',
|
||||||
|
@ -1867,6 +1854,13 @@ class Daemon(AuthJSONRPCServer):
|
||||||
if sources is not None:
|
if sources is not None:
|
||||||
claim_dict['stream']['source'] = sources
|
claim_dict['stream']['source'] = sources
|
||||||
|
|
||||||
|
log.info("Publish: %s", {
|
||||||
|
'name': name,
|
||||||
|
'file_path': file_path,
|
||||||
|
'bid': bid,
|
||||||
|
'claim_dict': claim_dict,
|
||||||
|
})
|
||||||
|
|
||||||
if channel_id:
|
if channel_id:
|
||||||
certificate_id = channel_id
|
certificate_id = channel_id
|
||||||
elif channel_name:
|
elif channel_name:
|
||||||
|
|
Loading…
Add table
Reference in a new issue