-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include existing claim amount in the max biddable amount for a publish #1108
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d72ef78
Removed daemon side bid checks during publish
hackrush01 2368433
Check for max usable balance before updating
hackrush01 3754f34
Review fixes and additional comments in test
hackrush01 dafa80c
Merge branch 'master' into update_fix
jackrobison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ | |
} | ||
|
||
SHORT_ID_LEN = 20 | ||
MAX_UPDATE_FEE_ESTIMATE = 0.3 | ||
|
||
|
||
class IterableContainer(object): | ||
|
@@ -710,8 +711,6 @@ def _publish_stream(self, name, bid, claim_dict, file_path=None, certificate_id= | |
publisher = Publisher(self.session, self.lbry_file_manager, self.session.wallet, | ||
certificate_id) | ||
parse_lbry_uri(name) | ||
if bid <= 0.0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason this is here is because otherwise we have to possibly make a stream before lbryum would tell us something is wrong |
||
raise Exception("Invalid bid") | ||
if not file_path: | ||
stream_hash = yield self.storage.get_stream_hash_for_sd_hash(claim_dict['stream']['source']['source']) | ||
claim_out = yield publisher.publish_stream(name, bid, claim_dict, stream_hash, claim_address, | ||
|
@@ -1981,9 +1980,11 @@ def jsonrpc_publish(self, name, bid, metadata=None, file_path=None, fee=None, ti | |
if bid <= 0.0: | ||
raise ValueError("Bid value must be greater than 0.0") | ||
|
||
if bid >= self.session.wallet.get_balance(): | ||
raise InsufficientFundsError('Insufficient funds. ' \ | ||
'Make sure you have enough LBC to deposit') | ||
amt = yield self.session.wallet.get_max_usable_balance_for_claim(name) | ||
if bid > amt: | ||
raise InsufficientFundsError( | ||
"Please lower the bid value, the maximum amount you can specify for this claim is {}" | ||
.format(amt - MAX_UPDATE_FEE_ESTIMATE)) | ||
|
||
metadata = metadata or {} | ||
if fee is not None: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a matching dummy method in
Wallet
tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!