Repository navigation
fix: accept null optional params in make_invoice and list_transactions - #54
Open
PatMulligan wants to merge 1 commit into
Open
PatMulligan wants to merge 1 commit into
PatMulligan wants to merge 1 commit into
Conversation
Clients may send optional params as an explicit JSON null rather than omitting them; Amethyst does for description, description_hash and expiry. dict.get only applies its default for a missing key, so description arrived as None and make_invoice failed with "'NoneType' object has no attribute 'encode'". Coerce with `or` instead, pass no unhashed_description when the description is blank, and apply the same to list_transactions' paging params, which had the same exposure. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Tbyw6FwjhEJg3gHfPHxWt
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Clients may send optional params as an explicit JSON
nullrather than omitting them; Amethyst does this fordescription,description_hashandexpiry.dict.getonly applies its default for a missing key, sodescriptionarrived asNoneandmake_invoicefailed with'NoneType' object has no attribute 'encode'.This coerces with
orinstead, passes nounhashed_descriptionwhen the description is blank, and applies the same tolist_transactions' paging params, which had the same exposure. Three unit tests cover the fields omitted, sent as null, and set; the null case reproduces the error on main.